use of org.onosproject.incubator.net.virtual.NetworkId in project onos by opennetworkinglab.
the class VirtualNetworkWebResource method removeVirtualNetwork.
/**
* 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();
}
use of org.onosproject.incubator.net.virtual.NetworkId in project onos by opennetworkinglab.
the class VirtualNetworkWebResource method getVirtualPorts.
// 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();
}
use of org.onosproject.incubator.net.virtual.NetworkId in project onos by opennetworkinglab.
the class VirtualNetworkWebResource method getVirtualDevices.
// 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();
}
use of org.onosproject.incubator.net.virtual.NetworkId in project onos by opennetworkinglab.
the class VirtualNetworkWebResource method removeVirtualPort.
/**
* 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();
}
use of org.onosproject.incubator.net.virtual.NetworkId in project onos by opennetworkinglab.
the class VirtualNetworkWebResource method getVirtualHosts.
/**
* 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();
}
Aggregations