Search in sources :

Example 11 with VirtualNetworkAdminService

use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.

the class VirtualDeviceCreateCommand method doExecute.

@Override
protected void doExecute() {
    VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
    service.createVirtualDevice(NetworkId.networkId(networkId), DeviceId.deviceId(deviceId));
    print("Virtual device successfully created.");
}
Also used : VirtualNetworkAdminService(org.onosproject.incubator.net.virtual.VirtualNetworkAdminService)

Example 12 with VirtualNetworkAdminService

use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.

the class VirtualDeviceRemoveCommand method doExecute.

@Override
protected void doExecute() {
    VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
    service.removeVirtualDevice(NetworkId.networkId(networkId), DeviceId.deviceId(deviceId));
    print("Virtual device successfully removed.");
}
Also used : VirtualNetworkAdminService(org.onosproject.incubator.net.virtual.VirtualNetworkAdminService)

Example 13 with VirtualNetworkAdminService

use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.

the class TenantAddCommand method doExecute.

@Override
protected void doExecute() {
    VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
    service.registerTenantId(TenantId.tenantId(id));
    print("Tenant successfully added.");
}
Also used : VirtualNetworkAdminService(org.onosproject.incubator.net.virtual.VirtualNetworkAdminService)

Example 14 with VirtualNetworkAdminService

use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.

the class VirtualPortBindCommand method doExecute.

@Override
protected void doExecute() {
    VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
    DeviceService deviceService = get(DeviceService.class);
    VirtualPort vPort = getVirtualPort(PortNumber.portNumber(portNum));
    checkNotNull(vPort, "The virtual Port does not exist");
    ConnectPoint realizedBy = new ConnectPoint(DeviceId.deviceId(physDeviceId), PortNumber.portNumber(physPortNum));
    service.bindVirtualPort(NetworkId.networkId(networkId), DeviceId.deviceId(deviceId), PortNumber.portNumber(portNum), realizedBy);
    print("Virtual port is successfully bound.");
}
Also used : VirtualPort(org.onosproject.incubator.net.virtual.VirtualPort) DeviceService(org.onosproject.net.device.DeviceService) VirtualNetworkAdminService(org.onosproject.incubator.net.virtual.VirtualNetworkAdminService) ConnectPoint(org.onosproject.net.ConnectPoint)

Example 15 with VirtualNetworkAdminService

use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.

the class VirtualPortCreateCommand method doExecute.

@Override
protected void doExecute() {
    VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
    DeviceService deviceService = get(DeviceService.class);
    VirtualDevice virtualDevice = getVirtualDevice(DeviceId.deviceId(deviceId));
    checkNotNull(virtualDevice, "The virtual device does not exist.");
    ConnectPoint realizedBy = null;
    if (physDeviceId != null && physPortNum != null) {
        checkNotNull(physPortNum, "The physical port does not specified.");
        realizedBy = new ConnectPoint(DeviceId.deviceId(physDeviceId), PortNumber.portNumber(physPortNum));
        checkNotNull(realizedBy, "The physical port does not exist.");
    }
    service.createVirtualPort(NetworkId.networkId(networkId), DeviceId.deviceId(deviceId), PortNumber.portNumber(portNum), realizedBy);
    print("Virtual port successfully created.");
}
Also used : DeviceService(org.onosproject.net.device.DeviceService) VirtualDevice(org.onosproject.incubator.net.virtual.VirtualDevice) VirtualNetworkAdminService(org.onosproject.incubator.net.virtual.VirtualNetworkAdminService) ConnectPoint(org.onosproject.net.ConnectPoint)

Aggregations

VirtualNetworkAdminService (org.onosproject.incubator.net.virtual.VirtualNetworkAdminService)18 ConnectPoint (org.onosproject.net.ConnectPoint)4 TenantId (org.onosproject.net.TenantId)4 ArrayList (java.util.ArrayList)3 StringsCompleter (org.apache.karaf.shell.support.completers.StringsCompleter)2 VirtualNetwork (org.onosproject.incubator.net.virtual.VirtualNetwork)2 VirtualPort (org.onosproject.incubator.net.virtual.VirtualPort)2 DeviceService (org.onosproject.net.device.DeviceService)2 HashSet (java.util.HashSet)1 IpAddress (org.onlab.packet.IpAddress)1 MacAddress (org.onlab.packet.MacAddress)1 VlanId (org.onlab.packet.VlanId)1 VirtualDevice (org.onosproject.incubator.net.virtual.VirtualDevice)1 VirtualNetworkService (org.onosproject.incubator.net.virtual.VirtualNetworkService)1 HostLocation (org.onosproject.net.HostLocation)1