Detangling incubator: virtual nets, tunnels, resource labels, oh my

- virtual networking moved to /apps/virtual; with CLI & REST API
- tunnels and labels moved to /apps/tunnel; with CLI & REST API; UI disabled for now
- protobuf/models moved to /core/protobuf/models
- defunct grpc/rpc registry stuff left under /graveyard
- compile dependencies on /incubator moved to respective modules for compilation
- run-time dependencies will need to be re-tested for dependent apps

- /graveyard will be removed in not-too-distant future

Change-Id: I0a0b995c635487edcf95a352f50dd162186b0b39
diff --git a/web/api/BUILD b/web/api/BUILD
index 6c6595a..7ce0305 100644
--- a/web/api/BUILD
+++ b/web/api/BUILD
@@ -1,6 +1,5 @@
 COMPILE_DEPS = CORE_DEPS + JACKSON + METRICS + [
     "@javax_ws_rs_api//jar",
-    "//incubator/api:onos-incubator-api",
     "//utils/rest:onlab-rest",
 ]
 
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/CoreWebApplication.java b/web/api/src/main/java/org/onosproject/rest/resources/CoreWebApplication.java
index 67b6c96..37242a0 100644
--- a/web/api/src/main/java/org/onosproject/rest/resources/CoreWebApplication.java
+++ b/web/api/src/main/java/org/onosproject/rest/resources/CoreWebApplication.java
@@ -48,11 +48,8 @@
                 MulticastRouteWebResource.class,
                 DeviceKeyWebResource.class,
                 RegionsWebResource.class,
-                TenantWebResource.class,
-                VirtualNetworkWebResource.class,
                 MastershipWebResource.class,
                 InvalidConfigExceptionMapper.class,
