* @param link
* link containing termination points to be updated
* @param serviceRate
- * Service rate may be 1G, 10G or 100G
+ * Service rate may be 1G, 10G, 100G or 400G
* @param tribPortNb
* Trib port number allocated by the service
- * @param tribSoltNb
- * First trib slot number allocated by the service
+ * @param minTribSoltNb
+ * First contiguous trib slot number allocated by the service
+ * @param maxTribSoltNb
+ * Last contiguous trib slot number allocated by the service
* @param isDeletion
* True indicates if the low-order otn service must be deleted
*/
- void updateOtnLinks(Link link, Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion);
-
+ void updateOtnLinks(Link link, Uint32 serviceRate, Short tribPortNb, Short minTribSoltNb, Short maxTribSoltNb,
+ boolean isDeletion);
}
TopologyShard otnTopologyShard;
switch (linkType) {
case OTU4:
+ case OTUC4:
otnTopologyShard = OpenRoadmOtnTopology.createOtnLinks(nodeA, tpA, nodeZ, tpZ, linkType);
break;
case ODTU4:
+ case ODUC4:
String nodeTopoA = new StringBuilder(nodeA).append("-").append(tpA.split("-")[0]).toString();
String nodeTopoZ = new StringBuilder(nodeZ).append("-").append(tpZ.split("-")[0]).toString();
List<LinkId> linkIdList = new ArrayList<>();
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "OTU4"));
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "OTU4"));
+ String prefix;
+ if (OtnLinkType.ODTU4.equals(linkType)) {
+ prefix = OtnLinkType.OTU4.getName();
+ } else {
+ prefix = OtnLinkType.OTUC4.getName();
+ }
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix));
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix));
List<Link> supportedOtu4links = getOtnLinks(linkIdList);
List<TerminationPoint> tps = getOtnNodeTps(nodeTopoA, tpA, nodeTopoZ, tpZ);
-
- otnTopologyShard = OpenRoadmOtnTopology.createOtnLinks(supportedOtu4links, tps);
+ otnTopologyShard = OpenRoadmOtnTopology.createOtnLinks(supportedOtu4links, tps, linkType);
break;
default:
LOG.error("unknown otn link type {}", linkType);
TopologyShard otnTopologyShard;
String nodeTopoA = new StringBuilder(nodeA).append("-").append(tpA.split("-")[0]).toString();
String nodeTopoZ = new StringBuilder(nodeZ).append("-").append(tpZ.split("-")[0]).toString();
- List<Link> otu4Links;
+ List<Link> otuLinks;
List<LinkId> linkIdList = new ArrayList<>();
+ String prefix;
switch (linkType) {
case OTU4:
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "OTU4"));
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "OTU4"));
- otu4Links = getOtnLinks(linkIdList);
- if (checkLinks(otu4Links)) {
- deleteLinks(otu4Links);
+ case OTUC4:
+ if (OtnLinkType.OTU4.equals(linkType)) {
+ prefix = OtnLinkType.OTU4.getName();
+ } else {
+ prefix = OtnLinkType.OTUC4.getName();
+ }
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix));
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix));
+ otuLinks = getOtnLinks(linkIdList);
+ if (checkLinks(otuLinks)) {
+ deleteLinks(otuLinks);
} else {
LOG.error("Error deleting OTU4 links");
}
otnTopologyShard = new TopologyShard(null, null);
break;
case ODTU4:
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "ODU4"));
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "ODU4"));
- List<Link> odu4Links = getOtnLinks(linkIdList);
+ case ODUC4:
+ String prefix2;
+ if (OtnLinkType.ODTU4.equals(linkType)) {
+ prefix = OtnLinkType.ODTU4.getName();
+ prefix2 = OtnLinkType.OTU4.getName();
+ } else {
+ prefix = OtnLinkType.ODUC4.getName();
+ prefix2 = OtnLinkType.OTUC4.getName();
+ }
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix));
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix));
+ List<Link> oduLinks = getOtnLinks(linkIdList);
List<TerminationPoint> tps = getOtnNodeTps(nodeTopoA, tpA, nodeTopoZ, tpZ);
- if (checkLinks(odu4Links) && checkTerminationPoints(tps)) {
- deleteLinks(odu4Links);
+ if (checkLinks(oduLinks) && checkTerminationPoints(tps)) {
+ deleteLinks(oduLinks);
linkIdList.clear();
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, "OTU4"));
- linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, "OTU4"));
- otu4Links = getOtnLinks(linkIdList);
- otnTopologyShard = OpenRoadmOtnTopology.deleteOtnLinks(otu4Links, tps);
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoA, tpA, nodeTopoZ, tpZ, prefix2));
+ linkIdList.add(LinkIdUtil.buildOtnLinkId(nodeTopoZ, tpZ, nodeTopoA, tpA, prefix2));
+ otuLinks = getOtnLinks(linkIdList);
+ otnTopologyShard = OpenRoadmOtnTopology.deleteOtnLinks(otuLinks, tps, linkType);
} else {
LOG.error("Error deleting ODU4 links");
otnTopologyShard = new TopologyShard(null, null);
@Override
public void updateOtnLinks(
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210618.renderer.rpc.result.sp.Link
- notifLink, Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion) {
+ notifLink, Uint32 serviceRate, Short tribPortNb, Short minTribSoltNb, Short maxTribSlotNb,
+ boolean isDeletion) {
LinkTp atermination = new LinkTpBuilder()
.setNodeId(notifLink.getATermination().getNodeId())
List<TerminationPoint> tps = getOtnNodeTps(linkTerminations);
TopologyShard otnTopologyShard;
otnTopologyShard = OpenRoadmOtnTopology.updateOtnLinks(supportedOdu4Links, tps, serviceRate, tribPortNb,
- tribSoltNb, isDeletion);
+ minTribSoltNb, maxTribSlotNb, isDeletion);
if (otnTopologyShard.getLinks() != null) {
for (Link otnTopologyLink : otnTopologyShard.getLinks()) {
LOG.info("creating and updating otn links {} in {}", otnTopologyLink.getLinkId().getValue(),
odu4links = netw1Opt
.get()
.nonnullLink().values()
- .stream().filter(lk -> lk.getLinkId().getValue().startsWith("ODU4"))
+ .stream().filter(lk -> lk.getLinkId().getValue().startsWith("ODTU4"))
.collect(Collectors.toList());
}
List<Link> links = new ArrayList<>();
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.xpdr.tp.supported.interfaces.SupportedInterfaceCapabilityBuilder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.xpdr.tp.supported.interfaces.SupportedInterfaceCapabilityKey;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODTU4TsAllocated;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODTUCnTs;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU0;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU2;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU2e;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.ODU4;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OdtuTypeIdentity;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OduRateIdentity;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder;
public static TopologyShard createOtnLinks(String nodeA, String tpA, String nodeZ, String tpZ,
OtnLinkType linkType) {
List<Link> links = null;
- if (OtnLinkType.OTU4.equals(linkType)) {
- links = initialiseOtnLinks(nodeA, tpA, nodeZ, tpZ, linkType, "OTU4");
+ if (OtnLinkType.OTU4.equals(linkType) || OtnLinkType.OTUC4.equals(linkType)) {
+ links = initialiseOtnLinks(nodeA, tpA, nodeZ, tpZ, linkType);
}
return new TopologyShard(null, links);
}
- public static TopologyShard createOtnLinks(List<Link> suppOtu4Links, List<TerminationPoint> oldTps) {
+ public static TopologyShard createOtnLinks(List<Link> suppOtuLinks, List<TerminationPoint> oldTps,
+ OtnLinkType linkType) {
List<Link> links = new ArrayList<>();
- for (Link link : suppOtu4Links) {
- if (link.augmentation(Link1.class) != null
+ for (Link link : suppOtuLinks) {
+ if (OtnLinkType.ODTU4.equals(linkType) && link.augmentation(Link1.class) != null
&& link.augmentation(Link1.class).getAvailableBandwidth().equals(Uint32.valueOf(100000))) {
links.add(updateOtnLinkBwParameters(link, 0L, 100000L));
+ } else if (OtnLinkType.ODUC4.equals(linkType) && link.augmentation(Link1.class) != null
+ && link.augmentation(Link1.class).getAvailableBandwidth().equals(Uint32.valueOf(400000))) {
+ links.add(updateOtnLinkBwParameters(link, 0L, 400000L));
} else {
LOG.error("Error with otn parameters of supported link {}", link.getLinkId().getValue());
}
}
if (links.size() == 2) {
- links.addAll(initialiseOtnLinks(suppOtu4Links.get(0).getSource().getSourceNode().getValue(),
- suppOtu4Links.get(0).getSource().getSourceTp().toString(),
- suppOtu4Links.get(0).getDestination().getDestNode().getValue(),
- suppOtu4Links.get(0).getDestination().getDestTp().toString(),
- OtnLinkType.ODTU4, "ODU4"));
+ links.addAll(initialiseOtnLinks(suppOtuLinks.get(0).getSource().getSourceNode().getValue(),
+ suppOtuLinks.get(0).getSource().getSourceTp().toString(),
+ suppOtuLinks.get(0).getDestination().getDestNode().getValue(),
+ suppOtuLinks.get(0).getDestination().getDestTp().toString(),
+ linkType));
}
List<TerminationPoint> tps = new ArrayList<>();
for (TerminationPoint tp : oldTps) {
- tps.add(updateTp(tp, true));
+ tps.add(updateTp(tp, true, linkType));
}
if (links.size() == 4 && tps.size() == 2) {
return new TopologyShard(null, links, tps);
}
}
- public static TopologyShard updateOtnLinks(List<Link> suppOdu4Links, List<TerminationPoint> oldTps,
- Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion) {
+ public static TopologyShard updateOtnLinks(List<Link> suppOduLinks, List<TerminationPoint> oldTps,
+ Uint32 serviceRate, Short tribPortNb, Short minTribSlotNb, Short maxTribSlotNb, boolean isDeletion) {
List<Link> links = new ArrayList<>();
- Long bwIncr = 10000L;
- if (serviceRate.intValue() == 1) {
- bwIncr = 1000L;
+ Long bwIncr;
+ switch (serviceRate.intValue()) {
+ case 1:
+ bwIncr = 1000L;
+ break;
+ case 10:
+ bwIncr = 10000L;
+ break;
+ case 100:
+ bwIncr = 100000L;
+ break;
+ default:
+ LOG.warn("Error with not managed service rate {}", serviceRate.toString());
+ return new TopologyShard(null, null, null);
}
- for (Link link : suppOdu4Links) {
+ for (Link link : suppOduLinks) {
if (link.augmentation(Link1.class) != null && link.augmentation(Link1.class).getAvailableBandwidth() != null
&& link.augmentation(Link1.class).getUsedBandwidth() != null) {
Uint32 avlBw = link.augmentation(Link1.class).getAvailableBandwidth();
List<TerminationPoint> tps = new ArrayList<>();
for (TerminationPoint tp : oldTps) {
if (bwIncr != 0) {
- tps.add(updateNodeTpTsPool(tp, serviceRate, tribPortNb, tribSoltNb, isDeletion));
+ tps.add(updateNodeTpTsPool(tp, serviceRate, tribPortNb, minTribSlotNb, maxTribSlotNb, isDeletion));
}
}
if (!links.isEmpty() && !tps.isEmpty()) {
}
}
- public static TopologyShard deleteOtnLinks(List<Link> suppOtu4Links, List<TerminationPoint> oldTps) {
+ public static TopologyShard deleteOtnLinks(List<Link> suppOtuLinks, List<TerminationPoint> oldTps,
+ OtnLinkType linkType) {
List<Link> links = new ArrayList<>();
- for (Link link : suppOtu4Links) {
- if (link.augmentation(Link1.class) != null) {
- links.add(updateOtnLinkBwParameters(link, 100000L, 0L));
+ OtnLinkType otnLinkType = null;
+ for (Link link : suppOtuLinks) {
+ if (link.augmentation(Link1.class) != null && link.augmentation(
+ org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1.class) != null) {
+ otnLinkType = link.augmentation(
+ org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1.class).getOtnLinkType();
+ if (OtnLinkType.OTU4.equals(otnLinkType)) {
+ links.add(updateOtnLinkBwParameters(link, 100000L, 0L));
+ } else if (OtnLinkType.OTUC4.equals(otnLinkType)) {
+ links.add(updateOtnLinkBwParameters(link, 400000L, 0L));
+ } else {
+ LOG.warn("Unexpected otn-link-type {} for link {}", otnLinkType, link.getLinkId());
+ }
} else {
LOG.error("Error with otn parameters of supported link {}", link.getLinkId().getValue());
+ return new TopologyShard(null, null, null);
}
}
List<TerminationPoint> tps = new ArrayList<>();
for (TerminationPoint tp : oldTps) {
- tps.add(updateTp(tp, false));
+ tps.add(updateTp(tp, false, linkType));
}
if (links.size() == 2 && tps.size() == 2) {
return new TopologyShard(null, links, tps);
}
private static List<Link> initialiseOtnLinks(String nodeA, String tpA, String nodeZ, String tpZ,
- OtnLinkType linkType, String linkIdPrefix) {
+ OtnLinkType linkType) {
List<Link> links = new ArrayList<>();
+ String nodeATopo = formatNodeName(nodeA, tpA);
+ String nodeZTopo = formatNodeName(nodeZ, tpZ);
org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1 tpceLink1
= new org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.Link1Builder()
.setOtnLinkType(linkType).build();
- Link1 otnLink1 = new Link1Builder()
- .setAvailableBandwidth(Uint32.valueOf(100000))
- .setUsedBandwidth(Uint32.valueOf(0))
- .build();
- // create link A-Z
- String nodeATopo;
- String nodeZTopo;
- if (nodeA.contains(XPDR) && nodeZ.contains(XPDR)) {
- nodeATopo = nodeA;
- nodeZTopo = nodeZ;
- } else {
- nodeATopo = nodeA + "-" + tpA.split("-")[0];
- nodeZTopo = nodeZ + "-" + tpZ.split("-")[0];
+ Link1Builder otnLink1Bldr = new Link1Builder()
+ .setUsedBandwidth(Uint32.valueOf(0));
+ switch (linkType) {
+ case OTU4:
+ case ODTU4:
+ otnLink1Bldr.setAvailableBandwidth(Uint32.valueOf(100000));
+ break;
+ case OTUC4:
+ case ODUC4:
+ otnLink1Bldr.setAvailableBandwidth(Uint32.valueOf(400000));
+ break;
+ default:
+ LOG.error("unable to set available bandwidth to unknown link type");
+ break;
}
- LinkBuilder ietfLinkAZBldr = TopologyUtils.createLink(nodeATopo, nodeZTopo, tpA, tpZ, linkIdPrefix);
+ // create link A-Z
+ LinkBuilder ietfLinkAZBldr = TopologyUtils.createLink(nodeATopo, nodeZTopo, tpA, tpZ, linkType.getName());
ietfLinkAZBldr
.addAugmentation(tpceLink1)
- .addAugmentation(otnLink1)
+ .addAugmentation(otnLink1Bldr.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1Builder(
ietfLinkAZBldr.augmentation(
.build());
links.add(ietfLinkAZBldr.build());
// create link Z-A
- LinkBuilder ietfLinkZABldr = TopologyUtils.createLink(nodeZTopo, nodeATopo, tpZ, tpA, linkIdPrefix);
+ LinkBuilder ietfLinkZABldr = TopologyUtils.createLink(nodeZTopo, nodeATopo, tpZ, tpA, linkType.getName());
ietfLinkZABldr
.addAugmentation(tpceLink1)
- .addAugmentation(otnLink1)
+ .addAugmentation(otnLink1Bldr.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1Builder(
ietfLinkZABldr.augmentation(
return updatedLinkBldr.build();
}
- private static TerminationPoint updateTp(TerminationPoint originalTp, boolean addingTsTpnPoolTermination) {
+ private static TerminationPoint updateTp(TerminationPoint originalTp, boolean addingTsTpnPoolTermination,
+ OtnLinkType linkType) {
LOG.debug("in updateTp");
TerminationPointBuilder tpBldr = new TerminationPointBuilder(originalTp);
TerminationPoint1Builder otnTp1Bldr = new TerminationPoint1Builder(
.getXpdrTpPortConnectionAttributes());
if (addingTsTpnPoolTermination) {
List<Uint16> tsPool = new ArrayList<>();
- for (int i = 0; i < NB_TRIB_SLOTS; i++) {
- tsPool.add(Uint16.valueOf(i + 1));
+ for (int i = 1; i <= NB_TRIB_SLOTS; i++) {
+ tsPool.add(Uint16.valueOf(i));
}
xtpcaBldr.setTsPool(tsPool);
List<Uint16> tpnPool = new ArrayList<>();
- for (int i = 1; i <= NB_TRIB_PORTS; i++) {
+ int nbTribPort = NB_TRIB_PORTS;
+ if (OtnLinkType.ODUC4.equals(linkType)) {
+ nbTribPort = 4;
+ }
+ for (int i = 1; i <= nbTribPort; i++) {
tpnPool.add(Uint16.valueOf(i));
}
OdtuTpnPool oduTpnPool = new OdtuTpnPoolBuilder().setOdtuType(ODTU4TsAllocated.class)
}
private static TerminationPoint updateNodeTpTsPool(TerminationPoint tp, Uint32 serviceRate, Short tribPortNb,
- Short tribSlotNb, boolean isDeletion) {
+ Short minTribSlotNb, Short maxTribSlotNb, boolean isDeletion) {
LOG.debug("in updateNodeTpTsPool");
TerminationPointBuilder tpBldr = new TerminationPointBuilder(tp);
@Nullable
XpdrTpPortConnectionAttributesBuilder xtpcaBldr = new XpdrTpPortConnectionAttributesBuilder(
tpBldr.augmentation(TerminationPoint1.class).getXpdrTpPortConnectionAttributes());
List<Uint16> tsPool = new ArrayList<>(xtpcaBldr.getTsPool());
- switch (serviceRate.intValue()) {
- case 1:
- if (isDeletion) {
- tsPool.add(Uint16.valueOf(tribSlotNb));
- } else {
- tsPool.remove(Uint16.valueOf(tribSlotNb));
- }
- break;
- case 10:
- if (isDeletion) {
- for (int i = 0; i < NB_TRIB_SLOT_PER_10GE; i++) {
- tsPool.add(Uint16.valueOf(tribSlotNb + i));
- }
- } else {
- for (int i = 0; i < NB_TRIB_SLOT_PER_10GE; i++) {
- tsPool.remove(Uint16.valueOf(tribSlotNb + i));
- }
- }
- break;
- default:
- LOG.error("error updating tpn and ts pool for tp {}", tp.getTpId().getValue());
- break;
+ if (isDeletion) {
+ for (int i = minTribSlotNb; i <= maxTribSlotNb; i++) {
+ tsPool.add(Uint16.valueOf(i));
+ }
+ } else {
+ for (int i = minTribSlotNb; i <= maxTribSlotNb; i++) {
+ tsPool.remove(Uint16.valueOf(i));
+ }
}
xtpcaBldr.setTsPool(tsPool);
List<Uint16> tpnPool;
} else {
tpnPool = new ArrayList<>();
}
- OdtuTpnPool odtuTpnPool = new OdtuTpnPoolBuilder().setOdtuType(ODTU4TsAllocated.class)
+ Class<? extends OdtuTypeIdentity> odtuType = null;
+ switch (serviceRate.intValue()) {
+ case 1:
+ case 10:
+ odtuType = ODTU4TsAllocated.class;
+ break;
+ case 100:
+ odtuType = ODTUCnTs.class;
+ break;
+ default:
+ LOG.warn("Unable to set the odtu-type");
+ break;
+ }
+ OdtuTpnPool odtuTpnPool = new OdtuTpnPoolBuilder().setOdtuType(odtuType)
.setTpnPool(tpnPool).build();
xtpcaBldr.setOdtuTpnPool(ImmutableMap.of(odtuTpnPool.key(),odtuTpnPool));
.addAugmentation(ocnTp);
return ietfTpBldr.build();
}
+
+ private static String formatNodeName(String nodeName, String tpName) {
+ String newNodeName = null;
+ if (nodeName.contains(XPDR)) {
+ newNodeName = nodeName;
+ } else {
+ newNodeName = new StringBuilder(nodeName).append("-").append(tpName.split("-")[0]).toString();
+ }
+ return newNodeName;
+ }
}
TopologyShard topoShard = OpenRoadmOtnTopology
.createOtnLinks(
NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(100000)),
- NetworkmodelTestUtil.createTpList(false));
+ NetworkmodelTestUtil.createTpList(false), OtnLinkType.ODTU4);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
sortedLinks.get(2).augmentation(Link1.class).getUsedBandwidth());
assertEquals(
- "ODU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
+ "ODTU4-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1",
sortedLinks.get(0).getLinkId().getValue());
assertEquals(
- "ODU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
+ "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
sortedLinks.get(1).getLinkId().getValue());
assertEquals("SPDRA-XPDR1", sortedLinks.get(0).getSource().getSourceNode().getValue());
assertEquals("SPDRZ-XPDR1", sortedLinks.get(0).getDestination().getDestNode().getValue());
.getLinkType());
assertEquals(
"opposite link must be present",
- "ODU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
+ "ODTU4-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1",
sortedLinks.get(0)
.augmentation(
org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1.class)
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
}
TopologyShard topoShard =
- OpenRoadmOtnTopology.createOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(false));
+ OpenRoadmOtnTopology.createOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(false),
+ OtnLinkType.OTU4);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
topoShard =
OpenRoadmOtnTopology.createOtnLinks(
NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(99000)),
- NetworkmodelTestUtil.createTpList(false));
+ NetworkmodelTestUtil.createTpList(false), OtnLinkType.OTU4);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
assertNull("list of tps should be null", topoShard.getTps());
TopologyShard topoShard =
OpenRoadmOtnTopology.deleteOtnLinks(
NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.OTU4, Uint32.valueOf(0)),
- NetworkmodelTestUtil.createTpList(true));
+ NetworkmodelTestUtil.createTpList(true), OtnLinkType.OTU4);
assertNotNull("TopologyShard should never be null", topoShard);
assertEquals("list of links should contain 2 links", 2, topoShard.getLinks().size());
assertEquals(
otu4LinksWithBadBWParam.add(new LinkBuilder(link).removeAugmentation(Link1.class).build());
}
TopologyShard topoShard =
- OpenRoadmOtnTopology.deleteOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(true));
+ OpenRoadmOtnTopology.deleteOtnLinks(otu4LinksWithBadBWParam, NetworkmodelTestUtil.createTpList(true),
+ OtnLinkType.OTU4);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
OpenRoadmOtnTopology.updateOtnLinks(
NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
NetworkmodelTestUtil.createTpList(true),
- Uint32.valueOf(10), (short)1, (short)1, false);
+ Uint32.valueOf(10), (short)1, (short)1, (short)8, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
- assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+ assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
assertEquals(
"after 10G creation, available BW of supported ODU4 should be 90000",
Uint32.valueOf(90000),
// tests update for 10G deletion
sortedLinks.clear();
topoShard = OpenRoadmOtnTopology.updateOtnLinks(topoShard.getLinks(), topoShard.getTps(), Uint32.valueOf(10),
- (short)1, (short)1, true);
+ (short)1, (short)1, (short)8, true);
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
- assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+ assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
assertEquals(
"after 10G deletion, available BW of supported ODU4 should be 100 000",
Uint32.valueOf(100000),
OpenRoadmOtnTopology.updateOtnLinks(
NetworkmodelTestUtil.createSuppOTNLinks(OtnLinkType.ODTU4, Uint32.valueOf(100000)),
NetworkmodelTestUtil.createTpList(true),
- Uint32.valueOf(1), (short)1, (short)1, false);
+ Uint32.valueOf(1), (short)1, (short)1, (short)1, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
List<Link> sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
- assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+ assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
assertEquals(
"after 1G creation, available BW of supported ODU4 should be 99000",
Uint32.valueOf(99000),
OpenRoadmOtnTopology.updateOtnLinks(
topoShard.getLinks(),
topoShard.getTps(),
- Uint32.valueOf(1), (short)1, (short)1, true);
+ Uint32.valueOf(1), (short)1, (short)1, (short)1, true);
sortedLinks = topoShard.getLinks().stream()
.sorted((l1, l2) -> l1.getLinkId().getValue().compareTo(l2.getLinkId().getValue()))
.collect(Collectors.toList());
assertEquals("list of links should contain 2 links", 2, sortedLinks.size());
- assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODU4-"));
+ assertTrue(sortedLinks.get(0).getLinkId().getValue().startsWith("ODTU4-"));
assertEquals(
"after 1G deletion, available BW of supported ODU4 should be 100 000",
Uint32.valueOf(100000),
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
- Uint32.valueOf(1), (short)1, (short)1, false);
+ Uint32.valueOf(1), (short)1, (short)1, (short)10, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
OpenRoadmOtnTopology.updateOtnLinks(
odu4LinksWithBadBWParam,
NetworkmodelTestUtil.createTpList(true),
- Uint32.valueOf(10), (short)1, (short)1, false);
+ Uint32.valueOf(10), (short)1, (short)1, (short)10, false);
assertNotNull("TopologyShard should never be null", topoShard);
assertNull("list of nodes should be null", topoShard.getNodes());
assertNull("list of links should be null", topoShard.getLinks());
}
public static List<Link> createSuppOTNLinks(OtnLinkType type, Uint32 availBW) {
- String prefix = null;
- if (OtnLinkType.OTU4.equals(type)) {
- prefix = "OTU4-";
- } else if (OtnLinkType.ODTU4.equals(type)) {
- prefix = "ODU4-";
- }
Link linkAZ = new LinkBuilder()
- .setLinkId(new LinkId(prefix + "SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
+ .setLinkId(new LinkId(type.getName() + "-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
.setSource(new SourceBuilder()
.setSourceNode(new NodeId("SPDRA-XPDR1"))
.setSourceTp("XPDR1-NETWORK1").build())
.addAugmentation(
new Link1Builder()
.setLinkType(OpenroadmLinkType.OTNLINK)
- .setOppositeLink(new LinkId(prefix + "SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
+ .setOppositeLink(new LinkId(type.getName()
+ + "-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder()
.build())
.build();
Link linkZA = new LinkBuilder()
- .setLinkId(new LinkId(prefix + "SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
+ .setLinkId(new LinkId(type.getName() + "-SPDRZ-XPDR1-XPDR1-NETWORK1toSPDRA-XPDR1-XPDR1-NETWORK1"))
.setSource(new SourceBuilder()
.setSourceNode(new NodeId("SPDRZ-XPDR1"))
.setSourceTp("XPDR1-NETWORK1").build())
.addAugmentation(
new Link1Builder()
.setLinkType(OpenroadmLinkType.OTNLINK)
- .setOppositeLink(new LinkId(prefix + "SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
+ .setOppositeLink(new LinkId(type.getName()
+ + "-SPDRA-XPDR1-XPDR1-NETWORK1toSPDRZ-XPDR1-XPDR1-NETWORK1"))
.build())
.addAugmentation(
new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Link1Builder()
private void onServiceDeleteResult(RendererRpcResultSp notification) {
switch (serviceRpcResultSp.getStatus()) {
case Successful:
- LOG.info("Service '{}' deleted !", notification.getServiceName());
String serviceType = notification.getServiceType();
switch (serviceType) {
case StringConstants.SERVICE_TYPE_1GE:
case StringConstants.SERVICE_TYPE_10GE:
case StringConstants.SERVICE_TYPE_100GE_M:
Short tribPort = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
- .split("\\.")[0]);
+ .split("\\.")[0]);
Short minTribSlot = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
- .split("\\.")[1]);
+ .split("\\.")[1]);
+ Short maxTribSlot = Short.valueOf(notification.getAToZDirection().getMaxTribSlot().getValue()
+ .split("\\.")[1]);
updateOtnTopology(notification.getLink(), true, notification.getServiceType(),
- notification.getAToZDirection().getRate(), tribPort, minTribSlot);
+ notification.getAToZDirection().getRate(), tribPort, minTribSlot, maxTribSlot);
break;
case StringConstants.SERVICE_TYPE_OTU4:
case StringConstants.SERVICE_TYPE_OTUC4:
case StringConstants.SERVICE_TYPE_ODU4:
case StringConstants.SERVICE_TYPE_ODUC4:
updateOtnTopology(notification.getLink(), true, notification.getServiceType(), null, null,
- null);
+ null, null);
break;
default:
break;
case StringConstants.SERVICE_TYPE_10GE:
case StringConstants.SERVICE_TYPE_100GE_M:
Short tribPort = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
- .split("\\.")[0]);
+ .split("\\.")[0]);
Short minTribSlot = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
- .split("\\.")[1]);
+ .split("\\.")[1]);
+ Short maxTribSlot = Short.valueOf(notification.getAToZDirection().getMaxTribSlot().getValue()
+ .split("\\.")[1]);
updateOtnTopology(notification.getLink(), false, notification.getServiceType(),
- notification.getAToZDirection().getRate(), tribPort, minTribSlot);
+ notification.getAToZDirection().getRate(), tribPort, minTribSlot, maxTribSlot);
break;
case StringConstants.SERVICE_TYPE_OTU4:
case StringConstants.SERVICE_TYPE_OTUC4:
case StringConstants.SERVICE_TYPE_ODU4:
case StringConstants.SERVICE_TYPE_ODUC4:
- updateOtnTopology(notification.getLink(), false, notification.getServiceType(), null, null, null);
+ updateOtnTopology(notification.getLink(), false, notification.getServiceType(), null, null, null, null);
break;
default:
break;
}
private void updateOtnTopology(Link link, boolean isDeletion, String serviceType, Uint32 rate, Short portNb,
- Short slotNb) {
+ Short minSlotNb, Short maxSlotNb) {
if (link == null) {
return;
}
case StringConstants.SERVICE_TYPE_10GE:
case StringConstants.SERVICE_TYPE_100GE_M:
LOG.info("updating otn-topology node tps -tps and tpn pools");
- this.networkModelService.updateOtnLinks(link, rate, portNb, slotNb, isDeletion);
+ this.networkModelService.updateOtnLinks(link, rate, portNb, minSlotNb, maxSlotNb, isDeletion);
break;
default:
break;
.setServerIntegrityProcessCharacteristic("server integrity process")
.setValidationMechanism(Map.of(validationMechanism.key(), validationMechanism))
.build();
- case "ODU4":
+ case "ODTU4":
sourceUuidTp = this.uuidMap.get(String.join("+", sourceNode, E_ODU, sourceTp));
sourceUuidNode = this.uuidMap.get(String.join("+", sourceNode, DSR));
NodeEdgePoint sourceNep2 = new NodeEdgePointBuilder()
.setValue(Uint64.valueOf(link.augmentation(Link1.class).getAvailableBandwidth())).build())
.build())
.build();
- case "ODU4":
+ case "ODTU4":
sourceUuidTp = this.uuidMap.get(String.join("+", sourceNode, DSR, sourceTp));
sourceUuidNode = this.uuidMap.get(String.join("+", sourceNode, DSR));
NodeEdgePoint sourceNep2 = new NodeEdgePointBuilder()
.networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
link = changeOtnLinkState(otnLinks.get(new LinkKey(
- new LinkId("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))), null, null);
+ new LinkId("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))), null, null);
otnLinksAlt.replace(link.key(), link);
ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid);
.networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
link = changeOtnLinkState(otnLinks.get(new LinkKey(
- new LinkId("ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))), null, null);
+ new LinkId("ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))), null, null);
otnLinksAlt.replace(link.key(), link);
ConvertORTopoToTapiTopo tapiFactory = new ConvertORTopoToTapiTopo(topologyUuid);
.networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
link = changeOtnLinkState(otnLinks.get(new LinkKey(
- new LinkId("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
+ new LinkId("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
AdminStates.OutOfService, State.OutOfService);
otnLinksAlt.replace(link.key(), link);
.networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
link = changeOtnLinkState(otnLinks.get(new LinkKey(
- new LinkId("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
+ new LinkId("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"))),
AdminStates.Maintenance, State.Degraded);
otnLinksAlt.replace(link.key(), link);
.networks.network.Link> otnLinksAlt = new HashMap<>(otnLinks);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.Link
link = changeOtnLinkState(otnLinks.get(new LinkKey(
- new LinkId("ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))),
+ new LinkId("ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1"))),
AdminStates.OutOfService, State.OutOfService);
otnLinksAlt.replace(link.key(), link);
Uuid tp4Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SC1-XPDR1+iOTSi+XPDR1-NETWORK1"
.getBytes(Charset.forName("UTF-8"))).toString());
Uuid link1Uuid =
- new Uuid(UUID.nameUUIDFromBytes("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"
+ new Uuid(UUID.nameUUIDFromBytes("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"
.getBytes(Charset.forName("UTF-8"))).toString());
Uuid link2Uuid =
new Uuid(UUID.nameUUIDFromBytes("OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"
.sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue()))
.collect(Collectors.toList());
checkOtnLink(links.get(0), node1Uuid, node2Uuid, tp1Uuid, tp2Uuid, link1Uuid,
- "ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
+ "ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
checkOtnLink(links.get(2), node3Uuid, node4Uuid, tp3Uuid, tp4Uuid, link2Uuid,
"OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
}
if ("OTU4".equals(prefix)) {
assertEquals("Available capacity -total size value should be 0",
Uint64.valueOf(0), link.getAvailableCapacity().getTotalSize().getValue());
- } else if ("ODU4".equals(prefix)) {
+ } else if ("ODTU4".equals(prefix)) {
assertEquals("Available capacity -total size value should be 100 000",
Uint64.valueOf(100000), link.getAvailableCapacity().getTotalSize().getValue());
}
if ("OTU4".equals(prefix)) {
assertEquals("otn link should be between 2 nodes of protocol layers PHOTONIC_MEDIA",
LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName());
- } else if ("ODU4".equals(prefix)) {
+ } else if ("ODTU4".equals(prefix)) {
assertEquals("otn link should be between 2 nodes of protocol layers ODU",
LayerProtocolName.ODU.getName(), link.getLayerProtocolName().get(0).getName());
}
Uuid tp4Uuid = new Uuid(UUID.nameUUIDFromBytes("SPDR-SC1-XPDR1+iOTSi+XPDR1-NETWORK1"
.getBytes(Charset.forName("UTF-8"))).toString());
Uuid link1Uuid =
- new Uuid(UUID.nameUUIDFromBytes("ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"
+ new Uuid(UUID.nameUUIDFromBytes("ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"
.getBytes(Charset.forName("UTF-8"))).toString());
Uuid link2Uuid =
new Uuid(UUID.nameUUIDFromBytes("OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1"
.sorted((l1, l2) -> l1.getUuid().getValue().compareTo(l2.getUuid().getValue()))
.collect(Collectors.toList());
checkOtnLink(links.get(0), topoUuid, node1Uuid, node2Uuid, tp1Uuid, tp2Uuid, link1Uuid,
- "ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
+ "ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
checkOtnLink(links.get(1), topoUuid, node3Uuid, node4Uuid, tp3Uuid, tp4Uuid, link2Uuid,
"OTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1");
}
if ("OTU4".equals(prefix)) {
assertEquals("Available capacity -total size value should be 0",
Uint64.valueOf(0), link.getAvailableCapacity().getTotalSize().getValue());
- } else if ("ODU4".equals(prefix)) {
+ } else if ("ODTU4".equals(prefix)) {
assertEquals("Available capacity -total size value should be 100 000",
Uint64.valueOf(100000), link.getAvailableCapacity().getTotalSize().getValue());
}
if ("OTU4".equals(prefix)) {
assertEquals("otn link should be between 2 nodes of protocol layers PHOTONIC_MEDIA",
LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName());
- } else if ("ODU4".equals(prefix)) {
+ } else if ("ODTU4".equals(prefix)) {
assertEquals("otn link should be between 2 nodes of protocol layers ODU",
LayerProtocolName.ODU.getName(), link.getLayerProtocolName().get(0).getName());
}
<otn-link-type xmlns="http://transportpce/topology">OTU4</otn-link-type>
</link>
<link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
- <link-id>ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</link-id>
+ <link-id>ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</link-id>
<source>
<source-node>SPDR-SC1-XPDR1</source-node>
<source-tp>XPDR1-NETWORK1</source-tp>
<used-bandwidth xmlns="http://org/openroadm/otn/network/topology">0</used-bandwidth>
<link-type xmlns="http://org/openroadm/common/network">OTN-LINK</link-type>
<operational-state xmlns="http://org/openroadm/common/network">inService</operational-state>
- <opposite-link xmlns="http://org/openroadm/common/network">ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</opposite-link>
+ <opposite-link xmlns="http://org/openroadm/common/network">ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</opposite-link>
<administrative-state xmlns="http://org/openroadm/common/network">inService</administrative-state>
<destination>
<dest-tp>XPDR1-NETWORK1</dest-tp>
<otn-link-type xmlns="http://transportpce/topology">ODTU4</otn-link-type>
</link>
<link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
- <link-id>ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</link-id>
+ <link-id>ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1</link-id>
<source>
<source-node>SPDR-SA1-XPDR1</source-node>
<source-tp>XPDR1-NETWORK1</source-tp>
<used-bandwidth xmlns="http://org/openroadm/otn/network/topology">0</used-bandwidth>
<link-type xmlns="http://org/openroadm/common/network">OTN-LINK</link-type>
<operational-state xmlns="http://org/openroadm/common/network">inService</operational-state>
- <opposite-link xmlns="http://org/openroadm/common/network">ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</opposite-link>
+ <opposite-link xmlns="http://org/openroadm/common/network">ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1</opposite-link>
<administrative-state xmlns="http://org/openroadm/common/network">inService</administrative-state>
<destination>
<dest-tp>XPDR1-NETWORK1</dest-tp>
link['org-openroadm-otn-network-topology:available-bandwidth'], 0)
self.assertEqual(
link['org-openroadm-otn-network-topology:used-bandwidth'], 100000)
- elif (linkId in ('ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
- 'ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1')):
+ elif (linkId in ('ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
+ 'ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1')):
self.assertEqual(
link['org-openroadm-otn-network-topology:available-bandwidth'], 100000)
self.assertEqual(
self.assertEqual(
link['org-openroadm-common-network:link-type'], 'OTN-LINK')
self.assertIn(link['org-openroadm-common-network:opposite-link'],
- ['ODU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
- 'ODU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1'])
+ ['ODTU4-SPDR-SA1-XPDR1-XPDR1-NETWORK1toSPDR-SC1-XPDR1-XPDR1-NETWORK1',
+ 'ODTU4-SPDR-SC1-XPDR1-XPDR1-NETWORK1toSPDR-SA1-XPDR1-XPDR1-NETWORK1'])
else:
self.fail("this link should not exist")