use of org.onosproject.incubator.net.domain.IntentDomainId in project onos by opennetworkinglab.
the class AddTunnelCommand method doExecute.
@Override
protected void doExecute() {
IntentDomainService service = get(IntentDomainService.class);
ConnectPoint one = ConnectPoint.deviceConnectPoint(oneString);
ConnectPoint two = ConnectPoint.deviceConnectPoint(twoString);
TunnelPrimitive tunnel = new TunnelPrimitive(appId(), one, two);
// get the first domain (there should only be one)
final IntentDomainId domainId;
try {
domainId = service.getDomains().iterator().next().id();
} catch (NoSuchElementException | NullPointerException e) {
print("No domains found");
return;
}
service.request(domainId, tunnel).forEach(r -> service.submit(domainId, r));
print("Intent domain tunnel submitted:\n%s", tunnel);
}
Aggregations