Code consolidation for end-to-end B100G services 80/97580/4
authorChristophe Betoule <christophe.betoule@orange.com>
Tue, 21 Sep 2021 13:18:05 +0000 (15:18 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Thu, 30 Sep 2021 11:54:03 +0000 (11:54 +0000)
Code consolidation to operate the end-to-end creation and deletion of
a 400GE service over a 400G TPDR and a 100GE service on a 400Gbps MPDR

JIRA: TRNSPRTPCE-505 TRNSPRTPCE-507
Signed-off-by: Christophe Betoule <christophe.betoule@orange.com>
Change-Id: I121dcc5a99f5c1f46b1a070cfa927a7af949ab69

networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/service/NetworkModelServiceImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/ModelMappingUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java

index 542ca1885126fd72d41870f8a6d86cb8e3926615..e5370ee33ebffd2226fff19d576c43abc07884f3 100644 (file)
@@ -556,7 +556,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
         linkTerminations.add(atermination);
         linkTerminations.add(ztermination);
 
-        List<Link> supportedOdu4Links = getSupportingOdu4Links(linkTerminations);
+        List<Link> supportedOdu4Links = getSupportingOdu4Links(linkTerminations, serviceRate);
         List<TerminationPoint> tps = getOtnNodeTps(linkTerminations);
         TopologyShard otnTopologyShard;
         otnTopologyShard = OpenRoadmOtnTopology.updateOtnLinks(supportedOdu4Links, tps, serviceRate, tribPortNb,
@@ -741,7 +741,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
         }
     }
 
-    private List<Link> getSupportingOdu4Links(List<LinkTp> nodesTopoTps) {
+    private List<Link> getSupportingOdu4Links(List<LinkTp> nodesTopoTps, Uint32 serviceRate) {
         InstanceIdentifier<Network1> iiOtnTopologyLinks = InstanceIdentifier.builder(Networks.class)
             .child(Network.class, new NetworkKey(new NetworkId(NetworkUtils.OTN_NETWORK_ID)))
             .augmentation(Network1.class)
@@ -761,7 +761,8 @@ public class NetworkModelServiceImpl implements NetworkModelService {
             odu4links = netw1Opt
                 .get()
                 .nonnullLink().values()
-                .stream().filter(lk -> lk.getLinkId().getValue().startsWith("ODTU4"))
+                .stream().filter(lk -> lk.getLinkId().getValue()
+                    .startsWith(Uint32.valueOf(100).equals(serviceRate) ? "ODUC4" : "ODTU4"))
                 .collect(Collectors.toList());
         }
         if (odu4links == null) {
@@ -783,7 +784,7 @@ public class NetworkModelServiceImpl implements NetworkModelService {
                 links.add(dlink);
             }
         }
-        LOG.debug("odu4links = {}", links.toString());
+        LOG.debug("odu4oduC4links = {}", links);
         return links;
     }
 
index baa88b3569959ea50abb0d91b281d5ca5f0c530a..418e7e9ed6841395b6a0c57e051f56e949771d56 100644 (file)
@@ -35,6 +35,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev1
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.FrequencyGHz;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.FrequencyTHz;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.ModulationFormat;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev181130.OpucnTribSlotDef;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteInput;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev210705.PathDescription;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev210705.path.description.AToZDirection;
@@ -252,6 +253,12 @@ public final class ModelMappingUtils {
                 .setTribPortNumber(tribPort)
                 .setTribSlot(minTribSlot);
         }
+        if (serviceRate.intValue() == 100) {
+            List<OpucnTribSlotDef> opucnTribSlotDefList = new ArrayList<>();
+            opucnTribSlotDefList.add(pathDescription.getAToZDirection().getMinTribSlot());
+            opucnTribSlotDefList.add(pathDescription.getAToZDirection().getMaxTribSlot());
+            otnServicePathInputBuilder.setOpucnTribSlots(opucnTribSlotDefList);
+        }
         return otnServicePathInputBuilder.build();
     }
 
index 5f276cee8de6b49551f344e4ed6e51e91becb824..8b07c40097d80ef713e9ee6ee41446567faf6e60 100644 (file)
@@ -192,7 +192,8 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
                 }
                 PathDescription pathDescription = pathDescriptionOpt.get();
                 String serviceType = ServiceTypes.getServiceType(service.getServiceAEnd().getServiceFormat().getName(),
-                    service.getServiceAEnd().getServiceRate(), null);
+                    service.getServiceAEnd().getServiceRate(), portMapping.getMapping(service.getServiceAEnd()
+                        .getNodeId().getValue(), service.getServiceAEnd().getTxDirection().getPort().getPortName()));
                 switch (serviceType) {
                     case StringConstants.SERVICE_TYPE_100GE_T:
                     case StringConstants.SERVICE_TYPE_400GE:
@@ -352,7 +353,7 @@ public class RendererServiceOperationsImpl implements RendererServiceOperations
             RENDERING_DEVICES_A_Z_MSG);
         ListenableFuture<OtnDeviceRenderingResult> atozrenderingFuture =
             this.executor.submit(new OtnDeviceRenderingTask(this.otnDeviceRenderer, otnServicePathAtoZ));
-        LOG.info("Rendering devices Z-A");
+        LOG.info(RENDERING_DEVICES_Z_A_MSG);
         sendNotifications(ServicePathNotificationTypes.ServiceImplementationRequest,
             otnServicePathZtoA.getServiceName(), RpcStatusEx.Pending,
             RENDERING_DEVICES_Z_A_MSG);