use of org.onosproject.openstacknetworking.api.OpenstackNetworkService in project onos by opennetworkinglab.
the class VmDeviceIdCompleter method complete.
@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
StringsCompleter delegate = new StringsCompleter();
OpenstackNetworkService osNetService = get(OpenstackNetworkService.class);
Set<String> set = osNetService.ports().stream().map(Port::getDeviceId).collect(Collectors.toSet());
SortedSet<String> strings = delegate.getStrings();
Iterator<String> it = set.iterator();
while (it.hasNext()) {
strings.add(it.next());
}
return delegate.complete(session, commandLine, candidates);
}
use of org.onosproject.openstacknetworking.api.OpenstackNetworkService in project onos by opennetworkinglab.
the class OpenstackNetworkingUtilTest method testIsAssociatedWithVM.
/**
* Tests the isAssociatedWithVM method.
*/
@Test
public void testIsAssociatedWithVM() {
OpenstackNetworkService service = new TestOpenstackNetworkService();
NetFloatingIP floatingIp4 = new NeutronFloatingIP().toBuilder().portId("portId4").build();
assertFalse(isAssociatedWithVM(service, floatingIp4));
assertFalse(isAssociatedWithVM(service, floatingIp3));
assertTrue(isAssociatedWithVM(service, floatingIp1));
}
Aggregations