use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.
the class VirtualNetworkRemoveCommand method doExecute.
@Override
protected void doExecute() {
VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
service.removeVirtualNetwork(NetworkId.networkId(id));
print("Virtual network successfully removed.");
}
use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.
the class VirtualPortStateCommand method doExecute.
@Override
protected void doExecute() {
VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
VirtualPort vPort = getVirtualPort(PortNumber.portNumber(portNum));
checkNotNull(vPort, "The virtual Port does not exist");
boolean isEnabled;
if ("enable".equals(portState)) {
isEnabled = true;
} else if ("disable".equals(portState)) {
isEnabled = false;
} else {
print("State must be enable or disable");
return;
}
service.updatePortState(NetworkId.networkId(networkId), DeviceId.deviceId(deviceId), vPort.number(), isEnabled);
print("Virtual port state updated.");
}
use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.
the class TenantCompleter method complete.
@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
// Delegate string completer
StringsCompleter delegate = new StringsCompleter();
// Fetch our service and feed it's offerings to the string completer
VirtualNetworkAdminService service = AbstractShellCommand.get(VirtualNetworkAdminService.class);
SortedSet<String> strings = delegate.getStrings();
for (TenantId tenantId : service.getTenantIds()) {
strings.add(tenantId.id());
}
// Now let the completer do the work for figuring out what to offer.
return delegate.complete(session, commandLine, candidates);
}
use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.
the class TenantRemoveCommand method doExecute.
@Override
protected void doExecute() {
VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
service.unregisterTenantId(TenantId.tenantId(id));
print("Tenant successfully removed.");
}
use of org.onosproject.incubator.net.virtual.VirtualNetworkAdminService in project onos by opennetworkinglab.
the class TenantListCommand method doExecute.
@Override
protected void doExecute() {
VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
List<TenantId> tenants = new ArrayList<>();
tenants.addAll(service.getTenantIds());
Collections.sort(tenants, Comparators.TENANT_ID_COMPARATOR);
tenants.forEach(this::printTenant);
}
Aggregations