// create corresponding CEPs and Connections. Connections should be added to the corresponding context
// CEPs must be included in the topology context as an augmentation for each ONEP!!
ServiceFormat serviceFormat = serviceAEnd.getServiceFormat(); // should be equal to serviceZEnd
- // TODO -> better mechanism to map services???
+ // TODO -> Maybe we dont need to create the connections and ceps if the previous service doesnt exist??
+ // As mentioned above, for 100GbE service creation there are ROADMs in the path description.
+ // What are the configurations needed here? No OTU, ODU... what kind of cross connections is needed?
+ // this needs to be changed
switch (serviceFormat) {
case OC:
// Identify number of ROADMs
connectionServMap.putAll(createXpdrCepsAndConnectionsOdu(xpdrNetworkTplist, xpdrNodelist));
}
// Top connection in the DSR layer, between client ports of the xpdrs
- connectionServMap.putAll(createXpdrCepsAndConnectionsDsr(xpdrClientTplist, xpdrNodelist));
+ // TODO differentiate between 100GbE and OTN 10GbE services
+ connectionServMap.putAll(createXpdrCepsAndConnectionsDsr(xpdrClientTplist, xpdrNetworkTplist,
+ xpdrNodelist));
break;
default:
LOG.error("Service type format not supported");
}
private Map<ConnectionKey,Connection> createXpdrCepsAndConnectionsDsr(List<String> xpdrClientTplist,
+ List<String> xpdrNetworkTplist,
List<String> xpdrNodelist) {
Map<ConnectionKey, Connection> connServMap = new HashMap<>();
Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey,
- ConnectionEndPoint> cepMap = new HashMap<>();
+ ConnectionEndPoint> cepMapDsr = new HashMap<>();
+ Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey,
+ ConnectionEndPoint> cepMapOdu = new HashMap<>();
- // Create 1 cep per Xpdr in the CLIENT and a top connection DSR between the CLIENT xpdrs
+ // Create 1 cep per Xpdr in the CLIENT, 1 cep per Xpdr eODU, 1 XC between eODU and iODE,
+ // 1 top connection between eODU and a top connection DSR between the CLIENT xpdrs
for (String xpdr:xpdrNodelist) {
LOG.info("Creating ceps and xc for xpdr {}", xpdr);
String spcXpdrClient = xpdrClientTplist.stream().filter(netp -> netp.contains(xpdr)).findFirst().get();
LayerProtocolName.DSR);
putXpdrCepInTopologyContext(xpdr, spcXpdrClient, TapiStringConstants.DSR, TapiStringConstants.DSR, netCep1);
- cepMap.put(netCep1.key(), netCep1);
+ ConnectionEndPoint netCep2 = createCepXpdr(spcXpdrClient, TapiStringConstants.E_ODU,
+ TapiStringConstants.DSR, LayerProtocolName.ODU);
+ putXpdrCepInTopologyContext(xpdr, spcXpdrClient, TapiStringConstants.E_ODU, TapiStringConstants.DSR,
+ netCep2);
+
+ String spcXpdrNetwork = getAssociatedNetworkPort(spcXpdrClient, xpdrNetworkTplist);
+ ConnectionEndPoint netCep3 = getAssociatediODUCep(spcXpdrNetwork);
+
+ cepMapDsr.put(netCep1.key(), netCep1);
+ cepMapOdu.put(netCep2.key(), netCep2);
+ // Create x connection between I_ODU and E_ODU within xpdr
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
+ connection = createXCBetweenCeps(netCep2, netCep3, spcXpdrClient, spcXpdrNetwork,
+ TapiStringConstants.ODU, LayerProtocolName.ODU);
+ this.connectionFullMap.put(connection.key(), connection);
+
+ // Create X connection that will be added to the service object
+ Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build();
+ connServMap.put(conn.key(), conn);
}
// DSR top connection between edge xpdr CLIENT DSR
.get(0))).findFirst().get();
String spcXpdr2 = xpdrClientTplist.stream().filter(adp -> adp.contains(xpdrNodelist
.get(xpdrNodelist.size() - 1))).findFirst().get();
+
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
- connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.DSR,
- LayerProtocolName.DSR);
- this.connectionFullMap.put(connection.key(), connection);
+ connectionOdu = createTopConnection(spcXpdr1, spcXpdr2, cepMapOdu, TapiStringConstants.E_ODU,
+ LayerProtocolName.ODU);
+ this.connectionFullMap.put(connectionOdu.key(), connectionOdu);
// ODU top connection that will be added to the service object
- Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build();
+ Connection conn = new ConnectionBuilder().setConnectionUuid(connectionOdu.getUuid()).build();
connServMap.put(conn.key(), conn);
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
+ connectionDsr = createTopConnection(spcXpdr1, spcXpdr2, cepMapDsr, TapiStringConstants.DSR,
+ LayerProtocolName.DSR);
+ this.connectionFullMap.put(connectionDsr.key(), connectionDsr);
+
+ // DSR top connection that will be added to the service object
+ Connection conn1 = new ConnectionBuilder().setConnectionUuid(connectionDsr.getUuid()).build();
+ connServMap.put(conn1.key(), conn1);
+
return connServMap;
}
Map<ConnectionKey, Connection> connServMap = new HashMap<>();
Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey,
ConnectionEndPoint> cepMap = new HashMap<>();
- // Create 1 cep per Xpdr in the I_ODU and E_ODU, X connection between iODU and eODU and a top
+ // Create 1 cep per Xpdr in the I_ODU and a top
// connection iODU between the xpdrs
for (String xpdr:xpdrNodelist) {
LOG.info("Creating ceps and xc for xpdr {}", xpdr);
String spcXpdrNetwork = xpdrNetworkTplist.stream().filter(netp -> netp.contains(xpdr)).findFirst().get();
- ConnectionEndPoint netCep1 = createCepXpdr(spcXpdrNetwork, TapiStringConstants.E_ODU,
- TapiStringConstants.DSR, LayerProtocolName.ODU);
- putXpdrCepInTopologyContext(xpdr, spcXpdrNetwork, TapiStringConstants.E_ODU, TapiStringConstants.DSR,
- netCep1);
- ConnectionEndPoint netCep2 = createCepXpdr(spcXpdrNetwork, TapiStringConstants.I_ODU,
+ ConnectionEndPoint netCep1 = createCepXpdr(spcXpdrNetwork, TapiStringConstants.I_ODU,
TapiStringConstants.DSR, LayerProtocolName.ODU);
putXpdrCepInTopologyContext(xpdr, spcXpdrNetwork, TapiStringConstants.I_ODU, TapiStringConstants.DSR,
- netCep2);
+ netCep1);
cepMap.put(netCep1.key(), netCep1);
- cepMap.put(netCep2.key(), netCep2);
-
- // Create x connection between I_ODU and E_ODU within xpdr
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
- connection = createXCBetweenCeps(netCep1, netCep2, spcXpdrNetwork, spcXpdrNetwork,
- TapiStringConstants.ODU, LayerProtocolName.ODU);
- this.connectionFullMap.put(connection.key(), connection);
-
- // Create X connection that will be added to the service object
- Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build();
- connServMap.put(conn.key(), conn);
}
- // ODU top connection between edge xpdr e_ODU
+ // ODU top connection between edge xpdr i_ODU
String spcXpdr1 = xpdrNetworkTplist.stream().filter(adp -> adp.contains(xpdrNodelist
.get(0))).findFirst().get();
String spcXpdr2 = xpdrNetworkTplist.stream().filter(adp -> adp.contains(xpdrNodelist
.get(xpdrNodelist.size() - 1))).findFirst().get();
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
- connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.E_ODU,
+ connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.I_ODU,
LayerProtocolName.ODU);
this.connectionFullMap.put(connection.key(), connection);
tp = (TerminationPoint) firstElement.getResource().getResource();
// Network-Network ports --> iODU layer SIPs TODO --> updated to E_ODU
sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP",
- tp.getTpNodeId(), TapiStringConstants.E_ODU, tp.getTpId())).getBytes(Charset.forName("UTF-8")))
+ tp.getTpNodeId(), TapiStringConstants.I_ODU, tp.getTpId())).getBytes(Charset.forName("UTF-8")))
.toString());
- LOG.info("SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.E_ODU,
+ LOG.info("SIP name = {}", String.join("+", tp.getTpNodeId(), TapiStringConstants.I_ODU,
tp.getTpId()));
break;
case OTU:
tp.getTpId()));
break;
case Ethernet:
+ LOG.info("Elements ZA = {}", mapztoa.values().toString());
firstElement = mapztoa.values().stream().filter(ztoa -> ztoa.getId().equals("0")).findFirst().get();
tp = (TerminationPoint) firstElement.getResource().getResource();
// Client-client ports --> DSR layer SIPs
tp = (TerminationPoint) firstElement.getResource().getResource();
// Network-Network ports --> iODU layer SIPs. TODO -> updated to eODU
sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP",
- tp.getTpNodeId(), TapiStringConstants.E_ODU, tp.getTpId())).getBytes(Charset.forName("UTF-8")))
+ tp.getTpNodeId(), TapiStringConstants.I_ODU, tp.getTpId())).getBytes(Charset.forName("UTF-8")))
.toString());
LOG.info("ODU XPDR SIP name = {}", String.join("+", tp.getTpNodeId(),
- TapiStringConstants.E_ODU, tp.getTpId()));
+ TapiStringConstants.I_ODU, tp.getTpId()));
break;
case OTU:
firstElement = mapatoz.values().stream().filter(atoz -> atoz.getId().equals("2")).findFirst().get();
TapiStringConstants.I_OTSI, tp.getTpId()));
break;
case Ethernet:
+ LOG.info("Elements AZ = {}", mapatoz.values().toString());
firstElement = mapatoz.values().stream().filter(atoz -> atoz.getId().equals("0")).findFirst().get();
tp = (TerminationPoint) firstElement.getResource().getResource();
// Client-client ports --> DSR layer SIPs
}
private String getIdBasedOnModelVersion(String nodeid) {
- return nodeid.matches("[A-Z]{5}-[A-Z0-9]{2}-.*") ? String.join("-", nodeid.split("-")[0], nodeid.split("-")[1])
- : nodeid.split("-")[0];
+ return nodeid.matches("[A-Z]{5}-[A-Z0-9]{2}-.*") ? String.join("-", nodeid.split("-")[0],
+ nodeid.split("-")[1]) : nodeid.split("-")[0];
}
public ServiceCreateInput createORServiceInput(CreateConnectivityServiceInput input, Uuid serviceUuid) {
connType = ConnectionType.Infrastructure;
serviceFormat = ServiceFormat.ODU;
break;
+ case 1:
+ LOG.info("ETH, no need to create OTU and ODU");
+ connType = ConnectionType.Service;
+ serviceFormat = ServiceFormat.Ethernet;
+ break;
case 2:
- LOG.info("DSR");
+ LOG.info("DSR, need to create OTU and ODU");
connType = ConnectionType.Service;
serviceFormat = ServiceFormat.Ethernet;
break;
// EndPoints ar not ROADMs -> XPDR, MUXPDR, SWTICHPDR
return ServiceFormat.OTU;
}
+
+ private ConnectionEndPoint getAssociatediODUCep(String spcXpdrNetwork) {
+ Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", spcXpdrNetwork.split("\\+")[0],
+ TapiStringConstants.DSR).getBytes(Charset.forName("UTF-8")))).toString());
+ Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", spcXpdrNetwork.split("\\+")[0],
+ TapiStringConstants.I_ODU, spcXpdrNetwork.split("\\+")[1]).getBytes(Charset.forName("UTF-8"))))
+ .toString());
+ Uuid cepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "CEP",
+ spcXpdrNetwork.split("\\+")[0], TapiStringConstants.I_ODU, spcXpdrNetwork.split("\\+")[1]))
+ .getBytes(Charset.forName("UTF-8"))).toString());
+ return this.tapiContext.getTapiCEP(this.tapiTopoUuid, nodeUuid, nepUuid, cepUuid);
+ }
+
+ private String getAssociatedNetworkPort(String spcXpdrClient, List<String> xpdrNetworkTplist) {
+ for (String networkPort:xpdrNetworkTplist) {
+ if (networkPort.split("\\+")[0].equals(spcXpdrClient.split("\\+")[0])) {
+ return networkPort;
+ }
+ }
+ return null;
+ }
}
&& sipMap.containsKey(new ServiceInterfacePointKey(input.getEndPoint().values().stream().skip(1)
.findFirst().get().getServiceInterfacePoint().getServiceInterfacePointUuid()))) {
LOG.info("SIPs found in sipMap");
+ // TODO: differentiate between OTN service and GbE service in TAPI
ServiceCreateInput sci = this.connectivityUtils.createORServiceInput(input, serviceUuid);
if (sci == null) {
return RpcResultBuilder.<CreateConnectivityServiceOutput>failed().withError(RpcError.ErrorType.RPC,
.setAToZDirection(servicePathRpcResult.getPathDescription().getAToZDirection())
.setZToADirection(servicePathRpcResult.getPathDescription().getZToADirection())
.build();
- LOG.info("PathDescription gets : {}", pathDescription);
+ LOG.info("PathDescription for TAPI gets : {}", pathDescription);
if (input == null) {
LOG.error("Input is null !");
return;
}
// create corresponding CEPs and Connections. Connections should be added to the corresponding context
// CEPs must be included in the topology context as an augmentation for each ONEP!!
+ // TODO -> Maybe we dont need to create the connections and ceps if the previous service doesnt exist??
+ // As mentioned above, for 100GbE service creation there are ROADMs in the path description.
+ // What are the configurations needed here? No OTU, ODU... what kind of cross connections is needed?
+ // this needs to be changed
switch (serviceProtName) {
case PHOTONICMEDIA:
// Identify number of ROADMs
case DSR:
// Check if OC, OTU and ODU are created
// Check if OC, OTU and ODU are created
+ // TODO differentiate between 100GbE and OTN 10GbE services
if (!rdmNodelist.isEmpty()) {
connectionServMap.putAll(createRoadmCepsAndConnections(rdmAddDropTplist, rdmDegTplist, rdmNodelist,
edgeRoadm1, edgeRoadm2));
connectionServMap.putAll(createXpdrCepsAndConnectionsOdu(xpdrNetworkTplist, xpdrNodelist));
}
// Top connection in the DSR layer, between client ports of the xpdrs
- connectionServMap.putAll(createXpdrCepsAndConnectionsDsr(xpdrClientTplist, xpdrNodelist));
+ connectionServMap.putAll(createXpdrCepsAndConnectionsDsr(xpdrClientTplist, xpdrNetworkTplist,
+ xpdrNodelist));
break;
default:
LOG.error("Service type format {} not supported", serviceProtName.getName());
}
private Map<ConnectionKey,Connection> createXpdrCepsAndConnectionsDsr(List<String> xpdrClientTplist,
+ List<String> xpdrNetworkTplist,
List<String> xpdrNodelist) {
Map<ConnectionKey, Connection> connServMap = new HashMap<>();
Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey,
- ConnectionEndPoint> cepMap = new HashMap<>();
+ ConnectionEndPoint> cepMapDsr = new HashMap<>();
+ Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey,
+ ConnectionEndPoint> cepMapOdu = new HashMap<>();
- // Create 1 cep per Xpdr in the CLIENT and a top connection DSR between the CLIENT xpdrs
+ // Create 1 cep per Xpdr in the CLIENT, 1 cep per Xpdr eODU, 1 XC between eODU and iODE,
+ // 1 top connection between eODU and a top connection DSR between the CLIENT xpdrs
for (String xpdr:xpdrNodelist) {
LOG.info("Creating ceps and xc for xpdr {}", xpdr);
String spcXpdrClient = xpdrClientTplist.stream().filter(netp -> netp.contains(xpdr)).findFirst().get();
LayerProtocolName.DSR);
putXpdrCepInTopologyContext(xpdr, spcXpdrClient, TapiStringConstants.DSR, TapiStringConstants.DSR, netCep1);
- cepMap.put(netCep1.key(), netCep1);
+ ConnectionEndPoint netCep2 = createCepXpdr(spcXpdrClient, TapiStringConstants.E_ODU,
+ TapiStringConstants.DSR, LayerProtocolName.ODU);
+ putXpdrCepInTopologyContext(xpdr, spcXpdrClient, TapiStringConstants.E_ODU, TapiStringConstants.DSR,
+ netCep2);
+
+ String spcXpdrNetwork = getAssociatedNetworkPort(spcXpdrClient, xpdrNetworkTplist);
+ ConnectionEndPoint netCep3 = getAssociatediODUCep(spcXpdrNetwork);
+
+ cepMapDsr.put(netCep1.key(), netCep1);
+ cepMapOdu.put(netCep2.key(), netCep2);
+ // Create x connection between I_ODU and E_ODU within xpdr
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
+ connection = createXCBetweenCeps(netCep2, netCep3, spcXpdrClient, spcXpdrNetwork,
+ TapiStringConstants.ODU, LayerProtocolName.ODU);
+ this.connectionFullMap.put(connection.key(), connection);
+
+ // Create X connection that will be added to the service object
+ Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build();
+ connServMap.put(conn.key(), conn);
}
// DSR top connection between edge xpdr CLIENT DSR
.get(0))).findFirst().get();
String spcXpdr2 = xpdrClientTplist.stream().filter(adp -> adp.contains(xpdrNodelist
.get(xpdrNodelist.size() - 1))).findFirst().get();
+
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
- connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.DSR,
- LayerProtocolName.DSR);
- this.connectionFullMap.put(connection.key(), connection);
+ connectionOdu = createTopConnection(spcXpdr1, spcXpdr2, cepMapOdu, TapiStringConstants.E_ODU,
+ LayerProtocolName.ODU);
+ this.connectionFullMap.put(connectionOdu.key(), connectionOdu);
// ODU top connection that will be added to the service object
- Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build();
+ Connection conn = new ConnectionBuilder().setConnectionUuid(connectionOdu.getUuid()).build();
connServMap.put(conn.key(), conn);
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
+ connectionDsr = createTopConnection(spcXpdr1, spcXpdr2, cepMapDsr, TapiStringConstants.DSR,
+ LayerProtocolName.DSR);
+ this.connectionFullMap.put(connectionDsr.key(), connectionDsr);
+
+ // DSR top connection that will be added to the service object
+ Connection conn1 = new ConnectionBuilder().setConnectionUuid(connectionDsr.getUuid()).build();
+ connServMap.put(conn1.key(), conn1);
+
return connServMap;
}
Map<ConnectionKey, Connection> connServMap = new HashMap<>();
Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey,
ConnectionEndPoint> cepMap = new HashMap<>();
- // Create 1 cep per Xpdr in the I_ODU and E_ODU, X connection between iODU and eODU and a top
+ // Create 1 cep per Xpdr in the I_ODU and a top
// connection iODU between the xpdrs
for (String xpdr:xpdrNodelist) {
LOG.info("Creating ceps and xc for xpdr {}", xpdr);
String spcXpdrNetwork = xpdrNetworkTplist.stream().filter(netp -> netp.contains(xpdr)).findFirst().get();
- ConnectionEndPoint netCep1 = createCepXpdr(spcXpdrNetwork, TapiStringConstants.E_ODU,
+ ConnectionEndPoint netCep1 = createCepXpdr(spcXpdrNetwork, TapiStringConstants.I_ODU,
TapiStringConstants.DSR, LayerProtocolName.ODU);
- putXpdrCepInTopologyContext(xpdr, spcXpdrNetwork, TapiStringConstants.E_ODU, TapiStringConstants.DSR,
+ putXpdrCepInTopologyContext(xpdr, spcXpdrNetwork, TapiStringConstants.I_ODU, TapiStringConstants.DSR,
netCep1);
- ConnectionEndPoint netCep2 = createCepXpdr(spcXpdrNetwork, TapiStringConstants.I_ODU,
- TapiStringConstants.DSR, LayerProtocolName.ODU);
- putXpdrCepInTopologyContext(xpdr, spcXpdrNetwork, TapiStringConstants.I_ODU,
- TapiStringConstants.DSR, netCep2);
cepMap.put(netCep1.key(), netCep1);
- cepMap.put(netCep2.key(), netCep2);
-
- // Create x connection between I_ODU and E_ODU within xpdr
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
- connection = createXCBetweenCeps(netCep1, netCep2, spcXpdrNetwork, spcXpdrNetwork,
- TapiStringConstants.ODU, LayerProtocolName.ODU);
- this.connectionFullMap.put(connection.key(), connection);
-
- // Create X connection that will be added to the service object
- Connection conn = new ConnectionBuilder().setConnectionUuid(connection.getUuid()).build();
- connServMap.put(conn.key(), conn);
}
- // ODU top connection between edge xpdr e_ODU
+ // ODU top connection between edge xpdr i_ODU
String spcXpdr1 = xpdrNetworkTplist.stream().filter(adp -> adp.contains(xpdrNodelist
.get(0))).findFirst().get();
String spcXpdr2 = xpdrNetworkTplist.stream().filter(adp -> adp.contains(xpdrNodelist
.get(xpdrNodelist.size() - 1))).findFirst().get();
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.Connection
- connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.E_ODU,
- LayerProtocolName.ODU);
+ connection = createTopConnection(spcXpdr1, spcXpdr2, cepMap, TapiStringConstants.I_ODU,
+ LayerProtocolName.ODU);
this.connectionFullMap.put(connection.key(), connection);
// ODU top connection that will be added to the service object
? String.join("-", nodeid.split("-")[0], nodeid.split("-")[1]) : nodeid.split("-")[0];
}
+ private ConnectionEndPoint getAssociatediODUCep(String spcXpdrNetwork) {
+ Uuid topoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER
+ .getBytes(Charset.forName("UTF-8"))).toString());
+ Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", spcXpdrNetwork.split("\\+")[0],
+ TapiStringConstants.DSR).getBytes(Charset.forName("UTF-8")))).toString());
+ Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", spcXpdrNetwork.split("\\+")[0],
+ TapiStringConstants.I_ODU, spcXpdrNetwork.split("\\+")[1]).getBytes(Charset.forName("UTF-8"))))
+ .toString());
+ Uuid cepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "CEP",
+ spcXpdrNetwork.split("\\+")[0], TapiStringConstants.I_ODU, spcXpdrNetwork.split("\\+")[1]))
+ .getBytes(Charset.forName("UTF-8"))).toString());
+ InstanceIdentifier<OwnedNodeEdgePoint> nepIID = InstanceIdentifier.builder(Context.class)
+ .augmentation(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1.class)
+ .child(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.context.TopologyContext.class)
+ .child(Topology.class, new TopologyKey(topoUuid))
+ .child(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node.class,
+ new NodeKey(nodeUuid)).child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nepUuid)).build();
+ try {
+ Optional<OwnedNodeEdgePoint> optNode = this.networkTransactionService
+ .read(LogicalDatastoreType.OPERATIONAL, nepIID).get();
+ if (!optNode.isPresent()) {
+ LOG.error("Node is not present in datastore");
+ return null;
+ }
+ if (optNode.get().augmentation(OwnedNodeEdgePoint1.class) == null) {
+ LOG.error("Node doesnt have ceps");
+ return null;
+ }
+ return optNode.get().augmentation(OwnedNodeEdgePoint1.class).getCepList().getConnectionEndPoint()
+ .get(new org.opendaylight.yang.gen.v1.urn
+ .onf.otcc.yang.tapi.connectivity.rev181210.cep.list.ConnectionEndPointKey(cepUuid));
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.error("Couldnt read node in topology", e);
+ return null;
+ }
+ }
+
+ private String getAssociatedNetworkPort(String spcXpdrClient, List<String> xpdrNetworkTplist) {
+ for (String networkPort:xpdrNetworkTplist) {
+ if (networkPort.split("\\+")[0].equals(spcXpdrClient.split("\\+")[0])) {
+ return networkPort;
+ }
+ }
+ return null;
+ }
+
public void setInput(CreateConnectivityServiceInput input) {
this.input = input;
}
.build();
OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
- LayerProtocolName.ODU, LayerProtocolName.DSR, false, String.join("+", this.ietfNodeId,
+ LayerProtocolName.ODU, LayerProtocolName.DSR, true, String.join("+", this.ietfNodeId,
TapiStringConstants.I_ODU));
onepl.put(onep.key(), onep);
}
// network nep creation on E_ODU node
- for (int i = 0; i < oorNetworkPortList.size(); i++) {
+ for (int i = 0; i < oorClientPortList.size(); i++) {
LOG.info("NEP = {}", String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorNetworkPortList.get(i).getTpId().getValue()));
+ oorClientPortList.get(i).getTpId().getValue()));
Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(
(String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8"))).toString());
+ oorClientPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8"))).toString());
this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorNetworkPortList.get(i).getTpId().getValue()), nepUuid);
+ oorClientPortList.get(i).getTpId().getValue()), nepUuid);
Name onedName = new NameBuilder()
.setValueName("eNodeEdgePoint_N")
.setValue(String.join("+", this.ietfNodeId, TapiStringConstants.E_ODU,
- oorNetworkPortList.get(i).getTpId().getValue()))
+ oorClientPortList.get(i).getTpId().getValue()))
.build();
- OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
- LayerProtocolName.ODU, LayerProtocolName.DSR, true, String.join("+", this.ietfNodeId,
+ OwnedNodeEdgePoint onep = createNep(oorClientPortList.get(i), Map.of(onedName.key(), onedName),
+ LayerProtocolName.ODU, LayerProtocolName.DSR, false, String.join("+", this.ietfNodeId,
TapiStringConstants.E_ODU));
onepl.put(onep.key(), onep);
}
TapiStringConstants.E_ODU, tp.getValue()));
if (this.uuidMap.containsKey(String.join("+", this.ietfNodeId,
TapiStringConstants.E_ODU, tp.getValue()))
- || this.uuidMap.containsKey(String.join("+", this.ietfNodeId,
+ && this.uuidMap.containsKey(String.join("+", this.ietfNodeId,
TapiStringConstants.DSR, tp.getValue()))) {
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint
- nep = new org.opendaylight.yang.gen.v1.urn
+ nep1 = new org.opendaylight.yang.gen.v1.urn
.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointBuilder()
.setTopologyUuid(tapiTopoUuid)
.setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId,
TapiStringConstants.DSR)))
- .setNodeEdgePointUuid((tp.getValue().contains("CLIENT")) ? this.uuidMap.get(String.join(
- "+", this.ietfNodeId, TapiStringConstants.DSR, tp.getValue()))
- : this.uuidMap.get(String.join(
+ .setNodeEdgePointUuid(this.uuidMap.get(String.join(
+ "+", this.ietfNodeId, TapiStringConstants.DSR, tp.getValue())))
+ .build();
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint
+ nep2 = new org.opendaylight.yang.gen.v1.urn
+ .onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointBuilder()
+ .setTopologyUuid(tapiTopoUuid)
+ .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId,
+ TapiStringConstants.DSR)))
+ .setNodeEdgePointUuid(this.uuidMap.get(String.join(
"+", this.ietfNodeId, TapiStringConstants.E_ODU, tp.getValue())))
.build();
- nepList.put(nep.key(), nep);
+ nepList.put(nep1.key(), nep1);
+ nepList.put(nep2.key(), nep2);
}
}
// Empty random creation of mandatory fields for avoiding errors....
operState = this.tapiLink.setTapiOperationalState(oorTp.augmentation(TerminationPoint1.class)
.getOperationalState().getName());
}
- onepBldr.setSupportedCepLayerProtocolQualifier(createSupportedLayerProtocolQualifier(oorTp, nodeProtocol))
+ onepBldr.setSupportedCepLayerProtocolQualifier(createSupportedLayerProtocolQualifier(oorTp, nepProtocol))
.setLinkPortDirection(PortDirection.BIDIRECTIONAL)
.setLinkPortRole(PortRole.SYMMETRIC)
.setAdministrativeState(adminState)
for (SupportedInterfaceCapability sic : sicList) {
switch (lpn.getName()) {
case "DSR":
- case "ODU":
switch (sic.getIfCapType().getSimpleName()) {
// TODO: it may be needed to add more cases clauses if the interface capabilities of a
// port are extended in the config file
break;
}
break;
+ case "ODU":
+ switch (sic.getIfCapType().getSimpleName()) {
+ // TODO: it may be needed to add more cases clauses if the interface capabilities of a
+ // port are extended in the config file
+ case "If1GEODU0":
+ sclpqSet.add(ODUTYPEODU0.class);
+ break;
+ case "If10GEODU2e":
+ sclpqSet.add(ODUTYPEODU2E.class);
+ break;
+ case "If10GEODU2":
+ case "If10GE":
+ sclpqSet.add(ODUTYPEODU2.class);
+ break;
+ case "If100GEODU4":
+ case "If100GE":
+ case "IfOCHOTU4ODU4":
+ case "IfOCH":
+ sclpqSet.add(ODUTYPEODU4.class);
+ break;
+ default:
+ LOG.error("IfCapability type not managed");
+ break;
+ }
+ break;
case "PHOTONIC_MEDIA":
if (sic.getIfCapType().getSimpleName().equals("IfOCHOTU4ODU4")
- || sic.getIfCapType().getSimpleName().equals("IfOCH")) {
+ || sic.getIfCapType().getSimpleName().equals("IfOCH")) {
sclpqSet.add(PHOTONICLAYERQUALIFIEROTSi.class);
sclpqSet.add(PHOTONICLAYERQUALIFIEROMS.class);
}
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.edge.point.MappedServiceInterfacePoint;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.edge.point.MappedServiceInterfacePointBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.edge.point.MappedServiceInterfacePointKey;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.Rule;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.RuleBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.RuleKey;
onepMap.putAll(transformSrgToOnep(orNodeId, mapSrg));
// create tapi Node
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node roadmNode =
- createRoadmTapiNode(orNodeId, onepMap);
+ Node roadmNode = createRoadmTapiNode(orNodeId, onepMap);
mergeNodeinTopology(Map.of(roadmNode.key(), roadmNode));
mergeSipsinContext(this.sipMap);
// TODO add states corresponding to device config -> based on mapping.
String.join("+", nodeId, TapiStringConstants.DSR)).build();
List<LayerProtocolName> dsrLayerProtocols = Arrays.asList(LayerProtocolName.DSR,
LayerProtocolName.ODU);
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology
- .Node dsrNode = createTapiXpdrNode(Map.of(nameDsr.key(), nameDsr), dsrLayerProtocols,
+ Node dsrNode = createTapiXpdrNode(Map.of(nameDsr.key(), nameDsr), dsrLayerProtocols,
nodeId, nodeUuidDsr, xpdrClMaps, xpdrNetMaps, xponderType, oorOduSwitchingPool);
nodeMap.put(dsrNode.key(), dsrNode);
Name nameOtsi = new NameBuilder().setValueName("otsi node name").setValue(
String.join("+", nodeId, TapiStringConstants.OTSI)).build();
List<LayerProtocolName> otsiLayerProtocols = Arrays.asList(LayerProtocolName.PHOTONICMEDIA);
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology
- .Node otsiNode = createTapiXpdrNode(Map.of(nameOtsi.key(), nameOtsi), otsiLayerProtocols,
+ Node otsiNode = createTapiXpdrNode(Map.of(nameOtsi.key(), nameOtsi), otsiLayerProtocols,
nodeId, nodeUuidOtsi, xpdrClMaps, xpdrNetMaps, xponderType, null);
nodeMap.put(otsiNode.key(), otsiNode);
OwnedNodeEdgePoint onep = createNep(nepUuid, xpdrNetMaps.get(i).getLogicalConnectionPoint(),
Map.of(onedName.key(), onedName),
- LayerProtocolName.ODU, LayerProtocolName.DSR, false,
+ LayerProtocolName.ODU, LayerProtocolName.DSR, true,
String.join("+", nodeId, TapiStringConstants.I_ODU),
xpdrNetMaps.get(i).getSupportedInterfaceCapability(),
transformOperState(xpdrNetMaps.get(i).getPortOperState()),
onepl.put(onep.key(), onep);
}
// network nep creation on E_ODU node
- for (int i = 0; i < xpdrNetMaps.size(); i++) {
+ for (int i = 0; i < xpdrClMaps.size(); i++) {
LOG.info("eODU NEP = {}", String.join("+", nodeId, TapiStringConstants.E_ODU,
- xpdrNetMaps.get(i).getLogicalConnectionPoint()));
+ xpdrClMaps.get(i).getLogicalConnectionPoint()));
Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(
(String.join("+", nodeId, TapiStringConstants.E_ODU,
- xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString());
+ xpdrClMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString());
Name onedName = new NameBuilder()
.setValueName("eNodeEdgePoint_N")
.setValue(String.join("+", nodeId, TapiStringConstants.E_ODU,
- xpdrNetMaps.get(i).getLogicalConnectionPoint()))
+ xpdrClMaps.get(i).getLogicalConnectionPoint()))
.build();
- OwnedNodeEdgePoint onep = createNep(nepUuid, xpdrNetMaps.get(i).getLogicalConnectionPoint(),
+ OwnedNodeEdgePoint onep = createNep(nepUuid, xpdrClMaps.get(i).getLogicalConnectionPoint(),
Map.of(onedName.key(), onedName),
- LayerProtocolName.ODU, LayerProtocolName.DSR, true,
+ LayerProtocolName.ODU, LayerProtocolName.DSR, false,
String.join("+", nodeId, TapiStringConstants.E_ODU),
- xpdrNetMaps.get(i).getSupportedInterfaceCapability(),
- transformOperState(xpdrNetMaps.get(i).getPortOperState()),
- transformAdminState(xpdrNetMaps.get(i).getPortAdminState()));
+ xpdrClMaps.get(i).getSupportedInterfaceCapability(),
+ transformOperState(xpdrClMaps.get(i).getPortOperState()),
+ transformAdminState(xpdrClMaps.get(i).getPortAdminState()));
onepl.put(onep.key(), onep);
}
return onepl;
private AdministrativeState transformAdminState(String adminString) {
AdminStates adminState = org.opendaylight.transportpce.networkmodel.util.TopologyUtils
- .setNetworkAdminState(adminString);
+ .setNetworkAdminState(adminString);
return adminState.equals(AdminStates.InService) ? AdministrativeState.UNLOCKED : AdministrativeState.LOCKED;
}
}
LOG.debug("Node layer {}", nodeProtocol.getName());
onepBldr.setSupportedCepLayerProtocolQualifier(createSupportedLayerProtocolQualifier(
- supportedInterfaceCapability, nodeProtocol));
+ supportedInterfaceCapability, nepProtocol));
onepBldr.setLinkPortDirection(PortDirection.BIDIRECTIONAL).setLinkPortRole(PortRole.SYMMETRIC)
.setAdministrativeState(adminState).setOperationalState(operState)
.setLifecycleState(LifecycleState.INSTALLED).setTerminationDirection(TerminationDirection.BIDIRECTIONAL)
tpid)).getBytes(Charset.forName("UTF-8"))).toString());
MappedServiceInterfacePoint msip = new MappedServiceInterfacePointBuilder()
.setServiceInterfacePointUuid(sipUuid).build();
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.tapi.context.ServiceInterfacePoint sip
- = createSIP(sipUuid, layerProtocol, tpid, nodeid, supportedInterfaceCapability,
- operState, adminState);
+ ServiceInterfacePoint sip = createSIP(sipUuid, layerProtocol, tpid, nodeid, supportedInterfaceCapability,
+ operState, adminState);
this.sipMap.put(sip.key(), sip);
LOG.info("SIP created {}", sip.getUuid());
// this.tapiSips.put(sip.key(), sip);
.build();
}
- private org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node
- createRoadmTapiNode(String orNodeId, Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> oneplist) {
+ private Node createRoadmTapiNode(String orNodeId, Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> oneplist) {
// UUID
Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", orNodeId,
TapiStringConstants.PHTNC_MEDIA)).getBytes(Charset.forName("UTF-8"))).toString());
private Map<NodeRuleGroupKey, NodeRuleGroup> createNodeRuleGroupForRdmNode(String orNodeId, Uuid nodeUuid,
Collection<OwnedNodeEdgePoint> onepl) {
- Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointKey,
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint>
+ Map<NodeEdgePointKey, NodeEdgePoint>
nepMap = new HashMap<>();
for (OwnedNodeEdgePoint onep : onepl) {
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint
- nep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group
- .NodeEdgePointBuilder()
- .setTopologyUuid(this.tapiTopoUuid)
- .setNodeUuid(nodeUuid)
- .setNodeEdgePointUuid(onep.key().getUuid())
- .build();
+ NodeEdgePoint nep = new NodeEdgePointBuilder()
+ .setTopologyUuid(this.tapiTopoUuid)
+ .setNodeUuid(nodeUuid)
+ .setNodeEdgePointUuid(onep.key().getUuid())
+ .build();
nepMap.put(nep.key(), nep);
}
Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupMap = new HashMap<>();
}
Map<NonBlockingListKey, NonBlockingList> nbMap = new HashMap<>();
NonBlockingList nbl = new NonBlockingListBuilder()
- .setNblNumber(Uint16.valueOf(1))
- .setTpList(tpl)
- .build();
+ .setNblNumber(Uint16.valueOf(1))
+ .setTpList(tpl)
+ .build();
nbMap.put(nbl.key(),nbl);
return new OduSwitchingPoolsBuilder()
- .setSwitchingPoolNumber(Uint16.valueOf(1))
- .setSwitchingPoolType(SwitchingPoolTypes.NonBlocking)
- .setNonBlockingList(nbMap)
- .build();
+ .setSwitchingPoolNumber(Uint16.valueOf(1))
+ .setSwitchingPoolType(SwitchingPoolTypes.NonBlocking)
+ .setNonBlockingList(nbMap)
+ .build();
}
private OduSwitchingPools createMuxSwitchPool(List<Mapping> xpdrClMaps, List<Mapping> xpdrNetMaps, Integer xpdrNb) {
tpId = new TpId("XPDR" + xpdrNb + "-NETWORK1");
tpList.add(tpId);
NonBlockingList nbl = new NonBlockingListBuilder()
- .setNblNumber(Uint16.valueOf(i))
- .setTpList(tpList)
- .setAvailableInterconnectBandwidth(Uint32.valueOf(xpdrNetMaps.size() * 10L))
- .setInterconnectBandwidthUnit(Uint32.valueOf(1000000000))
- .build();
+ .setNblNumber(Uint16.valueOf(i))
+ .setTpList(tpList)
+ .setAvailableInterconnectBandwidth(Uint32.valueOf(xpdrNetMaps.size() * 10L))
+ .setInterconnectBandwidthUnit(Uint32.valueOf(1000000000))
+ .build();
nbMap.put(nbl.key(),nbl);
}
return new OduSwitchingPoolsBuilder()
// create NodeRuleGroup
int count = 1;
for (Mapping tpMapping : xpdrNetMaps) {
- Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointKey,
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint>
- nepList = new HashMap<>();
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group
- .NodeEdgePoint inep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210
- .node.rule.group.NodeEdgePointBuilder()
- .setTopologyUuid(this.tapiTopoUuid)
- .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId,
- TapiStringConstants.OTSI)).getBytes(Charset.forName("UTF-8")))
- .toString()))
- .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId,
- TapiStringConstants.I_OTSI, tpMapping.getLogicalConnectionPoint()))
- .getBytes(Charset.forName("UTF-8"))).toString()))
- .build();
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group
- .NodeEdgePoint enep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210
- .node.rule.group.NodeEdgePointBuilder()
- .setTopologyUuid(this.tapiTopoUuid)
- .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId,
+ Map<NodeEdgePointKey, NodeEdgePoint> nepList = new HashMap<>();
+ NodeEdgePoint inep = new NodeEdgePointBuilder()
+ .setTopologyUuid(this.tapiTopoUuid)
+ .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId,
TapiStringConstants.OTSI)).getBytes(Charset.forName("UTF-8"))).toString()))
- .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", nodeId, TapiStringConstants.E_OTSI,
- tpMapping.getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()))
- .build();
+ .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId,
+ TapiStringConstants.I_OTSI, tpMapping.getLogicalConnectionPoint()))
+ .getBytes(Charset.forName("UTF-8"))).toString()))
+ .build();
+ NodeEdgePoint enep = new NodeEdgePointBuilder()
+ .setTopologyUuid(this.tapiTopoUuid)
+ .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId,
+ TapiStringConstants.OTSI)).getBytes(Charset.forName("UTF-8"))).toString()))
+ .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes(
+ (String.join("+", nodeId, TapiStringConstants.E_OTSI,
+ tpMapping.getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()))
+ .build();
nepList.put(inep.key(), inep);
nepList.put(enep.key(), enep);
// Empty random creation of mandatory fields for avoiding errors....
int count = 1;
for (NonBlockingList nbl : oorOduSwitchingPool.nonnullNonBlockingList().values()) {
LOG.info("Non blocking list = {}", nbl);
- Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointKey,
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint>
- nepList = new HashMap<>();
+ Map<NodeEdgePointKey, NodeEdgePoint> nepList = new HashMap<>();
for (TpId tp : nbl.getTpList()) {
LOG.info("EDOU TP = {}", String.join("+", nodeId, TapiStringConstants.E_ODU, tp.getValue()));
LOG.info("DSR TP = {}", String.join("+", nodeId, TapiStringConstants.DSR, tp.getValue()));
Uuid tp1Uuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId,
TapiStringConstants.DSR, tp.getValue())).getBytes(Charset.forName("UTF-8"))).toString());
if (onepl.containsKey(new OwnedNodeEdgePointKey(tpUuid))
- || onepl.containsKey(new OwnedNodeEdgePointKey(tp1Uuid))) {
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint
- nep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group
- .NodeEdgePointBuilder()
- .setTopologyUuid(this.tapiTopoUuid)
- .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes(
- (String.join("+", nodeId,TapiStringConstants. DSR))
- .getBytes(Charset.forName("UTF-8"))).toString()))
- .setNodeEdgePointUuid((tp.getValue().contains("CLIENT")) ? tp1Uuid : tpUuid)
- .build();
- nepList.put(nep.key(), nep);
+ && onepl.containsKey(new OwnedNodeEdgePointKey(tp1Uuid))) {
+ NodeEdgePoint nep1 = new NodeEdgePointBuilder()
+ .setTopologyUuid(this.tapiTopoUuid)
+ .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes(
+ (String.join("+", nodeId,TapiStringConstants. DSR))
+ .getBytes(Charset.forName("UTF-8"))).toString()))
+ .setNodeEdgePointUuid(tp1Uuid)
+ .build();
+ NodeEdgePoint nep2 = new NodeEdgePointBuilder()
+ .setTopologyUuid(this.tapiTopoUuid)
+ .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes(
+ (String.join("+", nodeId,TapiStringConstants. DSR))
+ .getBytes(Charset.forName("UTF-8"))).toString()))
+ .setNodeEdgePointUuid(tpUuid)
+ .build();
+ nepList.put(nep1.key(), nep1);
+ nepList.put(nep2.key(), nep2);
}
}
// Empty random creation of mandatory fields for avoiding errors....
for (SupportedInterfaceCapability sic : supIfMap.values()) {
switch (lpn.getName()) {
case "DSR":
- case "ODU":
switch (sic.getIfCapType().getSimpleName()) {
// TODO: it may be needed to add more cases clauses if the interface capabilities of a
// port are extended in the config file
break;
}
break;
+ case "ODU":
+ switch (sic.getIfCapType().getSimpleName()) {
+ // TODO: it may be needed to add more cases clauses if the interface capabilities of a
+ // port are extended in the config file
+ case "If1GEODU0":
+ sclpqList.add(ODUTYPEODU0.class);
+ break;
+ case "If10GEODU2e":
+ sclpqList.add(ODUTYPEODU2E.class);
+ break;
+ case "If10GEODU2":
+ case "If10GE":
+ sclpqList.add(ODUTYPEODU2.class);
+ break;
+ case "If100GEODU4":
+ case "If100GE":
+ case "IfOCHOTU4ODU4":
+ case "IfOCH":
+ sclpqList.add(ODUTYPEODU4.class);
+ break;
+ default:
+ LOG.error("IfCapability type not managed");
+ break;
+ }
+ break;
case "PHOTONIC_MEDIA":
if (sic.getIfCapType().getSimpleName().equals("IfOCHOTU4ODU4")
- || sic.getIfCapType().getSimpleName().equals("IfOCH")) {
+ || sic.getIfCapType().getSimpleName().equals("IfOCH")) {
sclpqList.add(PHOTONICLAYERQUALIFIEROTSi.class);
sclpqList.add(PHOTONICLAYERQUALIFIEROMS.class);
}
// TODO: verify this is correct. Should we identify the context IID with the context UUID??
LOG.info("Creating tapi node in TAPI topology context");
InstanceIdentifier<Topology> topoIID = InstanceIdentifier.builder(Context.class)
- .augmentation(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1.class)
- .child(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.context.TopologyContext.class)
+ .augmentation(Context1.class).child(TopologyContext.class)
.child(Topology.class, new TopologyKey(this.tapiTopoUuid))
.build();
// TODO: verify this is correct. Should we identify the context IID with the context UUID??
LOG.info("Creating tapi node in TAPI topology context");
InstanceIdentifier<Topology> topoIID = InstanceIdentifier.builder(Context.class)
- .augmentation(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1.class)
- .child(org.opendaylight.yang.gen.v1.urn
- .onf.otcc.yang.tapi.topology.rev181210.context.TopologyContext.class)
- .child(Topology.class, new TopologyKey(this.tapiTopoUuid))
- .build();
+ .augmentation(Context1.class).child(TopologyContext.class)
+ .child(Topology.class, new TopologyKey(this.tapiTopoUuid))
+ .build();
Topology topology = new TopologyBuilder().setUuid(this.tapiTopoUuid).setLink(linkMap).build();
private void updateConnectivityServicesState(Uuid sipUuid, String nodeId) {
// TODO: check if this IID is correct
InstanceIdentifier<ConnectivityContext> connectivitycontextIID = InstanceIdentifier.builder(Context.class)
- .augmentation(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.Context1.class)
- .child(ConnectivityContext.class)
- .build();
+ .augmentation(org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.Context1.class)
+ .child(ConnectivityContext.class)
+ .build();
ConnectivityContext connContext = null;
try {
Optional<ConnectivityContext> optConnContext =
*/
package org.opendaylight.transportpce.tapi.utils;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
+import java.util.TreeMap;
import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
import org.opendaylight.transportpce.tapi.connectivity.ConnectivityUtils;
import org.opendaylight.transportpce.tapi.topology.TapiTopologyException;
import org.opendaylight.transportpce.tapi.topology.TopologyUtils;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.Service;
import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceList;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.ServicesKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.tapi.context.ServiceInterfacePoint;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.tapi.context.ServiceInterfacePointKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.connectivity.context.ConnectivityService;
LOG.info("No services in datastore. No mapping needed");
return;
}
+ /*
+ Map<ServicesKey, Services> orderedServices = orServices.getServices().entrySet().stream()
+ .sorted(Comparator.comparing(serv -> serv.getValue().getServiceAEnd().getServiceFormat().getName()))
+ .collect(Collectors.toMap(Map.Entry::getKey,
+ Map.Entry::getValue, (left, right) -> left, LinkedHashMap::new));
+
+ */
+ Map<ServicesKey, Services> orderedServices = new TreeMap<>(Comparator.comparing(s ->
+ orServices.getServices().get(s).getServiceAEnd().getServiceFormat().getName()).reversed());
+ orderedServices.putAll(orServices.getServices());
+ LOG.info("orderedServices = {}", orderedServices);
+ // TODO order services correctly. First OTU, then ODU and then DSR
Map<ConnectivityServiceKey, ConnectivityService> connServMap = new HashMap<>();
- for (Service service:orServices.getServices().values()) {
+ for (Service service:orderedServices.values()) {
// map services
// connections needed to be created --> looking at path description
ConnectivityService connServ = this.connectivityUtils.mapORServiceToTapiConnectivity(service);
*/
package org.opendaylight.transportpce.tapi.topology;
+import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.either;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.hasItems;
+import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.google.common.util.concurrent.FluentFuture;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.global._class.NameKey;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.dsr.rev181210.DIGITALSIGNALTYPE100GigE;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.dsr.rev181210.DIGITALSIGNALTYPE10GigELAN;
+import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU0;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU2;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU2E;
import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.ODUTYPEODU4;
@Test
public void convertNodeWhenNoStates() {
- Node tpdr = changeTerminationPointState(tpdr100G, "XPDR1-NETWORK1", null, null);
+ Node tpdr = changeTerminationPointState(tpdr100G, "XPDR1-NETWORK1", "XPDR1-CLIENT1", null, null);
List<String> networkPortList = new ArrayList<>();
for (TerminationPoint tp : tpdr100G.augmentation(Node1.class).getTerminationPoint().values()) {
if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) {
.getTapiNodes().get(new
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.NodeKey(dsrNodeUuid));
Uuid enetworkNepUuid = new Uuid(
- UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+eODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
+ UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+eODU+XPDR1-CLIENT1").getBytes(Charset.forName("UTF-8")))
.toString());
Uuid inetworkNepUuid = new Uuid(
UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+iODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
@Test
public void convertNodeWhenBadStates1() {
- Node tpdr = changeTerminationPointState(tpdr100G, "XPDR1-NETWORK1", AdminStates.OutOfService,
- State.OutOfService);
+ Node tpdr = changeTerminationPointState(tpdr100G, "XPDR1-NETWORK1", "XPDR1-CLIENT1",
+ AdminStates.OutOfService, State.OutOfService);
List<String> networkPortList = new ArrayList<>();
for (TerminationPoint tp : tpdr100G.augmentation(Node1.class).getTerminationPoint().values()) {
if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) {
.getTapiNodes().get(new
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.NodeKey(dsrNodeUuid));
Uuid enetworkNepUuid = new Uuid(
- UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+eODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
+ UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+eODU+XPDR1-CLIENT1").getBytes(Charset.forName("UTF-8")))
.toString());
Uuid inetworkNepUuid = new Uuid(
UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+iODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
@Test
public void convertNodeWhenBadStates2() {
- Node tpdr = changeTerminationPointState(tpdr100G, "XPDR1-NETWORK1", AdminStates.Maintenance,
- State.Degraded);
+ Node tpdr = changeTerminationPointState(tpdr100G, "XPDR1-NETWORK1", "XPDR1-CLIENT1",
+ AdminStates.Maintenance, State.Degraded);
List<String> networkPortList = new ArrayList<>();
for (TerminationPoint tp : tpdr100G.augmentation(Node1.class).getTerminationPoint().values()) {
if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERNETWORK)) {
.getTapiNodes().get(new
org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.NodeKey(dsrNodeUuid));
Uuid enetworkNepUuid = new Uuid(
- UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+eODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
+ UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+eODU+XPDR1-CLIENT1").getBytes(Charset.forName("UTF-8")))
.toString());
Uuid inetworkNepUuid = new Uuid(
UUID.nameUUIDFromBytes(("XPDR-A1-XPDR1+iODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR2-CLIENT4").getBytes(Charset.forName("UTF-8")))
.toString());
checkNepClient100GSwitch(nep1, client4NepUuid, nodeId + "+DSR+XPDR2-CLIENT4", "NodeEdgePoint_C");
- OwnedNodeEdgePoint enep2 = enepsN.get(3);
+ OwnedNodeEdgePoint enep2 = enepsN.get(2);
OwnedNodeEdgePoint inep2 = inepsN.get(3);
Uuid enetworkNepUuid = new Uuid(
- UUID.nameUUIDFromBytes((nodeId + "+eODU+XPDR2-NETWORK1").getBytes(Charset.forName("UTF-8")))
+ UUID.nameUUIDFromBytes((nodeId + "+eODU+XPDR2-CLIENT4").getBytes(Charset.forName("UTF-8")))
.toString());
Uuid inetworkNepUuid = new Uuid(
UUID.nameUUIDFromBytes((nodeId + "+iODU+XPDR2-NETWORK1").getBytes(Charset.forName("UTF-8")))
.toString());
- checkNepNetworkODU4(enep2, enetworkNepUuid, nodeId + "+eODU+XPDR2-NETWORK1", "eNodeEdgePoint_N", true);
- checkNepNetworkODU4(inep2, inetworkNepUuid, nodeId + "+iODU+XPDR2-NETWORK1", "iNodeEdgePoint_N", false);
+ checkNepeODU4(enep2, enetworkNepUuid, nodeId + "+eODU+XPDR2-CLIENT4", "eNodeEdgePoint_N", false);
+ checkNepNetworkODU4(inep2, inetworkNepUuid, nodeId + "+iODU+XPDR2-NETWORK1", "iNodeEdgePoint_N", true);
List<NodeRuleGroup> nrgList = node.nonnullNodeRuleGroup().values().stream()
.sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue()))
.collect(Collectors.toList());
.filter(n -> n.getName().containsKey(new NameKey("NodeEdgePoint_C")))
.sorted((nep3, nep4) -> nep3.getUuid().getValue().compareTo(nep4.getUuid().getValue()))
.collect(Collectors.toList());
- assertEquals("Mux-DSR node should have 1 eNEP network", 1, enepsN.size());
+ assertEquals("Mux-DSR node should have 4 eNEP network", 4, enepsN.size());
assertEquals("Mux-DSR node should have 1 iNEP network", 1, inepsN.size());
assertEquals("Mux-DSR node should have 4 NEPs client", 4, nepsC.size());
OwnedNodeEdgePoint nep3 = nepsC.get(2);
UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR1-CLIENT3").getBytes(Charset.forName("UTF-8")))
.toString());
checkNepClient10G(nep3, client3NepUuid, nodeId + "+DSR+XPDR1-CLIENT3", "NodeEdgePoint_C");
-
- OwnedNodeEdgePoint enep4 = enepsN.get(0);
+ OwnedNodeEdgePoint enep4 = enepsN.get(3);
OwnedNodeEdgePoint inep4 = inepsN.get(0);
Uuid enetworkNepUuid2 = new Uuid(
- UUID.nameUUIDFromBytes((nodeId + "+eODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
+ UUID.nameUUIDFromBytes((nodeId + "+eODU+XPDR1-CLIENT3").getBytes(Charset.forName("UTF-8")))
.toString());
Uuid inetworkNepUuid2 = new Uuid(
UUID.nameUUIDFromBytes((nodeId + "+iODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
.toString());
- checkNepNetworkODU4(enep4, enetworkNepUuid2, nodeId + "+eODU+XPDR1-NETWORK1", "eNodeEdgePoint_N", true);
+ checkNepeODU4(enep4, enetworkNepUuid2, nodeId + "+eODU+XPDR1-CLIENT3", "eNodeEdgePoint_N", false);
checkNepNetworkODU4(inep4, inetworkNepUuid2, nodeId + "+iODU+XPDR1-NETWORK1", "iNodeEdgePoint_N",
- false);
+ true);
List<NodeRuleGroup> nrgList2 = node.nonnullNodeRuleGroup().values().stream()
.sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue()))
.collect(Collectors.toList());
UUID.nameUUIDFromBytes((nodeId + "+DSR+XPDR1-CLIENT1").getBytes(Charset.forName("UTF-8")))
.toString());
checkNepClient100GTpdr(nep5, client1NepUuid, nodeId + "+DSR+XPDR1-CLIENT1", "100G-tpdr");
-
OwnedNodeEdgePoint enep6 = enepsN.get(0);
OwnedNodeEdgePoint inep6 = inepsN.get(1);
Uuid enetworkNepUuid3 = new Uuid(
- UUID.nameUUIDFromBytes((nodeId + "+eODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
+ UUID.nameUUIDFromBytes((nodeId + "+eODU+XPDR1-CLIENT1").getBytes(Charset.forName("UTF-8")))
.toString());
Uuid inetworkNepUuid3 = new Uuid(
UUID.nameUUIDFromBytes((nodeId + "+iODU+XPDR1-NETWORK1").getBytes(Charset.forName("UTF-8")))
.toString());
- checkNepNetworkODU4(enep6, enetworkNepUuid3, nodeId + "+eODU+XPDR1-NETWORK1", "eNodeEdgePoint_N", true);
+ checkNepeODU4(enep6, enetworkNepUuid3, nodeId + "+eODU+XPDR1-CLIENT1", "eNodeEdgePoint_N", false);
checkNepNetworkODU4(inep6, inetworkNepUuid3, nodeId + "+iODU+XPDR1-NETWORK1", "iNodeEdgePoint_N",
- false);
+ true);
List<NodeRuleGroup> nrgList3 = node.nonnullNodeRuleGroup().values().stream()
.sorted((nrg1, nrg2) -> nrg1.getUuid().getValue().compareTo(nrg2.getUuid().getValue()))
.collect(Collectors.toList());
checkCommonPartOfNep(nep, false);
}
+ private void checkNepeODU4(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName,
+ boolean withSip) {
+ assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid());
+ List<Name> nameList = new ArrayList<>(nep.nonnullName().values());
+ Name name = nameList.get(0);
+ assertEquals("value of eODU nep should be '" + portName + "'",
+ portName, name.getValue());
+ assertEquals("value-name of eODU nep for '" + portName + "' should be '" + nepName + "'",
+ nepName, name.getValueName());
+ // TODO: depending on the type of node there is one type or another
+ assertThat("eODU nep should support 1, 2 or 3 kind of cep, depending on client port",
+ nep.getSupportedCepLayerProtocolQualifier().size(), anyOf(is(1), is(2), is(3)));
+ assertTrue("eODU nep should support 1 kind of cep",
+ nep.getSupportedCepLayerProtocolQualifier().stream().anyMatch(splc -> splc.equals(ODUTYPEODU0.class)
+ || splc.equals(ODUTYPEODU2.class) || splc.equals(ODUTYPEODU2E.class)
+ || splc.equals(ODUTYPEODU4.class)));
+ assertEquals("eODU nep should be of ODU protocol type", LayerProtocolName.ODU, nep.getLayerProtocolName());
+ checkCommonPartOfNep(nep, withSip);
+ }
+
private void checkNepNetworkODU4(OwnedNodeEdgePoint nep, Uuid nepUuid, String portName, String nepName,
boolean withSip) {
assertEquals("bad uuid for " + portName, nepUuid, nep.getUuid());
assertEquals("each node-rule-group should contain 2 NEP for muxponder DSR",
2, nodeRuleGroup.getNodeEdgePoint().size());
}
- List<NodeEdgePoint> nodeEdgePointList = new ArrayList<>(nrgList.get(0).nonnullNodeEdgePoint().values());
+ List<NodeEdgePoint> nodeEdgePointList = new ArrayList<>(nrgList.get(2).nonnullNodeEdgePoint().values());
assertThat("node-rule-group nb 2 should be between nep-client4 and nep-network1",
nodeEdgePointList.get(1).getNodeEdgePointUuid().getValue(),
either(containsString(networkNepUuid.getValue())).or(containsString(clientNepUuid.getValue())));
.compareTo(nrg2.getNodeEdgePointUuid().getValue()))
.collect(Collectors.toList());
assertEquals("in the sorted node-rule-group, nep number 7 should be XPDR2-NETWORK1",
- networkNepUuid, nrg.get(7).getNodeEdgePointUuid());
+ networkNepUuid, nrg.get(6).getNodeEdgePointUuid());
assertEquals("in the sorted node-rule-group, nep number 4 should be XPDR2-CLIENT4",
- clientNepUuid, nrg.get(4).getNodeEdgePointUuid());
+ clientNepUuid, nrg.get(3).getNodeEdgePointUuid());
assertEquals("any item of the node-rule-group should have the same nodeUuid",
nodeUuid, nrg.get(4).getNodeUuid());
assertEquals("any item of the node-rule-group should have the same nodeUuid",
either(containsString(tp1Uuid.getValue())).or(containsString(tp2Uuid.getValue())));
}
- private Node changeTerminationPointState(Node initialNode, String tpid, AdminStates admin, State oper) {
+ private Node changeTerminationPointState(Node initialNode, String tpid, String tpid1, AdminStates admin,
+ State oper) {
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1Builder tpdr1Bldr
= new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1Builder(
initialNode.augmentation(Node1.class));
.setOperationalState(oper)
.build());
tps.replace(tpBldr.key(), tpBldr.build());
+ TerminationPointBuilder tpBldr1 = new TerminationPointBuilder(
+ tps.get(new TerminationPointKey(new TpId(tpid1))));
+ tpBldr1.addAugmentation(new TerminationPoint1Builder(tpBldr1.augmentation(TerminationPoint1.class))
+ .setAdministrativeState(admin)
+ .setOperationalState(oper)
+ .build());
+ tps.replace(tpBldr1.key(), tpBldr1.build());
tpdr1Bldr.setTerminationPoint(tps);
return new NodeBuilder(initialNode).addAugmentation(tpdr1Bldr.build()).build();
}
.flatMap(node -> node.getOwnedNodeEdgePoint().values().stream()
.filter(nep -> nep.getName().containsKey(new NameKey("eNodeEdgePoint_N"))))
.count();
- assertEquals("SPDR-SA1-XPDR1+DSR (mux) should have a single external network nep", 1, enb3);
+ assertEquals("SPDR-SA1-XPDR1+DSR (mux) should have 4 external network nep", 4, enb3);
long nb4 = topology.getNode().values().stream()
.filter(node -> node.getLayerProtocolName().contains(LayerProtocolName.DSR))
.filter(node -> node.getName().values().stream().findFirst().get().getValue().equals("SPDR-SA1-XPDR2+DSR"))
def test_19_create_connectivity_service_ODU(self):
# pylint: disable=line-too-long
self.cr_serv_sample_data["input"]["end-point"][0]["layer-protocol-name"] = "ODU"
- self.cr_serv_sample_data["input"]["end-point"][0]["service-interface-point"]["service-interface-point-uuid"] = "eecbfa6e-57ab-3651-9606-c22c8ce73f18"
+ self.cr_serv_sample_data["input"]["end-point"][0]["service-interface-point"]["service-interface-point-uuid"] = "5efda776-f8de-3e0b-9bbd-2c702e210946"
self.cr_serv_sample_data["input"]["end-point"][1]["layer-protocol-name"] = "ODU"
- self.cr_serv_sample_data["input"]["end-point"][1]["service-interface-point"]["service-interface-point-uuid"] = "31f83b1f-29b2-3a8e-af9b-6423dbc5aa22"
+ self.cr_serv_sample_data["input"]["end-point"][1]["service-interface-point"]["service-interface-point-uuid"] = "8116d0af-39fa-3df5-bed2-dd2cd5e8217d"
self.cr_serv_sample_data["input"]["connectivity-constraint"]["service-layer"] = "ODU"
response = test_utils.tapi_create_connectivity_request(self.cr_serv_sample_data)
self.assertEqual(ele['operational-state'], 'ENABLED')
self.assertEqual(ele['service-layer'], 'ODU')
nbconnection = len(ele['connection'])
- self.assertEqual(nbconnection, 3, 'There should be 3 connections')
+ self.assertEqual(nbconnection, 1, 'There should be 3 connections')
elif ele['uuid'] == self.uuid_services.dsr:
self.assertEqual(ele['operational-state'], 'ENABLED')
self.assertEqual(ele['service-layer'], 'DSR')
nbconnection = len(ele['connection'])
- self.assertEqual(nbconnection, 1, 'There should be 1 connection')
+ self.assertEqual(nbconnection, 4, 'There should be 4 connections')
else:
self.fail("get connectivity service failed")
time.sleep(2)