use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.
the class DcsBasedTapiDataProducerTest method makeTestData.
private void makeTestData() {
did1 = DeviceId.deviceId("netconf:127.0.0.1:11001");
did2 = DeviceId.deviceId("netconf:127.0.0.1:11002");
cp11 = new ConnectPoint(did1, PortNumber.portNumber(1, "TRANSCEIVER"));
cp12 = new ConnectPoint(did1, PortNumber.portNumber(2, "TRANSCEIVER"));
cp21 = new ConnectPoint(did2, PortNumber.portNumber(1, "TRANSCEIVER"));
cp22 = new ConnectPoint(did2, PortNumber.portNumber(2, "TRANSCEIVER"));
context = new DefaultContext();
topology = TapiTopologyHandler.create().getModelObject();
DefaultTopologyContext topologyContext = TapiTopologyContextHandler.create().getModelObject();
DefaultAugmentedTapiCommonContext augmentedTopologyContext = new DefaultAugmentedTapiCommonContext();
Augmentable augmentableContext = context;
augmentableContext.addAugmentation(augmentedTopologyContext);
augmentedTopologyContext.topologyContext(topologyContext);
topologyContext.addToTopology(topology);
node1 = TapiNodeHandler.create().setTopologyUuid(topology.uuid()).setDeviceId(did1).getModelObject();
node2 = TapiNodeHandler.create().setTopologyUuid(topology.uuid()).setDeviceId(did2).getModelObject();
sip11 = TapiSipHandler.create().setConnectPoint(cp11).getModelObject();
sip21 = TapiSipHandler.create().setConnectPoint(cp21).getModelObject();
nep11 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setConnectPoint(cp11).addSip(sip11.uuid()).getModelObject();
nep12 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node1.uuid()).setConnectPoint(cp12).getModelObject();
nep21 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node2.uuid()).setConnectPoint(cp21).addSip(sip21.uuid()).getModelObject();
nep22 = TapiNepHandler.create().setTopologyUuid(topology.uuid()).setNodeUuid(node2.uuid()).setConnectPoint(cp22).getModelObject();
}
use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.
the class DefaultTapiResolverTest method setUp.
@Before
public void setUp() {
nodeRef = TapiNodeRef.create("49e2ac46-3975-44b4-b84f-8fab28222a39", "5638e8e6-ac17-40d9-86e4-7c1febab6f1a");
nepRef = TapiNepRef.create("59e2ac46-3975-44b4-b84f-8fab28222a39", "6638e8e6-ac17-40d9-86e4-7c1febab6f1a", "cd673055-e2b2-4f67-88c8-adfae96385bc");
nodeRefNullAttr = TapiNodeRef.create("59e2ac46-3975-44b4-b84f-8fab28222a39", "6638e8e6-ac17-40d9-86e4-7c1febab6f1a");
nepRefNullAttr = TapiNepRef.create("69e2ac46-3975-44b4-b84f-8fab28222a39", "7638e8e6-ac17-40d9-86e4-7c1febab6f1a", "dd673055-e2b2-4f67-88c8-adfae96385bc");
deviceId = DeviceId.deviceId("netconf:172.24.3.5:11011");
cp = new ConnectPoint(deviceId, PortNumber.portNumber("42"));
sipId = "01c39723-7c0d-4754-8d64-fd9ff412404c";
portType = OdtnDeviceDescriptionDiscovery.OdtnPortType.CLIENT.value();
nodeRef.setDeviceId(deviceId);
nepRef.setConnectPoint(cp).setSipId(sipId).setPortType(portType);
dummyDeviceId = DeviceId.deviceId("dummy");
dummyPort = 4;
dummyCp = new ConnectPoint(dummyDeviceId, PortNumber.portNumber(dummyPort));
dummySipId = "00000000-0000-0000-0000-000000000000";
tapiResolver = new DefaultTapiResolver();
mockTapiDataProducer = EasyMock.createMock(TapiDataProducer.class);
mockTapiDataProducer.updateCacheRequest(tapiResolver);
replay(mockTapiDataProducer);
tapiResolver.dataProvider = mockTapiDataProducer;
}
use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.
the class VirtualNetworkIntentManager method validateIntent.
/**
* Returns true if the virtual network intent is valid.
*
* @param intent virtual network intent
* @return true if intent is valid
*/
private boolean validateIntent(VirtualNetworkIntent intent) {
checkNotNull(intent, INTENT_NULL);
checkNotNull(intent.networkId(), NETWORK_ID_NULL);
checkNotNull(intent.appId(), APP_ID_NULL);
checkNotNull(intent.key(), INTENT_KEY_NULL);
ConnectPoint ingressPoint = intent.ingressPoint();
ConnectPoint egressPoint = intent.egressPoint();
return (validateConnectPoint(ingressPoint) && validateConnectPoint(egressPoint));
}
use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.
the class VirtualLinkRemoveCommand method doExecute.
@Override
protected void doExecute() {
VirtualNetworkAdminService service = get(VirtualNetworkAdminService.class);
ConnectPoint src = new ConnectPoint(DeviceId.deviceId(srcDeviceId), PortNumber.portNumber(srcPortNum));
ConnectPoint dst = new ConnectPoint(DeviceId.deviceId(dstDeviceId), PortNumber.portNumber(dstPortNum));
service.removeVirtualLink(NetworkId.networkId(networkId), src, dst);
if (bidirectional) {
service.removeVirtualLink(NetworkId.networkId(networkId), dst, src);
}
print("Virtual link successfully removed.");
}
use of org.onosproject.net.ConnectPoint in project onos by opennetworkinglab.
the class VirtualNetworkIntentCreateCommand method doExecute.
@Override
protected void doExecute() {
VirtualNetworkService service = get(VirtualNetworkService.class);
IntentService virtualNetworkIntentService = service.get(NetworkId.networkId(networkId), IntentService.class);
ConnectPoint ingress = ConnectPoint.deviceConnectPoint(ingressDeviceString);
ConnectPoint egress = ConnectPoint.deviceConnectPoint(egressDeviceString);
TrafficSelector selector = buildTrafficSelector();
TrafficTreatment treatment = buildTrafficTreatment();
List<Constraint> constraints = buildConstraints();
Intent intent = VirtualNetworkIntent.builder().networkId(NetworkId.networkId(networkId)).appId(appId()).key(key()).selector(selector).treatment(treatment).ingressPoint(ingress).egressPoint(egress).constraints(constraints).priority(priority()).build();
virtualNetworkIntentService.submit(intent);
print("Virtual intent submitted:\n%s", intent.toString());
}
Aggregations