-                DpisWebResource.class,
                 DiagnosticsWebResource.class,
                 UiPreferencesWebResource.class,
                 SystemInfoWebResource.class,
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/DpisWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/DpisWebResource.java
deleted file mode 100644
index b59c7e8..0000000
--- a/web/api/src/main/java/org/onosproject/rest/resources/DpisWebResource.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.rest.resources;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import org.onosproject.incubator.net.dpi.DpiStatInfo;
-import org.onosproject.incubator.net.dpi.DpiStatistics;
-import org.onosproject.incubator.net.dpi.DpiStatisticsManagerService;
-import org.onosproject.incubator.net.dpi.FlowStatInfo;
-import org.onosproject.incubator.net.dpi.ProtocolStatInfo;
-import org.onosproject.rest.AbstractWebResource;
-import org.slf4j.Logger;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Comparator;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import static org.onlab.util.Tools.readTreeFromStream;
-import static org.slf4j.LoggerFactory.getLogger;
-
-/**
- * Query the latest DPI statistics info.
- */
-
-@Path("dpis")
-public class DpisWebResource extends AbstractWebResource {
-
-    private final Logger log = getLogger(getClass());
-
-    private static final int MAX_TOPN = 100;
-
-    private final DpiStatisticsManagerService service = get(DpiStatisticsManagerService.class);
-
-    public static final Comparator<ProtocolStatInfo> PROTOCOL_STAT_INFO_COMPARATOR =
-        new Comparator<ProtocolStatInfo>() {
-            @Override
-            public int compare(ProtocolStatInfo psi1, ProtocolStatInfo psi2) {
-                long delta = psi1.bytes() - psi2.bytes();
-                return delta == 0 ? 0 : (delta > 0 ? -1 : +1);
-            }
-        };
-
-    public static final Comparator<FlowStatInfo> FLOW_STAT_INFO_COMPARATOR =
-            new Comparator<FlowStatInfo>() {
-                @Override
-                public int compare(FlowStatInfo fsi1, FlowStatInfo fsi2) {
-                    long delta = fsi1.bytes() - fsi2.bytes();
-                    return delta == 0 ? 0 : (delta > 0 ? -1 : +1);
-                }
-            };
-
-    /**
-     * Gets the latest dpi statistics.
-     *
-     * @param topn max size
-     * @return 200 OK with a dpi statistics
-     * @onos.rsModel DpiStatistics
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getDpisLatest(@QueryParam("topn") int topn) {
-        log.debug("getDpisLatest request with topn={}", topn);
-
-        DpiStatistics ds = service.getDpiStatisticsLatest();
-        DpiStatistics retDs;
-
-        if (ds == null) {
-            retDs = new DpiStatistics("", new DpiStatInfo());
-        } else if (topn <= 0) {
-            retDs = ds;
-        } else {
-            if (topn > MAX_TOPN) {
-                topn = MAX_TOPN;
-            }
-            retDs = new DpiStatistics(ds.receivedTime(),
-                                      new DpiStatInfo(ds.dpiStatInfo().trafficStatistics()));
-            List<ProtocolStatInfo> psiList = ds.dpiStatInfo().detectedProtos();
-            if (psiList != null) {
-                // sorts protocol list with descending order based on bytes within topn
-                List<ProtocolStatInfo> psiListSorted =
-                        psiList.stream().sorted(PROTOCOL_STAT_INFO_COMPARATOR).
-                        limit(topn).collect(Collectors.toList());
-                retDs.dpiStatInfo().setDetectedProtos(psiListSorted);
-            }
-            List<FlowStatInfo> fsiList = ds.dpiStatInfo().knownFlows();
-            if (fsiList != null) {
-                // sorts known flow list with descending order based on bytes within topn
-                List<FlowStatInfo> fsiListSorted =
-                        fsiList.stream().sorted(FLOW_STAT_INFO_COMPARATOR).
-                                limit(topn).collect(Collectors.toList());
-                retDs.dpiStatInfo().setKnownFlows(fsiListSorted);
-            }
-            fsiList = ds.dpiStatInfo().unknownFlows();
-            if (fsiList != null) {
-                // sorts unknown flow list with descending order based on bytes within topn
-                List<FlowStatInfo> fsiListSorted =
-                        fsiList.stream().sorted(FLOW_STAT_INFO_COMPARATOR).
-                                limit(topn).collect(Collectors.toList());
-                retDs.dpiStatInfo().setUnknownFlows(fsiListSorted);
-            }
-        }
-
-        ObjectNode result = codec(DpiStatistics.class).encode(retDs, this);
-        return ok(result).build();
-
-    }
-
-    /**
-     * Gets the latest traffic statistics only.
-     *
-     * @return 200 OK with a traffic statistics
-     * @onos.rsModel TrafficStatistics
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("traffic")
-    public Response getTrafficStatistics() {
-        log.debug("getTrafficStatistics request");
-
-        DpiStatistics ds = service.getDpiStatisticsLatest();
-        if (ds == null) {
-            ds = new DpiStatistics("", new DpiStatInfo());
-        }
-
-        DpiStatInfo dsi = new DpiStatInfo();
-        dsi.setTrafficStatistics(ds.dpiStatInfo().trafficStatistics());
-        DpiStatistics dsTraffic = new DpiStatistics(ds.receivedTime(), dsi);
-
-        ObjectNode result = codec(DpiStatistics.class).encode(dsTraffic, this);
-        return ok(result).build();
-    }
-
-    /**
-     * Gets the latest detected protocol statistics only.
-     *
-     * @param topn max size
-     * @return 200 OK with a protocol statistics
-     * @onos.rsModel ProtocolStatistics
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("protocols")
-    public Response getDetectedProtocols(@QueryParam("topn") int topn) {
-        log.debug("getDetectedProtocols request with topn={}", topn);
-
-        DpiStatistics ds = service.getDpiStatisticsLatest();
-        DpiStatistics dsProtocol;
-
-        if (ds == null) {
-            dsProtocol = new DpiStatistics("", new DpiStatInfo());
-        } else if (topn <= 0) {
-            DpiStatInfo dsi = new DpiStatInfo();
-            dsi.setDetectedProtos(ds.dpiStatInfo().detectedProtos());
-            dsProtocol = new DpiStatistics(ds.receivedTime(), dsi);
-        } else {
-            if (topn > MAX_TOPN) {
-                topn = MAX_TOPN;
-            }
-            dsProtocol = new DpiStatistics(ds.receivedTime(), new DpiStatInfo());
-            List<ProtocolStatInfo> psiList = ds.dpiStatInfo().detectedProtos();
-            if (psiList != null) {
-                // sorts protocol list with descending order based on bytes within topn
-                List<ProtocolStatInfo> psiListSorted =
-                        psiList.stream().sorted(PROTOCOL_STAT_INFO_COMPARATOR).
-                                limit(topn).collect(Collectors.toList());
-                dsProtocol.dpiStatInfo().setDetectedProtos(psiListSorted);
-            }
-        }
-
-        ObjectNode result = codec(DpiStatistics.class).encode(dsProtocol, this);
-        return ok(result).build();
-    }
-
-    /**
-     * Gets the latest known flows statistics only.
-     *
-     * @param topn max size
-     * @return 200 OK with a known flow statistics
-     * @onos.rsModel KnownFlowStatistics
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("knownFlows")
-    public Response getKnownFlows(@QueryParam("topn") int topn) {
-        log.debug("getKnownFlows request with topn={}", topn);
-
-        DpiStatistics ds = service.getDpiStatisticsLatest();
-        DpiStatistics dsKnownFlows;
-
-        if (ds == null) {
-            dsKnownFlows = new DpiStatistics("", new DpiStatInfo());
-        } else if (topn <= 0) {
-            DpiStatInfo dsi = new DpiStatInfo();
-            dsi.setKnownFlows(ds.dpiStatInfo().knownFlows());
-            dsKnownFlows = new DpiStatistics(ds.receivedTime(), dsi);
-        } else {
-            if (topn > MAX_TOPN) {
-                topn = MAX_TOPN;
-            }
-            dsKnownFlows = new DpiStatistics(ds.receivedTime(), new DpiStatInfo());
-            List<FlowStatInfo> fsiList = ds.dpiStatInfo().knownFlows();
-            if (fsiList != null) {
-                // sorts known flow list with descending order based on bytes within topn
-                List<FlowStatInfo> fsiListSorted =
-                        fsiList.stream().sorted(FLOW_STAT_INFO_COMPARATOR).
-                                limit(topn).collect(Collectors.toList());
-                dsKnownFlows.dpiStatInfo().setKnownFlows(fsiListSorted);
-            }
-        }
-
-        ObjectNode result = codec(DpiStatistics.class).encode(dsKnownFlows, this);
-        return ok(result).build();
-    }
-
-    /**
-     * Gets the latest unknown flows statistics only.
-     *
-     * @param topn max size
-     * @return 200 OK with an unknown flow statistics
-     * @onos.rsModel UnknownFlowStatistics
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("unknownFlows")
-    public Response getUnknownFlows(@QueryParam("topn") int topn) {
-        log.debug("getUnknownFlows request with topn={}", topn);
-
-        DpiStatistics ds = service.getDpiStatisticsLatest();
-        DpiStatistics dsUnknownFlows;
-
-        if (ds == null) {
-            dsUnknownFlows = new DpiStatistics("", new DpiStatInfo());
-        } else if (topn <= 0) {
-            DpiStatInfo dsi = new DpiStatInfo();
-            dsi.setUnknownFlows(ds.dpiStatInfo().unknownFlows());
-            dsUnknownFlows = new DpiStatistics(ds.receivedTime(), dsi);
-        } else {
-            if (topn > 100) {
-                topn = 100;
-            }
-            dsUnknownFlows = new DpiStatistics(ds.receivedTime(), new DpiStatInfo());
-            List<FlowStatInfo> fsiList = ds.dpiStatInfo().unknownFlows();
-            if (fsiList != null) {
-                // sorts unknown flow list with descending order based on bytes within topn
-                List<FlowStatInfo> fsiListSorted =
-                        fsiList.stream().sorted(FLOW_STAT_INFO_COMPARATOR).
-                                limit(topn).collect(Collectors.toList());
-                dsUnknownFlows.dpiStatInfo().setUnknownFlows(fsiListSorted);
-            }
-        }
-
-        ObjectNode result = codec(DpiStatistics.class).encode(dsUnknownFlows, this);
-        return ok(result).build();
-    }
-
-    /**
-     * Add new dpi statistics entry at the end of list.
-     *
-     * @param stream dpi statistics JSON
-     * @return status of the request - CREATED if the JSON is correct,
-     * BAD_REQUEST if the JSON is invalid
-     * @onos.rsModel DpiStatisticsPost
-     */
-    @POST
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response addDpiStatistics(InputStream stream) {
-        ObjectNode result;
-
-        try {
-            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-            log.debug("jsonTree={}", jsonTree);
-
-            DpiStatistics ds = codec(DpiStatistics.class).decode(jsonTree, this);
-            if (ds == null) {
-                log.error("Wrong DpiStatistics json format error");
-            }
-
-            // TODO: check the validity of dpi statistics values, specially receivedTime format
-            DpiStatistics added = service.addDpiStatistics(ds);
-
-            result = codec(DpiStatistics.class).encode(added, this);
-        } catch (IOException ex) {
-            throw new IllegalArgumentException(ex);
-        }
-        return ok(result).build();
-    }
-}
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/TenantWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/TenantWebResource.java
deleted file mode 100644
index 9250edf..0000000
--- a/web/api/src/main/java/org/onosproject/rest/resources/TenantWebResource.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.rest.resources;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import org.onlab.util.ItemNotFoundException;
-import org.onosproject.incubator.net.virtual.TenantId;
-import org.onosproject.incubator.net.virtual.VirtualNetworkAdminService;
-import org.onosproject.rest.AbstractWebResource;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.UriInfo;
-import java.io.IOException;
-import java.io.InputStream;
-
-import static org.onlab.util.Tools.readTreeFromStream;
-
-/**
- * Query and manage tenants of virtual networks.
- */
-@Path("tenants")
-public class TenantWebResource extends AbstractWebResource {
-
-    private static final String MISSING_TENANTID = "Missing tenant identifier";
-    private static final String TENANTID_NOT_FOUND = "Tenant identifier not found";
-    private static final String INVALID_TENANTID = "Invalid tenant identifier ";
-
-    @Context
-    private UriInfo uriInfo;
-
-    private final VirtualNetworkAdminService vnetAdminService = get(VirtualNetworkAdminService.class);
-
-    /**
-     * Returns all tenant identifiers.
-     *
-     * @return 200 OK with set of tenant identifiers
-     * @onos.rsModel TenantIds
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getVirtualNetworkTenantIds() {
-        Iterable<TenantId> tenantIds = vnetAdminService.getTenantIds();
-        return ok(encodeArray(TenantId.class, "tenants", tenantIds)).build();
-    }
-
-    /**
-     * Creates a tenant with the given tenant identifier.
-     *
-     * @param stream TenantId JSON stream
-     * @return status of the request - CREATED if the JSON is correct,
-     * BAD_REQUEST if the JSON is invalid
-     * @onos.rsModel TenantId
-     */
-    @POST
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response addTenantId(InputStream stream) {
-        try {
-            final TenantId tid = getTenantIdFromJsonStream(stream);
-            vnetAdminService.registerTenantId(tid);
-            final TenantId resultTid = getExistingTenantId(vnetAdminService, tid);
-            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
-                    .path("tenants")
-                    .path(resultTid.id());
-            return Response
-                    .created(locationBuilder.build())
-                    .build();
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-    }
-
-    /**
-     * Removes the specified tenant with the specified tenant identifier.
-     *
-     * @param tenantId tenant identifier
-     * @return 204 NO CONTENT
-     */
-    @DELETE
-    @Path("{tenantId}")
-    public Response removeTenantId(@PathParam("tenantId") String tenantId) {
-        final TenantId tid = TenantId.tenantId(tenantId);
-        final TenantId existingTid = getExistingTenantId(vnetAdminService, tid);
-        vnetAdminService.unregisterTenantId(existingTid);
-        return Response.noContent().build();
-    }
-
-    /**
-     * Gets the tenant identifier from the JSON stream.
-     *
-     * @param stream TenantId JSON stream
-     * @return TenantId
-     * @throws IOException if unable to parse the request
-     */
-    private TenantId getTenantIdFromJsonStream(InputStream stream) throws IOException {
-        ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-        JsonNode specifiedTenantId = jsonTree.get("id");
-
-        if (specifiedTenantId == null) {
-            throw new IllegalArgumentException(MISSING_TENANTID);
-        }
-        return TenantId.tenantId(specifiedTenantId.asText());
-    }
-
-    /**
-     * Get the matching tenant identifier from existing tenant identifiers in system.
-     *
-     * @param vnetAdminSvc virtual network administration service
-     * @param tidIn        tenant identifier
-     * @return TenantId
-     */
-    protected static TenantId getExistingTenantId(VirtualNetworkAdminService vnetAdminSvc,
-                                                TenantId tidIn) {
-        return vnetAdminSvc
-                .getTenantIds()
-                .stream()
-                .filter(tenantId -> tenantId.equals(tidIn))
-                .findFirst()
-                .orElseThrow(() -> new ItemNotFoundException(TENANTID_NOT_FOUND));
-    }
-}
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/VirtualNetworkWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/VirtualNetworkWebResource.java
deleted file mode 100644
index 0e3504c..0000000
--- a/web/api/src/main/java/org/onosproject/rest/resources/VirtualNetworkWebResource.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.rest.resources;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import org.onosproject.incubator.net.virtual.NetworkId;
-import org.onosproject.incubator.net.virtual.TenantId;
-import org.onosproject.incubator.net.virtual.VirtualDevice;
-import org.onosproject.incubator.net.virtual.VirtualHost;
-import org.onosproject.incubator.net.virtual.VirtualLink;
-import org.onosproject.incubator.net.virtual.VirtualNetwork;
-import org.onosproject.incubator.net.virtual.VirtualNetworkAdminService;
-import org.onosproject.incubator.net.virtual.VirtualNetworkService;
-import org.onosproject.incubator.net.virtual.VirtualPort;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.PortNumber;
-import org.onosproject.rest.AbstractWebResource;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.UriInfo;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import static org.onlab.util.Tools.readTreeFromStream;
-
-/**
- * Query and Manage Virtual Network elements.
- */
-@Path("vnets")
-public class VirtualNetworkWebResource extends AbstractWebResource {
-
-    private static final String MISSING_FIELD = "Missing ";
-    private static final String INVALID_FIELD = "Invalid ";
-
-    private final VirtualNetworkAdminService vnetAdminService = get(VirtualNetworkAdminService.class);
-    private final VirtualNetworkService vnetService = get(VirtualNetworkService.class);
-
-    @Context
-    private UriInfo uriInfo;
-
-    // VirtualNetwork
-
-    /**
-     * Returns all virtual networks.
-     *
-     * @return 200 OK with set of virtual networks
-     * @onos.rsModel VirtualNetworks
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response getVirtualNetworks() {
-        Set<TenantId> tenantIds = vnetAdminService.getTenantIds();
-        List<VirtualNetwork> allVnets = tenantIds.stream()
-                .map(tenantId -> vnetService.getVirtualNetworks(tenantId))
-                .flatMap(Collection::stream)
-                .collect(Collectors.toList());
-        return ok(encodeArray(VirtualNetwork.class, "vnets", allVnets)).build();
-    }
-
-    /**
-     * Returns the virtual networks with the specified tenant identifier.
-     *
-     * @param tenantId tenant identifier
-     * @return 200 OK with a virtual network, 404 not found
-     * @onos.rsModel VirtualNetworks
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("{tenantId}")
-    public Response getVirtualNetworkById(@PathParam("tenantId") String tenantId) {
-        final TenantId existingTid = TenantWebResource.getExistingTenantId(vnetAdminService,
-                                                                           TenantId.tenantId(tenantId));
-        Set<VirtualNetwork> vnets = vnetService.getVirtualNetworks(existingTid);
-        return ok(encodeArray(VirtualNetwork.class, "vnets", vnets)).build();
-    }
-
-    /**
-     * Creates a virtual network from the JSON input stream.
-     *
-     * @param stream tenant identifier JSON stream
-     * @return status of the request - CREATED if the JSON is correct,
-     * BAD_REQUEST if the JSON is invalid
-     * @onos.rsModel TenantId
-     */
-    @POST
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response createVirtualNetwork(InputStream stream) {
-        try {
-            final TenantId tid = TenantId.tenantId(getFromJsonStream(stream, "id").asText());
-            VirtualNetwork newVnet = vnetAdminService.createVirtualNetwork(tid);
-            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
-                    .path("vnets")
-                    .path(newVnet.id().toString());
-            return Response
-                    .created(locationBuilder.build())
-                    .build();
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-    }
-
-    /**
-     * Removes the virtual network with the specified network identifier.
-     *
-     * @param networkId network identifier
-     * @return 204 NO CONTENT
-     */
-    @DELETE
-    @Path("{networkId}")
-    public Response removeVirtualNetwork(@PathParam("networkId") long networkId) {
-        NetworkId nid = NetworkId.networkId(networkId);
-        vnetAdminService.removeVirtualNetwork(nid);
-        return Response.noContent().build();
-    }
-
-    // VirtualDevice
-
-    /**
-     * Returns all virtual network devices in a virtual network.
-     *
-     * @param networkId network identifier
-     * @return 200 OK with set of virtual devices, 404 not found
-     * @onos.rsModel VirtualDevices
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("{networkId}/devices")
-    public Response getVirtualDevices(@PathParam("networkId") long networkId) {
-        NetworkId nid = NetworkId.networkId(networkId);
-        Set<VirtualDevice> vdevs = vnetService.getVirtualDevices(nid);
-        return ok(encodeArray(VirtualDevice.class, "devices", vdevs)).build();
-    }
-
-    /**
-     * Creates a virtual device from the JSON input stream.
-     *
-     * @param networkId network identifier
-     * @param stream    virtual device JSON stream
-     * @return status of the request - CREATED if the JSON is correct,
-     * BAD_REQUEST if the JSON is invalid
-     * @onos.rsModel VirtualDevice
-     */
-    @POST
-    @Path("{networkId}/devices")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response createVirtualDevice(@PathParam("networkId") long networkId,
-                                        InputStream stream) {
-        try {
-            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-            final VirtualDevice vdevReq = codec(VirtualDevice.class).decode(jsonTree, this);
-            JsonNode specifiedNetworkId = jsonTree.get("networkId");
-            if (specifiedNetworkId == null || specifiedNetworkId.asLong() != (networkId)) {
-                throw new IllegalArgumentException(INVALID_FIELD + "networkId");
-            }
-            final VirtualDevice vdevRes = vnetAdminService.createVirtualDevice(vdevReq.networkId(),
-                                                                               vdevReq.id());
-            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
-                    .path("vnets").path(specifiedNetworkId.asText())
-                    .path("devices").path(vdevRes.id().toString());
-            return Response
-                    .created(locationBuilder.build())
-                    .build();
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-    }
-
-    /**
-     * Removes the virtual network device from the virtual network.
-     *
-     * @param networkId network identifier
-     * @param deviceId  device identifier
-     * @return 204 NO CONTENT
-     */
-    @DELETE
-    @Path("{networkId}/devices/{deviceId}")
-    public Response removeVirtualDevice(@PathParam("networkId") long networkId,
-                                        @PathParam("deviceId") String deviceId) {
-        NetworkId nid = NetworkId.networkId(networkId);
-        DeviceId did = DeviceId.deviceId(deviceId);
-        vnetAdminService.removeVirtualDevice(nid, did);
-        return Response.noContent().build();
-    }
-
-    // VirtualPort
-
-    /**
-     * Returns all virtual network ports in a virtual device in a virtual network.
-     *
-     * @param networkId network identifier
-     * @param deviceId  virtual device identifier
-     * @return 200 OK with set of virtual ports, 404 not found
-     * @onos.rsModel VirtualPorts
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("{networkId}/devices/{deviceId}/ports")
-    public Response getVirtualPorts(@PathParam("networkId") long networkId,
-                                    @PathParam("deviceId") String deviceId) {
-        NetworkId nid = NetworkId.networkId(networkId);
-        Iterable<VirtualPort> vports = vnetService.getVirtualPorts(nid, DeviceId.deviceId(deviceId));
-        return ok(encodeArray(VirtualPort.class, "ports", vports)).build();
-    }
-
-    /**
-     * Creates a virtual network port in a virtual device in a virtual network.
-     *
-     * @param networkId    network identifier
-     * @param virtDeviceId virtual device identifier
-     * @param stream       virtual port JSON stream
-     * @return status of the request - CREATED if the JSON is correct,
-     * BAD_REQUEST if the JSON is invalid
-     * @onos.rsModel VirtualPort
-     */
-    @POST
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("{networkId}/devices/{deviceId}/ports")
-    public Response createVirtualPort(@PathParam("networkId") long networkId,
-                                      @PathParam("deviceId") String virtDeviceId,
-                                      InputStream stream) {
-        try {
-            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-//            final VirtualPort vportReq = codec(VirtualPort.class).decode(jsonTree, this);
-            JsonNode specifiedNetworkId = jsonTree.get("networkId");
-            JsonNode specifiedDeviceId = jsonTree.get("deviceId");
-            if (specifiedNetworkId == null || specifiedNetworkId.asLong() != (networkId)) {
-                throw new IllegalArgumentException(INVALID_FIELD + "networkId");
-            }
-            if (specifiedDeviceId == null || !specifiedDeviceId.asText().equals(virtDeviceId)) {
-                throw new IllegalArgumentException(INVALID_FIELD + "deviceId");
-            }
-            JsonNode specifiedPortNum = jsonTree.get("portNum");
-            JsonNode specifiedPhysDeviceId = jsonTree.get("physDeviceId");
-            JsonNode specifiedPhysPortNum = jsonTree.get("physPortNum");
-            final NetworkId nid = NetworkId.networkId(networkId);
-            DeviceId vdevId = DeviceId.deviceId(virtDeviceId);
-
-            ConnectPoint realizedBy = new ConnectPoint(DeviceId.deviceId(specifiedPhysDeviceId.asText()),
-                                              PortNumber.portNumber(specifiedPhysPortNum.asText()));
-            VirtualPort vport = vnetAdminService.createVirtualPort(nid, vdevId,
-                                    PortNumber.portNumber(specifiedPortNum.asText()), realizedBy);
-            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
-                    .path("vnets").path(specifiedNetworkId.asText())
-                    .path("devices").path(specifiedDeviceId.asText())
-                    .path("ports").path(vport.number().toString());
-            return Response
-                    .created(locationBuilder.build())
-                    .build();
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-    }
-
-    /**
-     * Removes the virtual network port from the virtual device in a virtual network.
-     *
-     * @param networkId network identifier
-     * @param deviceId  virtual device identifier
-     * @param portNum   virtual port number
-     * @return 204 NO CONTENT
-     */
-    @DELETE
-    @Path("{networkId}/devices/{deviceId}/ports/{portNum}")
-    public Response removeVirtualPort(@PathParam("networkId") long networkId,
-                                      @PathParam("deviceId") String deviceId,
-                                      @PathParam("portNum") long portNum) {
-        NetworkId nid = NetworkId.networkId(networkId);
-        vnetAdminService.removeVirtualPort(nid, DeviceId.deviceId(deviceId),
-                                           PortNumber.portNumber(portNum));
-        return Response.noContent().build();
-    }
-
-    // VirtualLink
-
-    /**
-     * Returns all virtual network links in a virtual network.
-     *
-     * @param networkId network identifier
-     * @return 200 OK with set of virtual network links
-     * @onos.rsModel VirtualLinks
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("{networkId}/links")
-    public Response getVirtualLinks(@PathParam("networkId") long networkId) {
-        NetworkId nid = NetworkId.networkId(networkId);
-        Set<VirtualLink> vlinks = vnetService.getVirtualLinks(nid);
-        return ok(encodeArray(VirtualLink.class, "links", vlinks)).build();
-    }
-
-    /**
-     * Creates a virtual network link from the JSON input stream.
-     *
-     * @param networkId network identifier
-     * @param stream    virtual link JSON stream
-     * @return status of the request - CREATED if the JSON is correct,
-     * BAD_REQUEST if the JSON is invalid
-     * @onos.rsModel VirtualLink
-     */
-    @POST
-    @Path("{networkId}/links")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response createVirtualLink(@PathParam("networkId") long networkId,
-                                      InputStream stream) {
-        try {
-            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-            JsonNode specifiedNetworkId = jsonTree.get("networkId");
-            if (specifiedNetworkId == null || specifiedNetworkId.asLong() != (networkId)) {
-                throw new IllegalArgumentException(INVALID_FIELD + "networkId");
-            }
-            final VirtualLink vlinkReq = codec(VirtualLink.class).decode(jsonTree, this);
-            vnetAdminService.createVirtualLink(vlinkReq.networkId(),
-                                               vlinkReq.src(), vlinkReq.dst());
-            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
-                    .path("vnets").path(specifiedNetworkId.asText())
-                    .path("links");
-            return Response
-                    .created(locationBuilder.build())
-                    .build();
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-    }
-
-    /**
-     * Removes the virtual network link from the JSON input stream.
-     *
-     * @param networkId network identifier
-     * @param stream    virtual link JSON stream
-     * @return 204 NO CONTENT
-     * @onos.rsModel VirtualLink
-     */
-    @DELETE
-    @Path("{networkId}/links")
-    @Consumes(MediaType.APPLICATION_JSON)
-    public Response removeVirtualLink(@PathParam("networkId") long networkId,
-                                      InputStream stream) {
-        try {
-            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-            JsonNode specifiedNetworkId = jsonTree.get("networkId");
-            if (specifiedNetworkId != null &&
-                    specifiedNetworkId.asLong() != (networkId)) {
-                throw new IllegalArgumentException(INVALID_FIELD + "networkId");
-            }
-            final VirtualLink vlinkReq = codec(VirtualLink.class).decode(jsonTree, this);
-            vnetAdminService.removeVirtualLink(vlinkReq.networkId(),
-                                               vlinkReq.src(), vlinkReq.dst());
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-
-        return Response.noContent().build();
-    }
-
-    /**
-     * Returns all virtual network hosts in a virtual network.
-     *
-     * @param networkId network identifier
-     * @return 200 OK with set of virtual network hosts
-     * @onos.rsModel VirtualHosts
-     */
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    @Path("{networkId}/hosts")
-    public Response getVirtualHosts(@PathParam("networkId") long networkId) {
-        NetworkId nid = NetworkId.networkId(networkId);
-        Set<VirtualHost> vhosts = vnetService.getVirtualHosts(nid);
-        return ok(encodeArray(VirtualHost.class, "hosts", vhosts)).build();
-    }
-
-    /**
-     * Creates a virtual network host from the JSON input stream.
-     *
-     * @param networkId network identifier
-     * @param stream    virtual host JSON stream
-     * @return status of the request - CREATED if the JSON is correct,
-     * BAD_REQUEST if the JSON is invalid
-     * @onos.rsModel VirtualHostPut
-     */
-    @POST
-    @Path("{networkId}/hosts")
-    @Consumes(MediaType.APPLICATION_JSON)
-    @Produces(MediaType.APPLICATION_JSON)
-    public Response createVirtualHost(@PathParam("networkId") long networkId,
-                                      InputStream stream) {
-        try {
-            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-            JsonNode specifiedNetworkId = jsonTree.get("networkId");
-            if (specifiedNetworkId == null || specifiedNetworkId.asLong() != (networkId)) {
-                throw new IllegalArgumentException(INVALID_FIELD + "networkId");
-            }
-            final VirtualHost vhostReq = codec(VirtualHost.class).decode(jsonTree, this);
-            vnetAdminService.createVirtualHost(vhostReq.networkId(), vhostReq.id(),
-                                               vhostReq.mac(), vhostReq.vlan(),
-                                               vhostReq.location(), vhostReq.ipAddresses());
-            UriBuilder locationBuilder = uriInfo.getBaseUriBuilder()
-                    .path("vnets").path(specifiedNetworkId.asText())
-                    .path("hosts");
-            return Response
-                    .created(locationBuilder.build())
-                    .build();
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-    }
-
-    /**
-     * Removes the virtual network host from the JSON input stream.
-     *
-     * @param networkId network identifier
-     * @param stream    virtual host JSON stream
-     * @return 204 NO CONTENT
-     * @onos.rsModel VirtualHost
-     */
-    @DELETE
-    @Path("{networkId}/hosts")
-    @Consumes(MediaType.APPLICATION_JSON)
-    public Response removeVirtualHost(@PathParam("networkId") long networkId,
-                                      InputStream stream) {
-        try {
-            ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-            JsonNode specifiedNetworkId = jsonTree.get("networkId");
-            if (specifiedNetworkId != null &&
-                    specifiedNetworkId.asLong() != (networkId)) {
-                throw new IllegalArgumentException(INVALID_FIELD + "networkId");
-            }
-            final VirtualHost vhostReq = codec(VirtualHost.class).decode(jsonTree, this);
-            vnetAdminService.removeVirtualHost(vhostReq.networkId(), vhostReq.id());
-        } catch (IOException e) {
-            throw new IllegalArgumentException(e);
-        }
-
-        return Response.noContent().build();
-    }
-
-    /**
-     * Get the tenant identifier from the JSON stream.
-     *
-     * @param stream        TenantId JSON stream
-     * @param jsonFieldName field name
-     * @return JsonNode
-     * @throws IOException if unable to parse the request
-     */
-    private JsonNode getFromJsonStream(InputStream stream, String jsonFieldName) throws IOException {
-        ObjectNode jsonTree = readTreeFromStream(mapper(), stream);
-        JsonNode jsonNode = jsonTree.get(jsonFieldName);
-
-        if (jsonNode == null) {
-            throw new IllegalArgumentException(MISSING_FIELD + jsonFieldName);
-        }
-        return jsonNode;
-    }
-}
diff --git a/web/api/src/main/resources/definitions/DpiStatistics.json b/web/api/src/main/resources/definitions/DpiStatistics.json
deleted file mode 100644
index d9f3010..0000000
--- a/web/api/src/main/resources/definitions/DpiStatistics.json
+++ /dev/null
@@ -1,307 +0,0 @@
-{
-  "type": "object",
-  "title": "dpiStatistics",
-  "required": [
-    "receivedTime",
-    "dpiStatInfo"
-  ],
-  "properties": {
-    "receivedTime": {
-      "type": "string",
-      "example": "2016-06-12 04:05:05"
-    },
-    "dpiStatInfo": {
-      "type": "object",
-      "title": "dpiStatInfo",
-      "required": [
-        "trafficStatistics",
-        "detectedProtos",
-        "knownFlows",
-        "unknownFlow"
-      ],
-      "properties": {
-        "trafficStatistics": {
-          "type": "object",
-          "title": "trafficStatistics",
-          "required": [
-            "ethernetBytes",
-            "discardedBytes",
-            "ipPackets",
-            "totalPackets",
-            "ipBytes",
-            "avgPktSize",
-            "uniqueFlows",
-            "tcpPackets",
-            "udpPackets",
-            "dpiThroughputPps",
-            "dpiThroughputBps",
-            "trafficThroughputPps",
-            "trafficThroughputBps",
-            "trafficDurationSec",
-            "guessedFlowProtos"
-          ],
-          "properties": {
-            "ethernetBytes": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "discardedBytes": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "ipPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "totalPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "ipBytes": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "avgPktSize": {
-              "type": "integer",
-              "format": "int32",
-              "example": 9889
-            },
-            "uniqueFlows": {
-              "type": "integer",
-              "format": "int32",
-              "example": 9889
-            },
-            "tcpPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "udpPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "dpiThroughputPps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "dpiThroughputBps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "trafficThroughputPps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "trafficThroughputBps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "trafficDurationSec": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "guessedFlowProtos": {
-              "type": "integer",
-              "format": "int32",
-              "example": 9889
-            }
-          }
-        },
-        "detectedProtos": {
-          "type": "array",
-          "xml": {
-            "name": "detectedProtos",
-            "wrapped": true
-          },
-          "items": {
-            "type": "object",
-            "title": "protos",
-            "required": [
-              "name",
-              "breed",
-              "packets",
-              "bytes",
-              "flows"
-            ],
-            "properties": {
-              "name": {
-                "type": "string",
-                "example": "TCP"
-              },
-              "breed": {
-                "type": "string",
-                "example": "Acceptable"
-              },
-              "packets": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "bytes": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "flows": {
-                "type": "integer",
-                "format": "int32",
-                "example": 9889
-              }
-            }
-          }
-        },
-        "knownFlows": {
-          "type": "array",
-          "xml": {
-            "name": "knownFlows",
-            "wrapped": true
-          },
-          "items": {
-            "type": "object",
-            "title": "knownFlows",
-            "required": [
-              "protocol",
-              "hostAName",
-              "hostAPort",
-              "hostBName",
-              "hostBPort",
-              "detectedProtocol",
-              "detectedProtocolName",
-              "packets",
-              "bytes",
-              "hostServerName"
-            ],
-            "properties": {
-              "protocol": {
-                "type": "string",
-                "example": "TCP"
-              },
-              "hostAName": {
-                "type": "string",
-                "example": "10.0.20.50"
-              },
-              "hostAPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 9889
-              },
-              "hostBName": {
-                "type": "string",
-                "example": "10.0.20.10"
-              },
-              "hostBPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 8181
-              },
-              "detectedProtocol": {
-                "type": "integer",
-                "format": "int32",
-                "example": 80
-              },
-              "detectedProtocolName": {
-                "type": "string",
-                "example": "HTTP"
-              },
-              "packets": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "bytes": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "hostSeverName": {
-                "type": "string",
-                "example": "raptor"
-              }
-            }
-          }
-        },
-        "unknownFlows": {
-          "type": "array",
-          "xml": {
-            "name": "unknownFlows",
-            "wrapped": true
-          },
-          "items": {
-            "type": "object",
-            "title": "unknownFlows",
-            "required": [
-              "protocol",
-              "hostAName",
-              "hostAPort",
-              "hostBName",
-              "hostBPort",
-              "detectedProtocol",
-              "detectedProtocolName",
-              "packets",
-              "bytes",
-              "hostServerName"
-            ],
-            "properties": {
-              "protocol": {
-                "type": "string",
-                "example": "TCP"
-              },
-              "hostAName": {
-                "type": "string",
-                "example": "10.0.20.50"
-              },
-              "hostAPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 9889
-              },
-              "hostBName": {
-                "type": "string",
-                "example": "10.0.20.10"
-              },
-              "hostBPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 8181
-              },
-              "detectedProtocol": {
-                "type": "integer",
-                "format": "int32",
-                "example": 80
-              },
-              "detectedProtocolName": {
-                "type": "string",
-                "example": "HTTP"
-              },
-              "packets": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "bytes": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "hostSeverName": {
-                "type": "string",
-                "example": "raptor"
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/DpiStatisticsPost.json b/web/api/src/main/resources/definitions/DpiStatisticsPost.json
deleted file mode 100644
index d9f3010..0000000
--- a/web/api/src/main/resources/definitions/DpiStatisticsPost.json
+++ /dev/null
@@ -1,307 +0,0 @@
-{
-  "type": "object",
-  "title": "dpiStatistics",
-  "required": [
-    "receivedTime",
-    "dpiStatInfo"
-  ],
-  "properties": {
-    "receivedTime": {
-      "type": "string",
-      "example": "2016-06-12 04:05:05"
-    },
-    "dpiStatInfo": {
-      "type": "object",
-      "title": "dpiStatInfo",
-      "required": [
-        "trafficStatistics",
-        "detectedProtos",
-        "knownFlows",
-        "unknownFlow"
-      ],
-      "properties": {
-        "trafficStatistics": {
-          "type": "object",
-          "title": "trafficStatistics",
-          "required": [
-            "ethernetBytes",
-            "discardedBytes",
-            "ipPackets",
-            "totalPackets",
-            "ipBytes",
-            "avgPktSize",
-            "uniqueFlows",
-            "tcpPackets",
-            "udpPackets",
-            "dpiThroughputPps",
-            "dpiThroughputBps",
-            "trafficThroughputPps",
-            "trafficThroughputBps",
-            "trafficDurationSec",
-            "guessedFlowProtos"
-          ],
-          "properties": {
-            "ethernetBytes": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "discardedBytes": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "ipPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "totalPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "ipBytes": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "avgPktSize": {
-              "type": "integer",
-              "format": "int32",
-              "example": 9889
-            },
-            "uniqueFlows": {
-              "type": "integer",
-              "format": "int32",
-              "example": 9889
-            },
-            "tcpPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "udpPackets": {
-              "type": "integer",
-              "format": "int64",
-              "example": 69889
-            },
-            "dpiThroughputPps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "dpiThroughputBps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "trafficThroughputPps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "trafficThroughputBps": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "trafficDurationSec": {
-              "type": "number",
-              "format": "double",
-              "example": 69889.12
-            },
-            "guessedFlowProtos": {
-              "type": "integer",
-              "format": "int32",
-              "example": 9889
-            }
-          }
-        },
-        "detectedProtos": {
-          "type": "array",
-          "xml": {
-            "name": "detectedProtos",
-            "wrapped": true
-          },
-          "items": {
-            "type": "object",
-            "title": "protos",
-            "required": [
-              "name",
-              "breed",
-              "packets",
-              "bytes",
-              "flows"
-            ],
-            "properties": {
-              "name": {
-                "type": "string",
-                "example": "TCP"
-              },
-              "breed": {
-                "type": "string",
-                "example": "Acceptable"
-              },
-              "packets": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "bytes": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "flows": {
-                "type": "integer",
-                "format": "int32",
-                "example": 9889
-              }
-            }
-          }
-        },
-        "knownFlows": {
-          "type": "array",
-          "xml": {
-            "name": "knownFlows",
-            "wrapped": true
-          },
-          "items": {
-            "type": "object",
-            "title": "knownFlows",
-            "required": [
-              "protocol",
-              "hostAName",
-              "hostAPort",
-              "hostBName",
-              "hostBPort",
-              "detectedProtocol",
-              "detectedProtocolName",
-              "packets",
-              "bytes",
-              "hostServerName"
-            ],
-            "properties": {
-              "protocol": {
-                "type": "string",
-                "example": "TCP"
-              },
-              "hostAName": {
-                "type": "string",
-                "example": "10.0.20.50"
-              },
-              "hostAPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 9889
-              },
-              "hostBName": {
-                "type": "string",
-                "example": "10.0.20.10"
-              },
-              "hostBPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 8181
-              },
-              "detectedProtocol": {
-                "type": "integer",
-                "format": "int32",
-                "example": 80
-              },
-              "detectedProtocolName": {
-                "type": "string",
-                "example": "HTTP"
-              },
-              "packets": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "bytes": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "hostSeverName": {
-                "type": "string",
-                "example": "raptor"
-              }
-            }
-          }
-        },
-        "unknownFlows": {
-          "type": "array",
-          "xml": {
-            "name": "unknownFlows",
-            "wrapped": true
-          },
-          "items": {
-            "type": "object",
-            "title": "unknownFlows",
-            "required": [
-              "protocol",
-              "hostAName",
-              "hostAPort",
-              "hostBName",
-              "hostBPort",
-              "detectedProtocol",
-              "detectedProtocolName",
-              "packets",
-              "bytes",
-              "hostServerName"
-            ],
-            "properties": {
-              "protocol": {
-                "type": "string",
-                "example": "TCP"
-              },
-              "hostAName": {
-                "type": "string",
-                "example": "10.0.20.50"
-              },
-              "hostAPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 9889
-              },
-              "hostBName": {
-                "type": "string",
-                "example": "10.0.20.10"
-              },
-              "hostBPort": {
-                "type": "integer",
-                "format": "int32",
-                "example": 8181
-              },
-              "detectedProtocol": {
-                "type": "integer",
-                "format": "int32",
-                "example": 80
-              },
-              "detectedProtocolName": {
-                "type": "string",
-                "example": "HTTP"
-              },
-              "packets": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "bytes": {
-                "type": "integer",
-                "format": "int64",
-                "example": 69889
-              },
-              "hostSeverName": {
-                "type": "string",
-                "example": "raptor"
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/TenantId.json b/web/api/src/main/resources/definitions/TenantId.json
deleted file mode 100644
index 237a9c4..0000000
--- a/web/api/src/main/resources/definitions/TenantId.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "type": "object",
-  "title": "TenantId",
-  "required": [
-    "id"
-  ],
-  "properties": {
-    "id": {
-      "type": "String",
-      "description": "Tenant identifier",
-      "example": "Tenant123"
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/TenantIds.json b/web/api/src/main/resources/definitions/TenantIds.json
deleted file mode 100644
index f568b9f..0000000
--- a/web/api/src/main/resources/definitions/TenantIds.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "type": "object",
-  "title": "tenants",
-  "required": [
-    "tenants"
-  ],
-  "properties": {
-    "tenants": {
-      "type": "array",
-      "xml": {
-        "name": "tenants",
-        "wrapped": true
-      },
-      "items": {
-        "type": "object",
-        "title": "tenant",
-        "required": [
-          "id"
-        ],
-        "properties": {
-          "id": {
-            "type": "String",
-            "description": "Tenant identifier",
-            "example": "Tenant123"
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualDevice.json b/web/api/src/main/resources/definitions/VirtualDevice.json
deleted file mode 100644
index ada054c..0000000
--- a/web/api/src/main/resources/definitions/VirtualDevice.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "type": "object",
-  "title": "vdev",
-  "required": [
-    "networkId",
-    "deviceId"
-  ],
-  "properties": {
-    "networkId": {
-      "type": "int64",
-      "description": "Network identifier",
-      "example": 3
-    },
-    "deviceId": {
-      "type": "String",
-      "description": "Device identifier",
-      "example": "of:0000000000000042"
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualDevices.json b/web/api/src/main/resources/definitions/VirtualDevices.json
deleted file mode 100644
index 61e4071..0000000
--- a/web/api/src/main/resources/definitions/VirtualDevices.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
-  "type": "object",
-  "title": "VirtualDevices",
-  "required": [
-    "devices"
-  ],
-  "properties": {
-    "devices": {
-      "type": "array",
-      "xml": {
-        "name": "devices",
-        "wrapped": true
-      },
-      "items": {
-        "type": "object",
-        "title": "vdev",
-        "required": [
-          "networkId",
-          "deviceId"
-        ],
-        "properties": {
-          "networkId": {
-            "type": "int64",
-            "description": "Network identifier",
-            "example": 3
-          },
-          "deviceId": {
-            "type": "String",
-            "description": "Device identifier",
-            "example": "of:0000000000000042"
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualHost.json b/web/api/src/main/resources/definitions/VirtualHost.json
deleted file mode 100644
index 4035694..0000000
--- a/web/api/src/main/resources/definitions/VirtualHost.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
-  "type": "object",
-  "title": "host",
-  "required": [
-    "networkId",
-    "id",
-    "mac",
-    "vlan",
-    "ipAddresses",
-    "location"
-  ],
-  "properties": {
-    "networkId": {
-      "type": "int64",
-      "description": "Network identifier",
-      "example": 3
-    },
-    "id": {
-      "type": "string",
-      "example": "46:E4:3C:A4:17:C8/-1"
-    },
-    "mac": {
-      "type": "string",
-      "example": "46:E4:3C:A4:17:C8"
-    },
-    "vlan": {
-      "type": "string",
-      "example": "-1"
-    },
-    "ipAddresses": {
-      "type": "array",
-      "xml": {
-        "name": "hosts",
-        "wrapped": true
-      },
-      "items": {
-        "type": "string",
-        "example": "127.0.0.1"
-      }
-    },
-    "locations": {
-      "type": "array",
-      "items": {
-        "type": "object",
-        "title": "location",
-        "required": [
-          "elementId",
-          "port"
-        ],
-        "properties": {
-          "elementId": {
-            "type": "string",
-            "example": "of:0000000000000002"
-          },
-          "port": {
-            "type": "string",
-            "example": "3"
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualHostPut.json b/web/api/src/main/resources/definitions/VirtualHostPut.json
deleted file mode 100644
index 3026478..0000000
--- a/web/api/src/main/resources/definitions/VirtualHostPut.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
-  "type": "object",
-  "title": "host",
-  "required": [
-    "networkId",
-    "mac",
-    "vlan",
-    "ipAddresses",
-    "location"
-  ],
-  "properties": {
-    "networkId": {
-      "type": "int64",
-      "description": "Network identifier",
-      "example": 3
-    },
-    "mac": {
-      "type": "string",
-      "example": "46:E4:3C:A4:17:C8"
-    },
-    "vlan": {
-      "type": "string",
-      "example": "-1"
-    },
-    "ipAddresses": {
-      "type": "array",
-      "xml": {
-        "name": "hosts",
-        "wrapped": true
-      },
-      "items": {
-        "type": "string",
-        "example": "127.0.0.1"
-      }
-    },
-    "locations": {
-      "type": "array",
-      "items": {
-        "type": "object",
-        "title": "location",
-        "required": [
-          "elementId",
-          "port"
-        ],
-        "properties": {
-          "elementId": {
-            "type": "string",
-            "example": "of:0000000000000002"
-          },
-          "port": {
-            "type": "string",
-            "example": "3"
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualHosts.json b/web/api/src/main/resources/definitions/VirtualHosts.json
deleted file mode 100644
index 979a3f7..0000000
--- a/web/api/src/main/resources/definitions/VirtualHosts.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
-  "type": "object",
-  "title": "hosts",
-  "required": [
-    "hosts"
-  ],
-  "properties": {
-    "hosts": {
-      "type": "array",
-      "xml": {
-        "name": "hosts",
-        "wrapped": true
-      },
-      "items": {
-        "type": "object",
-        "title": "host",
-        "required": [
-          "networkId",
-          "id",
-          "mac",
-          "vlan",
-          "ipAddresses",
-          "location"
-        ],
-        "properties": {
-          "networkId": {
-            "type": "int64",
-            "description": "Network identifier",
-            "example": 3
-          },
-          "id": {
-            "type": "string",
-            "example": "46:E4:3C:A4:17:C8/-1"
-          },
-          "mac": {
-            "type": "string",
-            "example": "46:E4:3C:A4:17:C8"
-          },
-          "vlan": {
-            "type": "string",
-            "example": "-1"
-          },
-          "ipAddresses": {
-            "type": "array",
-            "xml": {
-              "name": "hosts",
-              "wrapped": true
-            },
-            "items": {
-              "type": "string",
-              "example": "127.0.0.1"
-            }
-          },
-          "locations": {
-            "type": "array",
-            "items": {
-              "type": "object",
-              "title": "location",
-              "required": [
-                "elementId",
-                "port"
-              ],
-              "properties": {
-                "elementId": {
-                  "type": "string",
-                  "example": "of:0000000000000002"
-                },
-                "port": {
-                  "type": "string",
-                  "example": "3"
-                }
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualLink.json b/web/api/src/main/resources/definitions/VirtualLink.json
deleted file mode 100644
index 8550eb4..0000000
--- a/web/api/src/main/resources/definitions/VirtualLink.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
-  "type": "object",
-  "title": "vlink",
-  "required": [
-    "networkId",
-    "src",
-    "dst",
-    "type",
-    "state"
-  ],
-  "properties": {
-    "networkId": {
-      "type": "int64",
-      "description": "Network identifier",
-      "example": 3
-    },
-    "src": {
-      "type": "object",
-      "title": "src",
-      "required": [
-        "port",
-        "device"
-      ],
-      "properties": {
-        "port": {
-          "type": "int64",
-          "example": 3
-        },
-        "device": {
-          "type": "string",
-          "example": "of:0000000000000002"
-        }
-      }
-    },
-    "dst": {
-      "type": "object",
-      "title": "dst",
-      "required": [
-        "port",
-        "device"
-      ],
-      "properties": {
-        "port": {
-          "type": "int64",
-          "example": 2
-        },
-        "device": {
-          "type": "string",
-          "example": "of:0000000000000003"
-        }
-      }
-    },
-    "type": {
-      "type": "string",
-      "example": "DIRECT"
-    },
-    "state": {
-      "type": "string",
-      "example": "ACTIVE"
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualLinks.json b/web/api/src/main/resources/definitions/VirtualLinks.json
deleted file mode 100644
index 8163356..0000000
--- a/web/api/src/main/resources/definitions/VirtualLinks.json
+++ /dev/null
@@ -1,78 +0,0 @@
-{
-  "type": "object",
-  "title": "VirtualLinks",
-  "required": [
-    "links"
-  ],
-  "properties": {
-    "links": {
-      "type": "array",
-      "xml": {
-        "name": "links",
-        "wrapped": true
-      },
-      "items": {
-        "type": "object",
-        "title": "vlink",
-        "required": [
-          "networkId",
-          "src",
-          "dst",
-          "type",
-          "state"
-        ],
-        "properties": {
-          "networkId": {
-            "type": "int64",
-            "description": "Network identifier",
-            "example": 3
-          },
-          "src": {
-            "type": "object",
-            "title": "src",
-            "required": [
-              "port",
-              "device"
-            ],
-            "properties": {
-              "port": {
-                "type": "int64",
-                "example": 3
-              },
-              "device": {
-                "type": "string",
-                "example": "of:0000000000000002"
-              }
-            }
-          },
-          "dst": {
-            "type": "object",
-            "title": "dst",
-            "required": [
-              "port",
-              "device"
-            ],
-            "properties": {
-              "port": {
-                "type": "int64",
-                "example": 2
-              },
-              "device": {
-                "type": "string",
-                "example": "of:0000000000000003"
-              }
-            }
-          },
-          "type": {
-            "type": "string",
-            "example": "VIRTUAL"
-          },
-          "state": {
-            "type": "string",
-            "example": "ACTIVE"
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualNetworks.json b/web/api/src/main/resources/definitions/VirtualNetworks.json
deleted file mode 100644
index 6ab1bde..0000000
--- a/web/api/src/main/resources/definitions/VirtualNetworks.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
-  "type": "object",
-  "title": "VirtualNetworks",
-  "required": [
-    "vnets"
-  ],
-  "properties": {
-    "vnets": {
-      "type": "array",
-      "xml": {
-        "name": "vnets",
-        "wrapped": true
-      },
-      "items": {
-        "type": "object",
-        "title": "vnet",
-        "required": [
-          "networkId",
-          "tenantId"
-        ],
-        "properties": {
-          "networkId": {
-            "type": "int64",
-            "description": "Network identifier",
-            "example": 3
-          },
-          "tenantId": {
-            "type": "String",
-            "description": "Tenant identifier",
-            "example": "Tenant123"
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualPort.json b/web/api/src/main/resources/definitions/VirtualPort.json
deleted file mode 100644
index d1b8e47..0000000
--- a/web/api/src/main/resources/definitions/VirtualPort.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-  "type": "object",
-  "title": "vport",
-  "required": [
-    "networkId",
-    "deviceId",
-    "portNum",
-    "physDeviceId",
-    "physPortNum"
-  ],
-  "properties": {
-    "networkId": {
-      "type": "int64",
-      "description": "Network identifier",
-      "example": 3
-    },
-    "deviceId": {
-      "type": "String",
-      "description": "Virtual device identifier",
-      "example": "of:0000000000000042"
-    },
-    "portNum": {
-      "type": "int64",
-      "description": "Virtual device port number",
-      "example": 34
-    },
-    "physDeviceId": {
-      "type": "String",
-      "description": "Physical device identifier",
-      "example": "of:0000000000000003"
-    },
-    "physPortNum": {
-      "type": "int64",
-      "description": "Physical device port number",
-      "example": 2
-    }
-  }
-}
diff --git a/web/api/src/main/resources/definitions/VirtualPorts.json b/web/api/src/main/resources/definitions/VirtualPorts.json
deleted file mode 100644
index daa5019..0000000
--- a/web/api/src/main/resources/definitions/VirtualPorts.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
-  "type": "object",
-  "title": "VirtualPorts",
-  "required": [
-    "ports"
-  ],
-  "properties": {
-    "ports": {
-      "type": "array",
-      "xml": {
-        "name": "ports",
-        "wrapped": true
-      },
-      "items": {
-        "type": "object",
-        "title": "vport",
-        "required": [
-          "networkId",
-          "deviceId",
-          "portNum",
-          "physDeviceId",
-          "physPortNum"
-        ],
-        "properties": {
-          "networkId": {
-            "type": "int64",
-            "description": "Network identifier",
-            "example": 3
-          },
-          "deviceId": {
-            "type": "String",
-            "description": "Virtual device identifier",
-            "example": "of:0000000000000042"
-          },
-          "portNum": {
-            "type": "int64",
-            "description": "Virtual device port number",
-            "example": 34
-          },
-          "physDeviceId": {
-            "type": "String",
-            "description": "Physical device identifier",
-            "example": "of:0000000000000003"
-          },
-          "physPortNum": {
-            "type": "int64",
-            "description": "Physical device port number",
-            "example": 2
-          }
-        }
-      }
-    }
-  }
-}
diff --git a/web/api/src/test/java/org/onosproject/rest/resources/TenantWebResourceTest.java b/web/api/src/test/java/org/onosproject/rest/resources/TenantWebResourceTest.java
deleted file mode 100644
index 781cfae..0000000
--- a/web/api/src/test/java/org/onosproject/rest/resources/TenantWebResourceTest.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.rest.resources;
-
-import com.eclipsesource.json.Json;
-import com.eclipsesource.json.JsonArray;
-import com.eclipsesource.json.JsonObject;
-import com.google.common.collect.ImmutableSet;
-import org.glassfish.jersey.client.ClientProperties;
-import org.hamcrest.Description;
-import org.hamcrest.Matchers;
-import org.hamcrest.TypeSafeMatcher;
-import org.junit.Before;
-import org.junit.Test;
-import org.onlab.osgi.ServiceDirectory;
-import org.onlab.osgi.TestServiceDirectory;
-import org.onosproject.codec.CodecService;
-import org.onosproject.codec.impl.CodecManager;
-import org.onosproject.incubator.net.virtual.TenantId;
-import org.onosproject.incubator.net.virtual.VirtualNetworkAdminService;
-
-import javax.ws.rs.BadRequestException;
-import javax.ws.rs.NotFoundException;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.util.HashSet;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-/**
- * Unit tests for tenant REST APIs.
- */
-public class TenantWebResourceTest extends ResourceTest {
-
-    private final VirtualNetworkAdminService mockVnetAdminService = createMock(VirtualNetworkAdminService.class);
-
-    final HashSet<TenantId> tenantIdSet = new HashSet<>();
-
-    private static final String ID = "id";
-
-    private final TenantId tenantId1 = TenantId.tenantId("TenantId1");
-    private final TenantId tenantId2 = TenantId.tenantId("TenantId2");
-    private final TenantId tenantId3 = TenantId.tenantId("TenantId3");
-    private final TenantId tenantId4 = TenantId.tenantId("TenantId4");
-
-    /**
-     * Sets up the global values for all the tests.
-     */
-    @Before
-    public void setUpTest() {
-        // Register the services needed for the test
-        CodecManager codecService = new CodecManager();
-        codecService.activate();
-        ServiceDirectory testDirectory =
-                new TestServiceDirectory()
-                        .add(VirtualNetworkAdminService.class, mockVnetAdminService)
-                        .add(CodecService.class, codecService);
-
-        setServiceDirectory(testDirectory);
-    }
-
-    /**
-     * Hamcrest matcher to check that a tenant id representation in JSON matches
-     * the actual tenant id.
-     */
-    public static class TenantIdJsonMatcher extends TypeSafeMatcher<JsonObject> {
-        private final TenantId tenantId;
-        private String reason = "";
-
-        public TenantIdJsonMatcher(TenantId tenantIdValue) {
-            tenantId = tenantIdValue;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonObject jsonHost) {
-            // Check the tenant id
-            final String jsonId = jsonHost.get(ID).asString();
-            if (!jsonId.equals(tenantId.id())) {
-                reason = ID + " " + tenantId.id();
-                return false;
-            }
-
-            return true;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Factory to allocate a tenant id array matcher.
-     *
-     * @param tenantId tenant id object we are looking for
-     * @return matcher
-     */
-    private static TenantIdJsonMatcher matchesTenantId(TenantId tenantId) {
-        return new TenantIdJsonMatcher(tenantId);
-    }
-
-    /**
-     * Hamcrest matcher to check that a tenant id is represented properly in a JSON
-     * array of tenant ids.
-     */
-    public static class TenantIdJsonArrayMatcher extends TypeSafeMatcher<JsonArray> {
-        private final TenantId tenantId;
-        private String reason = "";
-
-        public TenantIdJsonArrayMatcher(TenantId tenantIdValue) {
-            tenantId = tenantIdValue;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonArray json) {
-            boolean tenantIdFound = false;
-            final int expectedAttributes = 1;
-            for (int tenantIdIndex = 0; tenantIdIndex < json.size();
-                 tenantIdIndex++) {
-
-                final JsonObject jsonHost = json.get(tenantIdIndex).asObject();
-
-                // Only 1 attribute - ID.
-                if (jsonHost.names().size() < expectedAttributes) {
-                    reason = "Found a tenant id with the wrong number of attributes";
-                    return false;
-                }
-
-                final String jsonDeviceKeyId = jsonHost.get(ID).asString();
-                if (jsonDeviceKeyId.equals(tenantId.id())) {
-                    tenantIdFound = true;
-
-                    //  We found the correct tenant id, check the tenant id attribute values
-                    assertThat(jsonHost, matchesTenantId(tenantId));
-                }
-            }
-            if (!tenantIdFound) {
-                reason = "Tenant id " + tenantId.id() + " was not found";
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Factory to allocate a tenant id array matcher.
-     *
-     * @param tenantId tenant id object we are looking for
-     * @return matcher
-     */
-    private static TenantIdJsonArrayMatcher hasTenantId(TenantId tenantId) {
-        return new TenantIdJsonArrayMatcher(tenantId);
-    }
-
-    /**
-     * Tests the result of the REST API GET when there are no tenant ids.
-     */
-    @Test
-    public void testGetTenantsEmptyArray() {
-        expect(mockVnetAdminService.getTenantIds()).andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        String response = wt.path("tenants").request().get(String.class);
-        assertThat(response, is("{\"tenants\":[]}"));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests the result of the REST API GET when tenant ids are defined.
-     */
-    @Test
-    public void testGetTenantIdsArray() {
-        tenantIdSet.add(tenantId1);
-        tenantIdSet.add(tenantId2);
-        tenantIdSet.add(tenantId3);
-        tenantIdSet.add(tenantId4);
-        expect(mockVnetAdminService.getTenantIds()).andReturn(tenantIdSet).anyTimes();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        String response = wt.path("tenants").request().get(String.class);
-        assertThat(response, containsString("{\"tenants\":["));
-
-        final JsonObject result = Json.parse(response).asObject();
-        assertThat(result, notNullValue());
-
-        assertThat(result.names(), hasSize(1));
-        assertThat(result.names().get(0), is("tenants"));
-
-        final JsonArray tenantIds = result.get("tenants").asArray();
-        assertThat(tenantIds, notNullValue());
-        assertEquals("Device keys array is not the correct size.",
-                     tenantIdSet.size(), tenantIds.size());
-
-        tenantIdSet.forEach(tenantId -> assertThat(tenantIds, hasTenantId(tenantId)));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of new tenant id using POST via JSON stream.
-     */
-    @Test
-    public void testPost() {
-        mockVnetAdminService.registerTenantId(anyObject());
-        tenantIdSet.add(tenantId2);
-        expect(mockVnetAdminService.getTenantIds()).andReturn(tenantIdSet).anyTimes();
-        expectLastCall();
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        InputStream jsonStream = TenantWebResourceTest.class
-                .getResourceAsStream("post-tenant.json");
-
-        Response response = wt.path("tenants").request(MediaType.APPLICATION_JSON_TYPE)
-                .post(Entity.json(jsonStream));
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED));
-
-        String location = response.getLocation().getPath();
-        assertThat(location, Matchers.startsWith("/tenants/" + tenantId2));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of a null tenant id using POST via JSON stream.
-     */
-    @Test
-    public void testPostNullTenantId() {
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        try {
-            String response = wt.path("tenants")
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .post(Entity.json(null), String.class);
-            fail("POST of null tenant id did not throw an exception");
-        } catch (BadRequestException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 400 Bad Request"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests removing a tenant id with DELETE request.
-     */
-    @Test
-    public void testDelete() {
-        expect(mockVnetAdminService.getTenantIds())
-                .andReturn(ImmutableSet.of(tenantId2)).anyTimes();
-        mockVnetAdminService.unregisterTenantId(anyObject());
-        expectLastCall();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target()
-                .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-        Response response = wt.path("tenants/" + tenantId2)
-                .request(MediaType.APPLICATION_JSON_TYPE)
-                .delete();
-
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests that a DELETE of a non-existent tenant id throws an exception.
-     */
-    @Test
-    public void testDeleteNonExistentDeviceKey() {
-        expect(mockVnetAdminService.getTenantIds())
-                .andReturn(ImmutableSet.of())
-                .anyTimes();
-        expectLastCall();
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-
-        try {
-            wt.path("tenants/" + "NON_EXISTENT_TENANT_ID")
-                    .request()
-                    .delete(String.class);
-            fail("Delete of a non-existent tenant did not throw an exception");
-        } catch (NotFoundException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 404 Not Found"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-}
diff --git a/web/api/src/test/java/org/onosproject/rest/resources/VirtualNetworkWebResourceTest.java b/web/api/src/test/java/org/onosproject/rest/resources/VirtualNetworkWebResourceTest.java
deleted file mode 100644
index 2ab185c..0000000
--- a/web/api/src/test/java/org/onosproject/rest/resources/VirtualNetworkWebResourceTest.java
+++ /dev/null
@@ -1,1265 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.rest.resources;
-
-import com.eclipsesource.json.Json;
-import com.eclipsesource.json.JsonArray;
-import com.eclipsesource.json.JsonObject;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-import org.glassfish.jersey.client.ClientProperties;
-import org.hamcrest.Description;
-import org.hamcrest.Matchers;
-import org.hamcrest.TypeSafeMatcher;
-import org.junit.Before;
-import org.junit.Test;
-import org.onlab.osgi.ServiceDirectory;
-import org.onlab.osgi.TestServiceDirectory;
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.VlanId;
-import org.onosproject.codec.CodecService;
-import org.onosproject.codec.impl.CodecManager;
-import org.onosproject.incubator.net.virtual.DefaultVirtualDevice;
-import org.onosproject.incubator.net.virtual.DefaultVirtualHost;
-import org.onosproject.incubator.net.virtual.DefaultVirtualLink;
-import org.onosproject.incubator.net.virtual.DefaultVirtualNetwork;
-import org.onosproject.incubator.net.virtual.DefaultVirtualPort;
-import org.onosproject.incubator.net.virtual.NetworkId;
-import org.onosproject.incubator.net.virtual.TenantId;
-import org.onosproject.incubator.net.virtual.VirtualDevice;
-import org.onosproject.incubator.net.virtual.VirtualHost;
-import org.onosproject.incubator.net.virtual.VirtualLink;
-import org.onosproject.incubator.net.virtual.VirtualNetwork;
-import org.onosproject.incubator.net.virtual.VirtualNetworkAdminService;
-import org.onosproject.incubator.net.virtual.VirtualNetworkService;
-import org.onosproject.incubator.net.virtual.VirtualPort;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DefaultAnnotations;
-import org.onosproject.net.DefaultDevice;
-import org.onosproject.net.Device;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.HostId;
-import org.onosproject.net.HostLocation;
-import org.onosproject.net.NetTestTools;
-import org.onosproject.net.PortNumber;
-
-import javax.ws.rs.BadRequestException;
-import javax.ws.rs.NotFoundException;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.function.BiFunction;
-import java.util.function.BiPredicate;
-import java.util.function.Function;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-import static org.onosproject.net.PortNumber.portNumber;
-
-/**
- * Unit tests for virtual network REST APIs.
- */
-public class VirtualNetworkWebResourceTest extends ResourceTest {
-
-    private final VirtualNetworkAdminService mockVnetAdminService = createMock(VirtualNetworkAdminService.class);
-    private final VirtualNetworkService mockVnetService = createMock(VirtualNetworkService.class);
-    private CodecManager codecService;
-
-    private final HashSet<VirtualDevice> vdevSet = new HashSet<>();
-    private final HashSet<VirtualPort> vportSet = new HashSet<>();
-
-    private static final String ID = "networkId";
-    private static final String TENANT_ID = "tenantId";
-    private static final String DEVICE_ID = "deviceId";
-    private static final String PORT_NUM = "portNum";
-    private static final String PHYS_DEVICE_ID = "physDeviceId";
-    private static final String PHYS_PORT_NUM = "physPortNum";
-
-    private final TenantId tenantId2 = TenantId.tenantId("TenantId2");
-    private final TenantId tenantId3 = TenantId.tenantId("TenantId3");
-    private final TenantId tenantId4 = TenantId.tenantId("TenantId4");
-
-    private final NetworkId networkId1 = NetworkId.networkId(1);
-    private final NetworkId networkId2 = NetworkId.networkId(2);
-    private final NetworkId networkId3 = NetworkId.networkId(3);
-    private final NetworkId networkId4 = NetworkId.networkId(4);
-
-    private final VirtualNetwork vnet1 = new DefaultVirtualNetwork(networkId1, tenantId3);
-    private final VirtualNetwork vnet2 = new DefaultVirtualNetwork(networkId2, tenantId3);
-    private final VirtualNetwork vnet3 = new DefaultVirtualNetwork(networkId3, tenantId3);
-    private final VirtualNetwork vnet4 = new DefaultVirtualNetwork(networkId4, tenantId3);
-
-    private final DeviceId devId1 = DeviceId.deviceId("devid1");
-    private final DeviceId devId2 = DeviceId.deviceId("devid2");
-    private final DeviceId devId22 = DeviceId.deviceId("dev22");
-
-    private final VirtualDevice vdev1 = new DefaultVirtualDevice(networkId3, devId1);
-    private final VirtualDevice vdev2 = new DefaultVirtualDevice(networkId3, devId2);
-
-    private final Device dev1 = NetTestTools.device("dev1");
-    private final Device dev2 = NetTestTools.device("dev2");
-    private final Device dev22 = NetTestTools.device("dev22");
-
-    private final ConnectPoint cp1 = new ConnectPoint(dev1.id(), portNumber(1));
-    private final ConnectPoint cp2 = new ConnectPoint(dev2.id(), portNumber(2));
-
-    private final VirtualPort vport22 = new DefaultVirtualPort(networkId3,
-                                                               dev22, portNumber(22), cp1);
-    private final VirtualPort vport23 = new DefaultVirtualPort(networkId3,
-                                                               dev22, portNumber(23), cp2);
-
-    private final ConnectPoint cp11 = NetTestTools.connectPoint(devId1.toString(), 21);
-    private final ConnectPoint cp21 = NetTestTools.connectPoint(devId2.toString(), 22);
-    private final ConnectPoint cp12 = NetTestTools.connectPoint(devId1.toString(), 2);
-    private final ConnectPoint cp22 = NetTestTools.connectPoint(devId2.toString(), 22);
-
-    private final VirtualLink vlink1 = DefaultVirtualLink.builder()
-            .networkId(networkId3)
-            .src(cp22)
-            .dst(cp11)
-            .build();
-
-    private final VirtualLink vlink2 = DefaultVirtualLink.builder()
-            .networkId(networkId3)
-            .src(cp12)
-            .dst(cp21)
-            .build();
-
-    private final MacAddress mac1 = MacAddress.valueOf("00:11:00:00:00:01");
-    private final MacAddress mac2 = MacAddress.valueOf("00:22:00:00:00:02");
-    private final VlanId vlan1 = VlanId.vlanId((short) 11);
-    private final VlanId vlan2 = VlanId.vlanId((short) 22);
-    private final IpAddress ip1 = IpAddress.valueOf("10.0.0.1");
-    private final IpAddress ip2 = IpAddress.valueOf("10.0.0.2");
-    private final IpAddress ip3 = IpAddress.valueOf("10.0.0.3");
-
-    private final HostId hId1 = HostId.hostId(mac1, vlan1);
-    private final HostId hId2 = HostId.hostId(mac2, vlan2);
-    private final HostLocation loc1 = new HostLocation(devId1, portNumber(100), 123L);
-    private final HostLocation loc2 = new HostLocation(devId2, portNumber(200), 123L);
-    private final Set<IpAddress> ipSet1 = Sets.newHashSet(ip1, ip2);
-    private final Set<IpAddress> ipSet2 = Sets.newHashSet(ip1, ip3);
-    private final VirtualHost vhost1 = new DefaultVirtualHost(networkId1, hId1,
-                                                              mac1, vlan1, loc1, ipSet1);
-    private final VirtualHost vhost2 = new DefaultVirtualHost(networkId2, hId2,
-                                                              mac2, vlan2, loc2, ipSet2);
-
-
-
-
-    /**
-     * Sets up the global values for all the tests.
-     */
-    @Before
-    public void setUpTest() {
-        // Register the services needed for the test
-        codecService = new CodecManager();
-        codecService.activate();
-        ServiceDirectory testDirectory =
-                new TestServiceDirectory()
-                        .add(VirtualNetworkAdminService.class, mockVnetAdminService)
-                        .add(VirtualNetworkService.class, mockVnetService)
-                        .add(CodecService.class, codecService);
-
-        setServiceDirectory(testDirectory);
-    }
-
-    /**
-     * Hamcrest matcher to check that a virtual network entity representation in JSON matches
-     * the actual virtual network entity.
-     */
-    private static final class JsonObjectMatcher<T> extends TypeSafeMatcher<JsonObject> {
-        private final T vnetEntity;
-        private List<String> jsonFieldNames;
-        private String reason = "";
-        private BiFunction<T, String, String> getValue; // get vnetEntity's value
-
-        private JsonObjectMatcher(T vnetEntityValue,
-                                  List<String> jsonFieldNames1,
-                                  BiFunction<T, String, String> getValue1) {
-            vnetEntity = vnetEntityValue;
-            jsonFieldNames = jsonFieldNames1;
-            getValue = getValue1;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonObject jsonHost) {
-            return jsonFieldNames
-                    .stream()
-                    .allMatch(s -> checkField(jsonHost, s, getValue.apply(vnetEntity, s)));
-        }
-
-        private boolean checkField(JsonObject jsonHost, String jsonFieldName,
-                                   String objectValue) {
-            final String jsonValue = jsonHost.get(jsonFieldName).asString();
-            if (!jsonValue.equals(objectValue)) {
-                reason = jsonFieldName + " " + objectValue;
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual network id array matcher.
-     *
-     * @param obj virtual network id object we are looking for
-     * @return matcher
-     */
-    /**
-     * Factory to allocate a virtual network entity matcher.
-     *
-     * @param obj            virtual network object we are looking for
-     * @param jsonFieldNames JSON field names to check against
-     * @param getValue       function to retrieve value from virtual network object
-     * @param <T>            the type of virtual network object
-     * @return matcher
-     */
-    private static <T> JsonObjectMatcher matchesVnetEntity(T obj, List<String> jsonFieldNames,
-                                                           BiFunction<T, String, String> getValue) {
-        return new JsonObjectMatcher<T>(obj, jsonFieldNames, getValue);
-    }
-
-    /**
-     * Hamcrest matcher to check that a virtual network entity is represented properly in a JSON
-     * array of virtual network entities.
-     */
-    protected static class JsonArrayMatcher<T> extends TypeSafeMatcher<JsonArray> {
-        private final T vnetEntity;
-        private String reason = "";
-        private Function<T, String> getKey; // gets vnetEntity's key
-        private BiPredicate<T, JsonObject> checkKey; // check vnetEntity's key with JSON rep'n
-        private List<String> jsonFieldNames; // field/property names
-        private BiFunction<T, String, String> getValue; // get vnetEntity's value
-
-        protected JsonArrayMatcher(T vnetEntityValue, Function<T, String> getKey1,
-                                   BiPredicate<T, JsonObject> checkKey1,
-                                   List<String> jsonFieldNames1,
-                                   BiFunction<T, String, String> getValue1) {
-            vnetEntity = vnetEntityValue;
-            getKey = getKey1;
-            checkKey = checkKey1;
-            jsonFieldNames = jsonFieldNames1;
-            getValue = getValue1;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonArray json) {
-            boolean itemFound = false;
-            final int expectedAttributes = jsonFieldNames.size();
-            for (int jsonArrayIndex = 0; jsonArrayIndex < json.size();
-                 jsonArrayIndex++) {
-
-                final JsonObject jsonHost = json.get(jsonArrayIndex).asObject();
-
-                if (jsonHost.names().size() < expectedAttributes) {
-                    reason = "Found a virtual network with the wrong number of attributes";
-                    return false;
-                }
-
-                if (checkKey != null && checkKey.test(vnetEntity, jsonHost)) {
-                    itemFound = true;
-                    assertThat(jsonHost, matchesVnetEntity(vnetEntity, jsonFieldNames, getValue));
-                }
-            }
-            if (!itemFound) {
-                reason = getKey.apply(vnetEntity) + " was not found";
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Array matcher for VirtualNetwork.
-     */
-    private static final class VnetJsonArrayMatcher extends JsonArrayMatcher<VirtualNetwork> {
-
-        private VnetJsonArrayMatcher(VirtualNetwork vnetIn) {
-            super(vnetIn,
-                  vnet -> "Virtual network " + vnet.id().toString(),
-                  (vnet, jsonObject) -> jsonObject.get(ID).asString().equals(vnet.id().toString()),
-                  ImmutableList.of(ID, TENANT_ID),
-                  (vnet, s) -> s.equals(ID) ? vnet.id().toString()
-                          : s.equals(TENANT_ID) ? vnet.tenantId().toString()
-                          : null
-            );
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual network array matcher.
-     *
-     * @param vnet virtual network object we are looking for
-     * @return matcher
-     */
-    private VnetJsonArrayMatcher hasVnet(VirtualNetwork vnet) {
-        return new VnetJsonArrayMatcher(vnet);
-    }
-
-    // Tests for Virtual Networks
-
-    /**
-     * Tests the result of the REST API GET when there are no virtual networks.
-     */
-    @Test
-    public void testGetVirtualNetworksEmptyArray() {
-        expect(mockVnetAdminService.getTenantIds()).andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetAdminService);
-        expect(mockVnetService.getVirtualNetworks(tenantId4)).andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String response = wt.path("vnets").request().get(String.class);
-        assertThat(response, is("{\"vnets\":[]}"));
-
-        verify(mockVnetService);
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests the result of the REST API GET when virtual networks are defined.
-     */
-    @Test
-    public void testGetVirtualNetworksArray() {
-        final Set<VirtualNetwork> vnetSet = ImmutableSet.of(vnet1, vnet2, vnet3, vnet4);
-        expect(mockVnetAdminService.getTenantIds()).andReturn(ImmutableSet.of(tenantId3)).anyTimes();
-        replay(mockVnetAdminService);
-        expect(mockVnetService.getVirtualNetworks(tenantId3)).andReturn(vnetSet).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String response = wt.path("vnets").request().get(String.class);
-        assertThat(response, containsString("{\"vnets\":["));
-
-        final JsonObject result = Json.parse(response).asObject();
-        assertThat(result, notNullValue());
-
-        assertThat(result.names(), hasSize(1));
-        assertThat(result.names().get(0), is("vnets"));
-
-        final JsonArray vnetJsonArray = result.get("vnets").asArray();
-        assertThat(vnetJsonArray, notNullValue());
-        assertEquals("Virtual networks array is not the correct size.",
-                     vnetSet.size(), vnetJsonArray.size());
-
-        vnetSet.forEach(vnet -> assertThat(vnetJsonArray, hasVnet(vnet)));
-
-        verify(mockVnetService);
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests the result of the REST API GET for virtual networks with tenant id.
-     */
-    @Test
-    public void testGetVirtualNetworksByTenantId() {
-        final Set<VirtualNetwork> vnetSet = ImmutableSet.of(vnet1, vnet2, vnet3, vnet4);
-        expect(mockVnetAdminService.getTenantIds()).andReturn(ImmutableSet.of(tenantId3)).anyTimes();
-        replay(mockVnetAdminService);
-        expect(mockVnetService.getVirtualNetworks(tenantId3)).andReturn(vnetSet).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String response = wt.path("vnets/" + tenantId3.id()).request().get(String.class);
-        assertThat(response, containsString("{\"vnets\":["));
-
-        final JsonObject result = Json.parse(response).asObject();
-        assertThat(result, notNullValue());
-
-        assertThat(result.names(), hasSize(1));
-        assertThat(result.names().get(0), is("vnets"));
-
-        final JsonArray vnetJsonArray = result.get("vnets").asArray();
-        assertThat(vnetJsonArray, notNullValue());
-        assertEquals("Virtual networks array is not the correct size.",
-                     vnetSet.size(), vnetJsonArray.size());
-
-        vnetSet.forEach(vnet -> assertThat(vnetJsonArray, hasVnet(vnet)));
-
-        verify(mockVnetService);
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests the result of the REST API GET for virtual networks with tenant id.
-     */
-    @Test
-    public void testGetVirtualNetworksByNonExistentTenantId() {
-        String tenantIdName = "NON_EXISTENT_TENANT_ID";
-        expect(mockVnetAdminService.getTenantIds()).andReturn(ImmutableSet.of(tenantId3)).anyTimes();
-        replay(mockVnetAdminService);
-        expect(mockVnetService.getVirtualNetworks(anyObject())).andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-
-        try {
-            wt.path("vnets/" + tenantIdName)
-                    .request()
-                    .get(String.class);
-            fail("Get of a non-existent virtual network did not throw an exception");
-        } catch (NotFoundException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 404 Not Found"));
-        }
-
-        verify(mockVnetService);
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of new virtual network using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualNetwork() {
-        expect(mockVnetAdminService.createVirtualNetwork(tenantId2)).andReturn(vnet1);
-        expectLastCall();
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        InputStream jsonStream = TenantWebResourceTest.class
-                .getResourceAsStream("post-tenant.json");
-
-        Response response = wt.path("vnets").request(MediaType.APPLICATION_JSON_TYPE)
-                .post(Entity.json(jsonStream));
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED));
-
-        String location = response.getLocation().getPath();
-        assertThat(location, Matchers.startsWith("/vnets/" + vnet1.id().toString()));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of a null virtual network using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualNetworkNullTenantId() {
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        try {
-            wt.path("vnets")
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .post(Entity.json(null), String.class);
-            fail("POST of null virtual network did not throw an exception");
-        } catch (BadRequestException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 400 Bad Request"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests removing a virtual network with DELETE request.
-     */
-    @Test
-    public void testDeleteVirtualNetwork() {
-        mockVnetAdminService.removeVirtualNetwork(anyObject());
-        expectLastCall();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target()
-                .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-        Response response = wt.path("vnets/" + "2")
-                .request(MediaType.APPLICATION_JSON_TYPE)
-                .delete();
-
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests that a DELETE of a non-existent virtual network throws an exception.
-     */
-    @Test
-    public void testDeleteNetworkNonExistentNetworkId() {
-        expect(mockVnetAdminService.getTenantIds())
-                .andReturn(ImmutableSet.of())
-                .anyTimes();
-        expectLastCall();
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-
-        try {
-            wt.path("vnets/" + "NON_EXISTENT_NETWORK_ID")
-                    .request()
-                    .delete(String.class);
-            fail("Delete of a non-existent virtual network did not throw an exception");
-        } catch (NotFoundException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 404 Not Found"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-
-    // Tests for Virtual Device
-
-    /**
-     * Tests the result of the REST API GET when there are no virtual devices.
-     */
-    @Test
-    public void testGetVirtualDevicesEmptyArray() {
-        NetworkId networkId = networkId4;
-        expect(mockVnetService.getVirtualDevices(networkId)).andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString() + "/devices";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, is("{\"devices\":[]}"));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Tests the result of the REST API GET when virtual devices are defined.
-     */
-    @Test
-    public void testGetVirtualDevicesArray() {
-        NetworkId networkId = networkId3;
-        vdevSet.add(vdev1);
-        vdevSet.add(vdev2);
-        expect(mockVnetService.getVirtualDevices(networkId)).andReturn(vdevSet).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString() + "/devices";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, containsString("{\"devices\":["));
-
-        final JsonObject result = Json.parse(response).asObject();
-        assertThat(result, notNullValue());
-
-        assertThat(result.names(), hasSize(1));
-        assertThat(result.names().get(0), is("devices"));
-
-        final JsonArray vnetJsonArray = result.get("devices").asArray();
-        assertThat(vnetJsonArray, notNullValue());
-        assertEquals("Virtual devices array is not the correct size.",
-                     vdevSet.size(), vnetJsonArray.size());
-
-        vdevSet.forEach(vdev -> assertThat(vnetJsonArray, hasVdev(vdev)));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Array matcher for VirtualDevice.
-     */
-    private static final class VdevJsonArrayMatcher extends JsonArrayMatcher<VirtualDevice> {
-
-        private VdevJsonArrayMatcher(VirtualDevice vdevIn) {
-            super(vdevIn,
-                  vdev -> "Virtual device " + vdev.networkId().toString()
-                          + " " + vdev.id().toString(),
-                  (vdev, jsonObject) -> jsonObject.get(ID).asString().equals(vdev.networkId().toString())
-                          && jsonObject.get(DEVICE_ID).asString().equals(vdev.id().toString()),
-                  ImmutableList.of(ID, DEVICE_ID),
-                  (vdev, s) -> s.equals(ID) ? vdev.networkId().toString()
-                          : s.equals(DEVICE_ID) ? vdev.id().toString()
-                          : null
-            );
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual device array matcher.
-     *
-     * @param vdev virtual device object we are looking for
-     * @return matcher
-     */
-    private VdevJsonArrayMatcher hasVdev(VirtualDevice vdev) {
-        return new VdevJsonArrayMatcher(vdev);
-    }
-    /**
-     * Tests adding of new virtual device using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualDevice() {
-        NetworkId networkId = networkId3;
-        DeviceId deviceId = devId2;
-        expect(mockVnetAdminService.createVirtualDevice(networkId, deviceId)).andReturn(vdev2);
-        expectLastCall();
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        InputStream jsonStream = VirtualNetworkWebResourceTest.class
-                .getResourceAsStream("post-virtual-device.json");
-        String reqLocation = "vnets/" + networkId.toString() + "/devices";
-        Response response = wt.path(reqLocation).request(MediaType.APPLICATION_JSON_TYPE)
-                .post(Entity.json(jsonStream));
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED));
-
-        String location = response.getLocation().getPath();
-        assertThat(location, Matchers.startsWith("/" + reqLocation + "/" + vdev2.id().toString()));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of a null virtual device using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualDeviceNullJsonStream() {
-        NetworkId networkId = networkId3;
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        try {
-            String reqLocation = "vnets/" + networkId.toString() + "/devices";
-            wt.path(reqLocation)
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .post(Entity.json(null), String.class);
-            fail("POST of null virtual device did not throw an exception");
-        } catch (BadRequestException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 400 Bad Request"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests removing a virtual device with DELETE request.
-     */
-    @Test
-    public void testDeleteVirtualDevice() {
-        NetworkId networkId = networkId3;
-        DeviceId deviceId = devId2;
-        mockVnetAdminService.removeVirtualDevice(networkId, deviceId);
-        expectLastCall();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target()
-                .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-        String reqLocation = "vnets/" + networkId.toString() + "/devices/" + deviceId.toString();
-        Response response = wt.path(reqLocation)
-                .request(MediaType.APPLICATION_JSON_TYPE)
-                .delete();
-
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
-
-        verify(mockVnetAdminService);
-    }
-
-    // Tests for Virtual Ports
-
-    /**
-     * Tests the result of the REST API GET when there are no virtual ports.
-     */
-    @Test
-    public void testGetVirtualPortsEmptyArray() {
-        NetworkId networkId = networkId4;
-        DeviceId deviceId = devId2;
-        expect(mockVnetService.getVirtualPorts(networkId, deviceId))
-                .andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString()
-                + "/devices/" + deviceId.toString() + "/ports";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, is("{\"ports\":[]}"));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Tests the result of the REST API GET when virtual ports are defined.
-     */
-    @Test
-    public void testGetVirtualPortsArray() {
-        NetworkId networkId = networkId3;
-        DeviceId deviceId = dev22.id();
-        vportSet.add(vport23);
-        vportSet.add(vport22);
-        expect(mockVnetService.getVirtualPorts(networkId, deviceId)).andReturn(vportSet).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString()
-                + "/devices/" + deviceId.toString() + "/ports";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, containsString("{\"ports\":["));
-
-        final JsonObject result = Json.parse(response).asObject();
-        assertThat(result, notNullValue());
-
-        assertThat(result.names(), hasSize(1));
-        assertThat(result.names().get(0), is("ports"));
-
-        final JsonArray vnetJsonArray = result.get("ports").asArray();
-        assertThat(vnetJsonArray, notNullValue());
-        assertEquals("Virtual ports array is not the correct size.",
-                     vportSet.size(), vnetJsonArray.size());
-
-        vportSet.forEach(vport -> assertThat(vnetJsonArray, hasVport(vport)));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Array matcher for VirtualPort.
-     */
-    private static final class VportJsonArrayMatcher extends JsonArrayMatcher<VirtualPort> {
-
-        private VportJsonArrayMatcher(VirtualPort vportIn) {
-            super(vportIn,
-                  vport -> "Virtual port " + vport.networkId().toString() + " "
-                    + vport.element().id().toString() + " " + vport.number().toString(),
-                  (vport, jsonObject) -> jsonObject.get(ID).asString().equals(vport.networkId().toString())
-                          && jsonObject.get(PORT_NUM).asString().equals(vport.number().toString())
-                          && jsonObject.get(DEVICE_ID).asString().equals(vport.element().id().toString()),
-                  ImmutableList.of(ID, DEVICE_ID, PORT_NUM, PHYS_DEVICE_ID, PHYS_PORT_NUM),
-                  (vport, s) -> s.equals(ID) ? vport.networkId().toString()
-                          : s.equals(DEVICE_ID) ? vport.element().id().toString()
-                          : s.equals(PORT_NUM) ? vport.number().toString()
-                          : s.equals(PHYS_DEVICE_ID) ? vport.realizedBy().deviceId().toString()
-                          : s.equals(PHYS_PORT_NUM) ? vport.realizedBy().port().toString()
-                          : null
-            );
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual port array matcher.
-     *
-     * @param vport virtual port object we are looking for
-     * @return matcher
-     */
-    private VportJsonArrayMatcher hasVport(VirtualPort vport) {
-        return new VportJsonArrayMatcher(vport);
-    }
-
-    /**
-     * Tests adding of new virtual port using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualPort() {
-        NetworkId networkId = networkId3;
-        DeviceId deviceId = devId22;
-        DefaultAnnotations annotations = DefaultAnnotations.builder().build();
-        Device physDevice = new DefaultDevice(null, DeviceId.deviceId("dev1"),
-                                              null, null, null, null, null, null, annotations);
-        ConnectPoint cp1 = new ConnectPoint(physDevice.id(), portNumber(1));
-        expect(mockVnetAdminService.createVirtualPort(networkId, deviceId, portNumber(22), cp1))
-                .andReturn(vport22);
-
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        InputStream jsonStream = VirtualNetworkWebResourceTest.class
-                .getResourceAsStream("post-virtual-port.json");
-        String reqLocation = "vnets/" + networkId.toString()
-                + "/devices/" + deviceId.toString() + "/ports";
-        Response response = wt.path(reqLocation).request(MediaType.APPLICATION_JSON_TYPE)
-                .post(Entity.json(jsonStream));
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of a null virtual port using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualPortNullJsonStream() {
-        NetworkId networkId = networkId3;
-        DeviceId deviceId = devId2;
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        try {
-            String reqLocation = "vnets/" + networkId.toString()
-                    + "/devices/" + deviceId.toString() + "/ports";
-            wt.path(reqLocation)
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .post(Entity.json(null), String.class);
-            fail("POST of null virtual port did not throw an exception");
-        } catch (BadRequestException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 400 Bad Request"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests removing a virtual port with DELETE request.
-     */
-    @Test
-    public void testDeleteVirtualPort() {
-        NetworkId networkId = networkId3;
-        DeviceId deviceId = devId2;
-        PortNumber portNum = portNumber(2);
-        mockVnetAdminService.removeVirtualPort(networkId, deviceId, portNum);
-        expectLastCall();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target()
-                .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-        String reqLocation = "vnets/" + networkId.toString()
-                + "/devices/" + deviceId.toString() + "/ports/" + portNum.toLong();
-        Response response = wt.path(reqLocation)
-                .request(MediaType.APPLICATION_JSON_TYPE)
-                .delete();
-
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
-
-        verify(mockVnetAdminService);
-    }
-
-    // Tests for Virtual Links
-
-    /**
-     * Tests the result of the REST API GET when there are no virtual links.
-     */
-    @Test
-    public void testGetVirtualLinksEmptyArray() {
-        NetworkId networkId = networkId4;
-        expect(mockVnetService.getVirtualLinks(networkId)).andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString() + "/links";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, is("{\"links\":[]}"));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Tests the result of the REST API GET when virtual links are defined.
-     */
-    @Test
-    public void testGetVirtualLinksArray() {
-        NetworkId networkId = networkId3;
-        final Set<VirtualLink> vlinkSet = ImmutableSet.of(vlink1, vlink2);
-        expect(mockVnetService.getVirtualLinks(networkId)).andReturn(vlinkSet).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString() + "/links";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, containsString("{\"links\":["));
-
-        final JsonObject result = Json.parse(response).asObject();
-        assertThat(result, notNullValue());
-
-        assertThat(result.names(), hasSize(1));
-        assertThat(result.names().get(0), is("links"));
-
-        final JsonArray vnetJsonArray = result.get("links").asArray();
-        assertThat(vnetJsonArray, notNullValue());
-        assertEquals("Virtual links array is not the correct size.",
-                     vlinkSet.size(), vnetJsonArray.size());
-
-        vlinkSet.forEach(vlink -> assertThat(vnetJsonArray, hasVlink(vlink)));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Hamcrest matcher to check that a virtual link representation in JSON matches
-     * the actual virtual link.
-     */
-    private static final class VirtualLinkJsonMatcher extends LinksResourceTest.LinkJsonMatcher {
-        private final VirtualLink vlink;
-        private String reason = "";
-
-        private VirtualLinkJsonMatcher(VirtualLink vlinkValue) {
-            super(vlinkValue);
-            vlink = vlinkValue;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonObject jsonLink) {
-            if (!super.matchesSafely(jsonLink)) {
-                return false;
-            }
-            // check NetworkId
-            String jsonNetworkId = jsonLink.get(ID).asString();
-            String networkId = vlink.networkId().toString();
-            if (!jsonNetworkId.equals(networkId)) {
-                reason = ID + " was " + jsonNetworkId;
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual link matcher.
-     *
-     * @param vlink virtual link object we are looking for
-     * @return matcher
-     */
-    private static VirtualLinkJsonMatcher matchesVirtualLink(VirtualLink vlink) {
-        return new VirtualLinkJsonMatcher(vlink);
-    }
-
-    /**
-     * Hamcrest matcher to check that a virtual link is represented properly in a JSON
-     * array of links.
-     */
-    private static final class VirtualLinkJsonArrayMatcher extends TypeSafeMatcher<JsonArray> {
-        private final VirtualLink vlink;
-        private String reason = "";
-
-        private VirtualLinkJsonArrayMatcher(VirtualLink vlinkValue) {
-            vlink = vlinkValue;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonArray json) {
-            for (int jsonLinkIndex = 0; jsonLinkIndex < json.size();
-                 jsonLinkIndex++) {
-
-                JsonObject jsonLink = json.get(jsonLinkIndex).asObject();
-
-                if (matchesVirtualLink(vlink).matchesSafely(jsonLink)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual link array matcher.
-     *
-     * @param vlink virtual link object we are looking for
-     * @return matcher
-     */
-    private VirtualLinkJsonArrayMatcher hasVlink(VirtualLink vlink) {
-        return new VirtualLinkJsonArrayMatcher(vlink);
-    }
-
-    /**
-     * Tests adding of new virtual link using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualLink() {
-        NetworkId networkId = networkId3;
-        expect(mockVnetAdminService.createVirtualLink(networkId, cp22, cp11))
-                .andReturn(vlink1);
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        InputStream jsonStream = VirtualNetworkWebResourceTest.class
-                .getResourceAsStream("post-virtual-link.json");
-        String reqLocation = "vnets/" + networkId.toString() + "/links";
-        Response response = wt.path(reqLocation).request(MediaType.APPLICATION_JSON_TYPE)
-                .post(Entity.json(jsonStream));
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED));
-
-        String location = response.getLocation().getPath();
-        assertThat(location, Matchers.startsWith("/" + reqLocation));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of a null virtual link using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualLinkNullJsonStream() {
-        NetworkId networkId = networkId3;
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        try {
-            String reqLocation = "vnets/" + networkId.toString() + "/links";
-            wt.path(reqLocation)
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .post(Entity.json(null), String.class);
-            fail("POST of null virtual link did not throw an exception");
-        } catch (BadRequestException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 400 Bad Request"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests removing a virtual link with DELETE request.
-     */
-    @Test
-    public void testDeleteVirtualLink() {
-        NetworkId networkId = networkId3;
-        mockVnetAdminService.removeVirtualLink(networkId, cp22, cp11);
-        expectLastCall();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target()
-                .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-        InputStream jsonStream = VirtualNetworkWebResourceTest.class
-                .getResourceAsStream("post-virtual-link.json");
-        String reqLocation = "vnets/" + networkId.toString() + "/links";
-        Response response = wt.path(reqLocation).request().method("DELETE", Entity.json(jsonStream));
-
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
-        verify(mockVnetAdminService);
-    }
-
-    // Tests for Virtual Hosts
-
-    /**
-     * Tests the result of the REST API GET when there are no virtual hosts.
-     */
-    @Test
-    public void testGetVirtualHostsEmptyArray() {
-        NetworkId networkId = networkId4;
-        expect(mockVnetService.getVirtualHosts(networkId)).andReturn(ImmutableSet.of()).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString() + "/hosts";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, is("{\"hosts\":[]}"));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Tests the result of the REST API GET when virtual hosts are defined.
-     */
-    @Test
-    public void testGetVirtualHostsArray() {
-        NetworkId networkId = networkId3;
-        final Set<VirtualHost> vhostSet = ImmutableSet.of(vhost1, vhost2);
-        expect(mockVnetService.getVirtualHosts(networkId)).andReturn(vhostSet).anyTimes();
-        replay(mockVnetService);
-
-        WebTarget wt = target();
-        String location = "vnets/" + networkId.toString() + "/hosts";
-        String response = wt.path(location).request().get(String.class);
-        assertThat(response, containsString("{\"hosts\":["));
-
-        final JsonObject result = Json.parse(response).asObject();
-        assertThat(result, notNullValue());
-
-        assertThat(result.names(), hasSize(1));
-        assertThat(result.names().get(0), is("hosts"));
-
-        final JsonArray vnetJsonArray = result.get("hosts").asArray();
-        assertThat(vnetJsonArray, notNullValue());
-        assertEquals("Virtual hosts array is not the correct size.",
-                     vhostSet.size(), vnetJsonArray.size());
-
-        vhostSet.forEach(vhost -> assertThat(vnetJsonArray, hasVhost(vhost)));
-
-        verify(mockVnetService);
-    }
-
-    /**
-     * Hamcrest matcher to check that a virtual host representation in JSON matches
-     * the actual virtual host.
-     */
-    private static final class VirtualHostJsonMatcher extends HostResourceTest.HostJsonMatcher {
-        private final VirtualHost vhost;
-        private String reason = "";
-
-        private VirtualHostJsonMatcher(VirtualHost vhostValue) {
-            super(vhostValue);
-            vhost = vhostValue;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonObject jsonHost) {
-            if (!super.matchesSafely(jsonHost)) {
-                return false;
-            }
-            // check NetworkId
-            String jsonNetworkId = jsonHost.get(ID).asString();
-            String networkId = vhost.networkId().toString();
-            if (!jsonNetworkId.equals(networkId)) {
-                reason = ID + " was " + jsonNetworkId;
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual host matcher.
-     *
-     * @param vhost virtual host object we are looking for
-     * @return matcher
-     */
-    private static VirtualHostJsonMatcher matchesVirtualHost(VirtualHost vhost) {
-        return new VirtualHostJsonMatcher(vhost);
-    }
-
-    /**
-     * Hamcrest matcher to check that a virtual host is represented properly in a JSON
-     * array of hosts.
-     */
-    private static final class VirtualHostJsonArrayMatcher extends TypeSafeMatcher<JsonArray> {
-        private final VirtualHost vhost;
-        private String reason = "";
-
-        private VirtualHostJsonArrayMatcher(VirtualHost vhostValue) {
-            vhost = vhostValue;
-        }
-
-        @Override
-        public boolean matchesSafely(JsonArray json) {
-            for (int jsonHostIndex = 0; jsonHostIndex < json.size();
-                 jsonHostIndex++) {
-
-                JsonObject jsonHost = json.get(jsonHostIndex).asObject();
-
-                if (matchesVirtualHost(vhost).matchesSafely(jsonHost)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public void describeTo(Description description) {
-            description.appendText(reason);
-        }
-    }
-
-    /**
-     * Factory to allocate a virtual host array matcher.
-     *
-     * @param vhost virtual host object we are looking for
-     * @return matcher
-     */
-    private VirtualHostJsonArrayMatcher hasVhost(VirtualHost vhost) {
-        return new VirtualHostJsonArrayMatcher(vhost);
-    }
-
-    /**
-     * Tests adding of new virtual host using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualHost() {
-        NetworkId networkId = networkId3;
-        expect(mockVnetAdminService.createVirtualHost(networkId, hId1, mac1, vlan1, loc1, ipSet1))
-                .andReturn(vhost1);
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        InputStream jsonStream = VirtualNetworkWebResourceTest.class
-                .getResourceAsStream("post-virtual-host.json");
-        String reqLocation = "vnets/" + networkId.toString() + "/hosts";
-        Response response = wt.path(reqLocation).request(MediaType.APPLICATION_JSON_TYPE)
-                .post(Entity.json(jsonStream));
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_CREATED));
-
-        String location = response.getLocation().getPath();
-        assertThat(location, Matchers.startsWith("/" + reqLocation));
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests adding of a null virtual host using POST via JSON stream.
-     */
-    @Test
-    public void testPostVirtualHostNullJsonStream() {
-        NetworkId networkId = networkId3;
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target();
-        try {
-            String reqLocation = "vnets/" + networkId.toString() + "/hosts";
-            wt.path(reqLocation)
-                    .request(MediaType.APPLICATION_JSON_TYPE)
-                    .post(Entity.json(null), String.class);
-            fail("POST of null virtual host did not throw an exception");
-        } catch (BadRequestException ex) {
-            assertThat(ex.getMessage(), containsString("HTTP 400 Bad Request"));
-        }
-
-        verify(mockVnetAdminService);
-    }
-
-    /**
-     * Tests removing a virtual host with DELETE request.
-     */
-    @Test
-    public void testDeleteVirtualHost() {
-        NetworkId networkId = networkId3;
-        mockVnetAdminService.removeVirtualHost(networkId, hId1);
-        expectLastCall();
-        replay(mockVnetAdminService);
-
-        WebTarget wt = target()
-                .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-        InputStream jsonStream = VirtualNetworkWebResourceTest.class
-                .getResourceAsStream("post-virtual-host.json");
-        String reqLocation = "vnets/" + networkId.toString() + "/hosts";
-        Response response = wt.path(reqLocation).request().method("DELETE", Entity.json(jsonStream));
-
-        assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
-        verify(mockVnetAdminService);
-    }
-}
diff --git a/web/api/src/test/resources/org/onosproject/rest/resources/post-tenant.json b/web/api/src/test/resources/org/onosproject/rest/resources/post-tenant.json
deleted file mode 100644
index 407f9a2..0000000
--- a/web/api/src/test/resources/org/onosproject/rest/resources/post-tenant.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "id": "TenantId2"
-}
diff --git a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-device.json b/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-device.json
deleted file mode 100644
index fbd129c..0000000
--- a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-device.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "networkId": "3",
-  "deviceId": "devId2"
-}
diff --git a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-host.json b/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-host.json
deleted file mode 100644
index 557dc32..0000000
--- a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-host.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "networkId": "3",
-  "id": "00:11:00:00:00:01/11",
-  "mac": "00:11:00:00:00:01",
-  "vlan": "11",
-  "locations": [
-    {
-      "elementId": "devid1",
-      "port": "100"
-    }
-  ],
-  "ipAddresses": [
-    "10.0.0.1",
-    "10.0.0.2"
-  ]
-}
diff --git a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-link.json b/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-link.json
deleted file mode 100644
index 8f04673..0000000
--- a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-link.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "networkId": "3",
-  "src": {
-    "device": "of:devid2",
-    "port": "22" 
-  },
-  "dst": {
-    "device": "of:devid1",
-    "port": "21" 
-  },
-  "type": "VIRTUAL",
-  "state": "ACTIVE"
-}
diff --git a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-port.json b/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-port.json
deleted file mode 100644
index 1d60842..0000000
--- a/web/api/src/test/resources/org/onosproject/rest/resources/post-virtual-port.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "networkId": "3",
-  "deviceId": "dev22",
-  "portNum": "22",
-  "physDeviceId": "dev1",
-  "physPortNum": "1"
-}
diff --git a/web/gui/BUILD b/web/gui/BUILD
index 302e793..f944faf 100644
--- a/web/gui/BUILD
+++ b/web/gui/BUILD
@@ -36,8 +36,6 @@
     "@jetty_util//jar",
     "@jersey_media_multipart//jar",
     "@jersey_server//jar",
-    "//incubator/api:onos-incubator-api",
-    "//incubator/net:onos-incubator-net",
     "//utils/rest:onlab-rest",
     "//core/store/serializers:onos-core-serializers",
 ]
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
index 08311ed..5f153f0 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandlerBase.java
@@ -27,8 +27,6 @@
 import org.onosproject.cluster.ControllerNode;
 import org.onosproject.cluster.NodeId;
 import org.onosproject.core.CoreService;
-import org.onosproject.incubator.net.tunnel.OpticalTunnelEndPoint;
-import org.onosproject.incubator.net.tunnel.Tunnel;
 import org.onosproject.net.AnnotationKeys;
 import org.onosproject.net.Annotations;
 import org.onosproject.net.ConnectPoint;
@@ -36,7 +34,6 @@
 import org.onosproject.net.Device;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.EdgeLink;
-import org.onosproject.net.ElementId;
 import org.onosproject.net.Host;
 import org.onosproject.net.HostId;
 import org.onosproject.net.HostLocation;
@@ -60,12 +57,10 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -461,7 +456,6 @@
                 .addProp(TOPOLOGY_SSCS, lion.getSafe(TOPOLOGY_SSCS), topology.clusterCount())
                 .addSeparator()
                 .addProp(INTENTS, lion.getSafe(INTENTS), services.intent().getIntentCount())
-                .addProp(TUNNELS, lion.getSafe(TUNNELS), services.tunnel().tunnelCount())
                 .addProp(FLOWS, lion.getSafe(FLOWS), services.flow().getFlowRuleCount());
     }
 
@@ -548,28 +542,9 @@
         return services.flow().getFlowRuleCount(deviceId);
     }
 
+    @Deprecated
     protected int getTunnelCount(DeviceId deviceId) {
-        int count = 0;
-        Collection<Tunnel> tunnels = services.tunnel().queryAllTunnels();
-        for (Tunnel tunnel : tunnels) {
-            //Only OpticalTunnelEndPoint has a device
-            if (!(tunnel.src() instanceof OpticalTunnelEndPoint) ||
-                    !(tunnel.dst() instanceof OpticalTunnelEndPoint)) {
-                continue;
-            }
-
-            Optional<ElementId> srcElementId = ((OpticalTunnelEndPoint) tunnel.src()).elementId();
-            Optional<ElementId> dstElementId = ((OpticalTunnelEndPoint) tunnel.dst()).elementId();
-            if (!srcElementId.isPresent() || !dstElementId.isPresent()) {
-                continue;
-            }
-            DeviceId srcDeviceId = (DeviceId) srcElementId.get();
-            DeviceId dstDeviceId = (DeviceId) dstElementId.get();
-            if (srcDeviceId.equals(deviceId) || dstDeviceId.equals(deviceId)) {
-                count++;
-            }
-        }
-        return count;
+        return 0;
     }
 
     private boolean useDefaultName(String annotName) {
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitorBase.java b/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitorBase.java
index 4296d3b..43c3fdb 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitorBase.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TrafficMonitorBase.java
@@ -17,7 +17,7 @@
 
 package org.onosproject.ui.impl;
 
-import org.onosproject.incubator.net.PortStatisticsService.MetricType;
+import org.onosproject.net.statistic.PortStatisticsService.MetricType;
 import org.onosproject.net.DefaultEdgeLink;
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.Link;
@@ -36,8 +36,8 @@
 import java.util.Timer;
 import java.util.TimerTask;
 
-import static org.onosproject.incubator.net.PortStatisticsService.MetricType.BYTES;
-import static org.onosproject.incubator.net.PortStatisticsService.MetricType.PACKETS;
+import static org.onosproject.net.statistic.PortStatisticsService.MetricType.BYTES;
+import static org.onosproject.net.statistic.PortStatisticsService.MetricType.PACKETS;
 import static org.onosproject.net.DefaultEdgeLink.createEdgeLinks;
 import static org.onosproject.ui.impl.TrafficMonitorBase.Mode.IDLE;
 
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TunnelViewMessageHandler.java b/web/gui/src/main/java/org/onosproject/ui/impl/TunnelViewMessageHandler.java
deleted file mode 100644
index e65a385..0000000
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TunnelViewMessageHandler.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.ui.impl;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.collect.ImmutableSet;
-import org.onosproject.incubator.net.tunnel.Tunnel;
-import org.onosproject.incubator.net.tunnel.TunnelEndPointFormatter;
-import org.onosproject.incubator.net.tunnel.TunnelService;
-import org.onosproject.ui.RequestHandler;
-import org.onosproject.ui.UiMessageHandler;
-import org.onosproject.ui.table.TableModel;
-import org.onosproject.ui.table.TableRequestHandler;
-import org.onosproject.ui.table.cell.EnumFormatter;
-
-import java.util.Collection;
-
-public class TunnelViewMessageHandler extends UiMessageHandler {
-    private static final String TUNNEL_DATA_REQ = "tunnelDataRequest";
-    private static final String TUNNEL_DATA_RESP = "tunnelDataResponse";
-    private static final String TUNNELS = "tunnels";
-    private static final String ID = "id";
-    private static final String NAME = "name";
-    private static final String ONE = "one";
-    private static final String TWO = "two";
-    private static final String TYPE = "type";
-    private static final String GROUP_ID = "group_id";
-
-    private static final String BANDWIDTH = "bandwidth";
-    private static final String PATH = "path";
-
-
-    private static final String[] COL_IDS = {
-            ID, NAME, ONE, TWO, TYPE, GROUP_ID,
-            BANDWIDTH, PATH
-    };
-
-    @Override
-    protected Collection<RequestHandler> createRequestHandlers() {
-        return ImmutableSet.of(new TunnelDataRequestHandler());
-    }
-
-    private final class TunnelDataRequestHandler extends TableRequestHandler {
-
-        private static final String NO_ROWS_MESSAGE = "No tunnels found";
-
-        public TunnelDataRequestHandler() {
-            super(TUNNEL_DATA_REQ, TUNNEL_DATA_RESP, TUNNELS);
-        }
-
-        @Override
-        protected String[] getColumnIds() {
-            return COL_IDS;
-        }
-
-        @Override
-        protected String noRowsMessage(ObjectNode payload) {
-            return NO_ROWS_MESSAGE;
-        }
-
-        @Override
-        protected TableModel createTableModel() {
-            TableModel tm = super.createTableModel();
-            //TODO add more formater class so that we can get a more readable table
-            tm.setFormatter(ONE, TunnelEndPointFormatter.INSTANCE);
-            tm.setFormatter(TWO, TunnelEndPointFormatter.INSTANCE);
-            tm.setFormatter(TYPE, EnumFormatter.INSTANCE);
-            return tm;
-        }
-
-        @Override
-        protected void populateTable(TableModel tm, ObjectNode payload) {
-            TunnelService ts = get(TunnelService.class);
-            ts.queryAllTunnels().forEach(tunnel -> populateRow(tm.addRow(), tunnel));
-        }
-
-    }
-
-    private void populateRow(TableModel.Row row, Tunnel tunnel) {
-        row.cell(ID, tunnel.tunnelId().id())
-                .cell(NAME, tunnel.tunnelName().value())
-                .cell(ONE, tunnel.src())
-                .cell(TWO, tunnel.dst())
-                .cell(TYPE, tunnel.type())
-                .cell(GROUP_ID, tunnel.groupId().id())
-                .cell(BANDWIDTH, tunnel.annotations().value(BANDWIDTH))
-                .cell(PATH, tunnel.path());
-    }
-}
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
index c776fb3..e403479 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiExtensionManager.java
@@ -210,8 +210,7 @@
 
                 mkView(NETWORK, "link", "nav_links"),
                 mkView(NETWORK, "host", "nav_hosts"),
-                mkView(NETWORK, "intent", "nav_intents"),
-                mkView(NETWORK, "tunnel", "nav_tunnels")
+                mkView(NETWORK, "intent", "nav_intents")
         );
 
         UiMessageHandlerFactory messageHandlerFactory =
@@ -233,7 +232,6 @@
                         new SettingsViewMessageHandler(),
                         new ClusterViewMessageHandler(),
                         new ProcessorViewMessageHandler(),
-                        new TunnelViewMessageHandler(),
                         new PartitionViewMessageHandler(),
                         new PipeconfViewMessageHandler()
                 );
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java
index 4ec61ce..0ef6faf 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java
@@ -26,8 +26,7 @@
 import org.onosproject.cluster.ClusterService;
 import org.onosproject.cluster.ControllerNode;
 import org.onosproject.cluster.NodeId;
-import org.onosproject.incubator.net.PortStatisticsService;
-import org.onosproject.incubator.net.tunnel.TunnelService;
+import org.onosproject.net.statistic.PortStatisticsService;
 import org.onosproject.mastership.MastershipService;
 import org.onosproject.net.Annotated;
 import org.onosproject.net.Annotations;
@@ -128,7 +127,6 @@
     private StatisticService flowStatsService;
     private PortStatisticsService portStatsService;
     private TopologyService topologyService;
-    private TunnelService tunnelService;
     private UiExtensionService uiextService;
     private UiPreferencesService prefService;
 
@@ -160,7 +158,6 @@
         flowStatsService = directory.get(StatisticService.class);
         portStatsService = directory.get(PortStatisticsService.class);
         topologyService = directory.get(TopologyService.class);
-        tunnelService = directory.get(TunnelService.class);
         uiextService = directory.get(UiExtensionService.class);
         prefService = directory.get(UiPreferencesService.class);
     }
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java
index d70ecf6..6f8a706 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/model/UiSharedTopologyModel.java
@@ -22,8 +22,7 @@
 import org.onosproject.cluster.ControllerNode;
 import org.onosproject.cluster.RoleInfo;
 import org.onosproject.event.AbstractListenerManager;
-import org.onosproject.incubator.net.PortStatisticsService;
-import org.onosproject.incubator.net.tunnel.TunnelService;
+import org.onosproject.net.statistic.PortStatisticsService;
 import org.onosproject.mastership.MastershipEvent;
 import org.onosproject.mastership.MastershipListener;
 import org.onosproject.mastership.MastershipService;
@@ -117,8 +116,6 @@
     private PortStatisticsService portStatsService;
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     private TopologyService topologyService;
-    @Reference(cardinality = ReferenceCardinality.MANDATORY)
-    private TunnelService tunnelService;
 
     private final ClusterEventListener clusterListener =
             new InternalClusterListener();
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/util/ServicesBundle.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/util/ServicesBundle.java
index 3ae7e90..e58b0f2 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/util/ServicesBundle.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/util/ServicesBundle.java
@@ -18,8 +18,7 @@
 
 import org.onlab.osgi.ServiceDirectory;
 import org.onosproject.cluster.ClusterService;
-import org.onosproject.incubator.net.PortStatisticsService;
-import org.onosproject.incubator.net.tunnel.TunnelService;
+import org.onosproject.net.statistic.PortStatisticsService;
 import org.onosproject.mastership.MastershipAdminService;
 import org.onosproject.mastership.MastershipService;
 import org.onosproject.net.device.DeviceService;
@@ -45,7 +44,6 @@
     private DriverService driverService;
     private HostService hostService;
     private LinkService linkService;
-    private TunnelService tunnelService;
 
     private MastershipService mastershipService;
     private MastershipAdminService mastershipAdminService;
@@ -70,7 +68,6 @@
         driverService = directory.get(DriverService.class);
         hostService = directory.get(HostService.class);
         linkService = directory.get(LinkService.class);
-        tunnelService = directory.get(TunnelService.class);
 
         mastershipService = directory.get(MastershipService.class);
         mastershipAdminService = directory.get(MastershipAdminService.class);
@@ -135,15 +132,6 @@
     }
 
     /**
-     * Returns a reference to the tunnel service.
-     *
-     * @return tunnel service reference
-     */
-    public TunnelService tunnel() {
-        return tunnelService;
-    }
-
-    /**
      * Returns a reference to the mastership service.
      *
      * @return mastership service reference