From 89593c27e1aee06510ae215c994a929868a080a2 Mon Sep 17 00:00:00 2001 From: Javier Errea Date: Mon, 2 Aug 2021 12:01:05 +0200 Subject: [PATCH] Update TAPI Topology Service on port change - PortMappingListener triggers TAPI topo update on port change - Update TAPI NEPs, SIPs & Links on port change JIRA: TRNSPRTPCE-466 Change-Id: I17d0b80a78a6154cd7bb1ceffd861e186c90a30a Signed-off-by: errea --- .../controllers/tpce/utils/TPCEUtils.java | 2 + .../tapi/TapiStringConstants.java | 6 + .../topology/ConvertORTopoToTapiFullTopo.java | 40 +- .../topology/TapiNetworkModelService.java | 13 + .../topology/TapiNetworkModelServiceImpl.java | 231 +++++-- .../topology/TapiPortMappingListener.java | 17 +- .../transportpce/tapi/utils/TapiLink.java | 10 +- .../yang/tapi-notification@2018-12-10.yang | 603 ++++++++++++++++++ 8 files changed, 843 insertions(+), 79 deletions(-) create mode 100644 tapimodels/src/main/yang/tapi-notification@2018-12-10.yang diff --git a/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java b/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java index 3a76d5274..eb5d0cb97 100644 --- a/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java +++ b/lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java @@ -304,6 +304,8 @@ public final class TPCEUtils { .getInstance(), org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.$YangModuleInfoImpl.getInstance(), org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.eth.rev181210.$YangModuleInfoImpl.getInstance(), + org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.notification.rev181210.$YangModuleInfoImpl + .getInstance(), // API models / opendaylight org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102 diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/TapiStringConstants.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/TapiStringConstants.java index 4db66c3d3..ffbb2d439 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/TapiStringConstants.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/TapiStringConstants.java @@ -35,7 +35,13 @@ public final class TapiStringConstants { public static final String LGX_PORT_NAME = "Some lgx-port-name"; public static final String PORT_TYPE = "some port type"; public static final String LGX_DEVICE_NAME = "Some lgx-device-name"; + // TODO: static values until they are implemented public static final String PORT_RACK_VALUE = "000000.00"; + public static final String FIXED_LATENCY_VALUE = "12345678"; + public static final String COST_HOP_VALUE = "12345678"; + public static final String JITTER_VALUE = "12345678"; + public static final String WANDER_VALUE = "12345678"; + public static final String QUEING_LATENCY_VALUE = "12345678"; private TapiStringConstants() { // hiding the default constructor diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java index 19f7362da..03a39fac6 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiFullTopo.java @@ -408,13 +408,13 @@ public class ConvertORTopoToTapiFullTopo { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); return new NodeBuilder() @@ -444,13 +444,13 @@ public class ConvertORTopoToTapiFullTopo { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); return new NodeBuilder() @@ -572,13 +572,13 @@ public class ConvertORTopoToTapiFullTopo { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder() @@ -712,13 +712,13 @@ public class ConvertORTopoToTapiFullTopo { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder() diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelService.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelService.java index 10559b7cc..255a9780b 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelService.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelService.java @@ -7,6 +7,7 @@ */ package org.opendaylight.transportpce.tapi.topology; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.Mapping; import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.Nodes; public interface TapiNetworkModelService { @@ -31,4 +32,16 @@ public interface TapiNetworkModelService { * */ void deleteTapinode(String nodeId); + + /** + * Update termination point, and if need, be associated links, of + * openroadm-topology and otn-topology after a change on a given mapping. + * + * @param nodeId + * unique node ID of OpenROADM node at the origin of the NETCONF + * notification change. + * @param mapping + * updated mapping following the device notification change. + */ + void updateTapiTopology(String nodeId, Mapping mapping); } diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java index c41b17b3d..a0c1a355d 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiNetworkModelServiceImpl.java @@ -7,14 +7,16 @@ */ package org.opendaylight.transportpce.tapi.topology; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.UUID; @@ -84,6 +86,7 @@ import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev181 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev181210.PHOTONICLAYERQUALIFIEROTSi; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.Context1; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.ForwardingRule; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.NodeEdgePointRef; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.RuleType; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.context.TopologyContext; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.NodeRuleGroup; @@ -104,6 +107,7 @@ import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.no import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.risk.parameter.pac.RiskCharacteristic; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.risk.parameter.pac.RiskCharacteristicBuilder; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Link; +import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.LinkBuilder; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.LinkKey; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node; import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.NodeBuilder; @@ -125,7 +129,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { private static final Logger LOG = LoggerFactory.getLogger(TapiNetworkModelServiceImpl.class); private final Uuid tapiTopoUuid = new Uuid(UUID.nameUUIDFromBytes(TapiStringConstants.T0_FULL_MULTILAYER - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); private final NetworkTransactionService networkTransactionService; private Map sipMap; private final R2RTapiLinkDiscovery linkDiscovery; @@ -227,13 +231,140 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { // Device not managed yet } + @Override + public void updateTapiTopology(String nodeId, Mapping mapping) { + List uuids = getChangedNodeUuids(nodeId, mapping); + + List changedOneps = updateNeps(mapping, uuids); + updateLinks(changedOneps, mapping); + + LOG.info("Updated TAPI topology successfully."); + } + + private void updateLinks(List changedOneps, Mapping mapping) { + try { + InstanceIdentifier topoIID = InstanceIdentifier.builder(Context.class) + .augmentation(Context1.class).child(TopologyContext.class) + .child(Topology.class, new TopologyKey(tapiTopoUuid)) + .build(); + Optional optTopology = this.networkTransactionService + .read(LogicalDatastoreType.OPERATIONAL, topoIID).get(); + if (optTopology.isEmpty()) { + LOG.error("Could not update TAPI links"); + return; + } + Map links = optTopology.get().getLink(); + if (links != null) { + for (Link link : links.values()) { + List linkNeps = Objects.requireNonNull(link.getNodeEdgePoint()).values().stream() + .map(NodeEdgePointRef::getNodeEdgePointUuid).collect(Collectors.toList()); + if (!Collections.disjoint(changedOneps, linkNeps)) { + InstanceIdentifier linkIID = InstanceIdentifier.builder(Context.class) + .augmentation(Context1.class).child(TopologyContext.class) + .child(Topology.class, new TopologyKey(tapiTopoUuid)) + .child(Link.class, new LinkKey(link.getUuid())).build(); + Link linkblr = new LinkBuilder().setUuid(link.getUuid()) + .setAdministrativeState(transformAdminState(mapping.getPortAdminState())) + .setOperationalState(transformOperState(mapping.getPortOperState())).build(); + this.networkTransactionService.merge(LogicalDatastoreType.OPERATIONAL, linkIID, linkblr); + } + } + } + this.networkTransactionService.commit().get(); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Could not update TAPI links"); + } + } + + private List updateNeps(Mapping mapping, List uuids) { + List changedOneps = new ArrayList<>(); + for (Uuid nodeUuid : uuids) { + try { + InstanceIdentifier nodeIID = InstanceIdentifier.builder(Context.class) + .augmentation(Context1.class).child(TopologyContext.class) + .child(Topology.class, new TopologyKey(tapiTopoUuid)).child(Node.class, new NodeKey(nodeUuid)) + .build(); + Optional optionalNode = this.networkTransactionService.read( + LogicalDatastoreType.OPERATIONAL, nodeIID).get(); + if (optionalNode.isPresent()) { + Node node = optionalNode.get(); + List oneps = node.getOwnedNodeEdgePoint().values().stream() + .filter(onep -> ((Name) onep.getName().values().toArray()[0]).getValue() + .contains(mapping.getLogicalConnectionPoint())).collect(Collectors.toList()); + for (OwnedNodeEdgePoint onep : oneps) { + changedOneps.add(onep.getUuid()); + updateSips(mapping, onep); + InstanceIdentifier onepIID = InstanceIdentifier.builder(Context.class) + .augmentation(Context1.class).child(TopologyContext.class) + .child(Topology.class, new TopologyKey(tapiTopoUuid)) + .child(Node.class, new NodeKey(nodeUuid)) + .child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(onep.getUuid())) + .build(); + OwnedNodeEdgePoint onepblr = new OwnedNodeEdgePointBuilder().setUuid(onep.getUuid()) + .setAdministrativeState(transformAdminState(mapping.getPortAdminState())) + .setOperationalState(transformOperState(mapping.getPortOperState())).build(); + this.networkTransactionService.merge(LogicalDatastoreType.OPERATIONAL, onepIID, onepblr); + } + this.networkTransactionService.commit().get(); + } + } catch (InterruptedException | ExecutionException e) { + LOG.error("Could not update TAPI NEP"); + } + } + return changedOneps; + } + + private List getChangedNodeUuids(String nodeId, Mapping mapping) { + List uuids = new ArrayList<>(); + if (nodeId.contains("ROADM")) { + uuids.add(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, TapiStringConstants.PHTNC_MEDIA)) + .getBytes(StandardCharsets.UTF_8)).toString())); + } else if (nodeId.contains("PDR") && mapping.getLogicalConnectionPoint().contains("CLIENT")) { + int xpdrNb = Integer.parseInt(mapping.getLogicalConnectionPoint().split("XPDR")[1].split("-")[0]); + String xpdrNodeId = nodeId + TapiStringConstants.XPDR + xpdrNb; + uuids.add(new Uuid(UUID.nameUUIDFromBytes((String.join("+", xpdrNodeId, TapiStringConstants.DSR)) + .getBytes(StandardCharsets.UTF_8)).toString())); + } else if (nodeId.contains("PDR") && mapping.getLogicalConnectionPoint().contains("NETWORK")) { + int xpdrNb = Integer.parseInt(mapping.getLogicalConnectionPoint().split("XPDR")[1].split("-")[0]); + String xpdrNodeId = nodeId + TapiStringConstants.XPDR + xpdrNb; + uuids.add(new Uuid(UUID.nameUUIDFromBytes((String.join("+", xpdrNodeId, TapiStringConstants.DSR)) + .getBytes(StandardCharsets.UTF_8)).toString())); + uuids.add(new Uuid(UUID.nameUUIDFromBytes((String.join("+", xpdrNodeId, TapiStringConstants.OTSI)) + .getBytes(StandardCharsets.UTF_8)).toString())); + } else { + LOG.error("Updating this device is currently not supported"); + return uuids; + } + return uuids; + } + + private void updateSips(Mapping mapping, OwnedNodeEdgePoint onep) { + if (onep.getMappedServiceInterfacePoint() == null + || onep.getMappedServiceInterfacePoint().size() == 0) { + return; + } + for (MappedServiceInterfacePoint msip : onep.getMappedServiceInterfacePoint().values()) { + InstanceIdentifier sipIID = InstanceIdentifier + .builder(Context.class) + .child(ServiceInterfacePoint.class, + new ServiceInterfacePointKey(msip.getServiceInterfacePointUuid())) + .build(); + ServiceInterfacePoint sipblr = new ServiceInterfacePointBuilder() + .setUuid(msip.getServiceInterfacePointUuid()) + .setAdministrativeState(transformAdminState(mapping.getPortAdminState())) + .setOperationalState(transformOperState(mapping.getPortOperState())).build(); + this.networkTransactionService.merge(LogicalDatastoreType.OPERATIONAL, sipIID, sipblr); + } + + } + private Map transformXpdrToTapiNode(String nodeId, List xpdrClMaps, List xpdrNetMaps, XpdrNodeTypes xponderType, OduSwitchingPools oorOduSwitchingPool) { Map nodeMap = new HashMap<>(); LOG.info("creation of a DSR/ODU node for {}", nodeId); Uuid nodeUuidDsr = new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, TapiStringConstants.DSR)) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); Name nameDsr = new NameBuilder().setValueName("dsr/odu node name").setValue( String.join("+", nodeId, TapiStringConstants.DSR)).build(); Name nameNodeType = new NameBuilder().setValueName("Node Type") @@ -247,7 +378,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { // node creation [otsi] LOG.info("creation of an OTSi node for {}", nodeId); Uuid nodeUuidOtsi = new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, TapiStringConstants.OTSI)) - .getBytes(Charset.forName("UTF-8"))).toString()); + .getBytes(StandardCharsets.UTF_8)).toString()); Name nameOtsi = new NameBuilder().setValueName("otsi node name").setValue( String.join("+", nodeId, TapiStringConstants.OTSI)).build(); Set otsiLayerProtocols = Set.of(LayerProtocolName.PHOTONICMEDIA); @@ -258,8 +389,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { // transitional link cration between network nep of DSR/ODU node and iNep of otsi node LOG.info("creation of transitional links between DSR/ODU and OTSi nodes"); - Map linkMap = createTapiTransitionalLinks(nodeId, xpdrNetMaps, nodeUuidDsr, - nodeUuidOtsi); + Map linkMap = createTapiTransitionalLinks(nodeId, xpdrNetMaps); mergeLinkinTopology(linkMap); return nodeMap; @@ -368,7 +498,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { if (nodeId.contains("ROADM")) { // Node is in photonic media layer and UUID can be built from nodeId + PHTN_MEDIA Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, - TapiStringConstants.PHTNC_MEDIA)).getBytes(Charset.forName("UTF-8"))).toString()); + TapiStringConstants.PHTNC_MEDIA)).getBytes(StandardCharsets.UTF_8)).toString()); deleteNodeFromTopo(nodeUuid); } if (nodeId.contains("XPDR") || nodeId.contains("SPDR") || nodeId.contains("MXPDR")) { @@ -451,13 +581,13 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); return new NodeBuilder() @@ -488,7 +618,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { for (int i = 0; i < xpdrNetMaps.size(); i++) { Uuid nepUuid1 = new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, TapiStringConstants.I_OTSI, - xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()); + xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(StandardCharsets.UTF_8)).toString()); Name onedName = new NameBuilder() .setValueName("iNodeEdgePoint") .setValue(String.join("+", nodeId, TapiStringConstants.I_OTSI, @@ -509,7 +639,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { for (int i = 0; i < xpdrNetMaps.size(); i++) { Uuid nepUuid2 = new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, TapiStringConstants.E_OTSI, - xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()); + xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(StandardCharsets.UTF_8)).toString()); Name onedName = new NameBuilder() .setValueName("eNodeEdgePoint") .setValue(String.join("+", nodeId, TapiStringConstants.E_OTSI, @@ -530,7 +660,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { for (int i = 0; i < xpdrNetMaps.size(); i++) { Uuid nepUuid3 = new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, TapiStringConstants.PHTNC_MEDIA, - xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()); + xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(StandardCharsets.UTF_8)).toString()); Name onedName = new NameBuilder() .setValueName("PhotMedNodeEdgePoint") .setValue(String.join("+", nodeId, TapiStringConstants.PHTNC_MEDIA, @@ -560,7 +690,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { xpdrClMaps.get(i).getLogicalConnectionPoint())); Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, TapiStringConstants.DSR, - xpdrClMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()); + xpdrClMaps.get(i).getLogicalConnectionPoint())).getBytes(StandardCharsets.UTF_8)).toString()); NameBuilder nameBldr = new NameBuilder().setValue(String.join("+", nodeId, TapiStringConstants.DSR, xpdrClMaps.get(i).getLogicalConnectionPoint())); Name name; @@ -586,7 +716,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { xpdrNetMaps.get(i).getLogicalConnectionPoint())); Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, TapiStringConstants.I_ODU, - xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()); + xpdrNetMaps.get(i).getLogicalConnectionPoint())).getBytes(StandardCharsets.UTF_8)).toString()); Name onedName = new NameBuilder() .setValueName("iNodeEdgePoint_N") .setValue(String.join("+", nodeId, TapiStringConstants.I_ODU, @@ -610,7 +740,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { xpdrClMaps.get(i).getLogicalConnectionPoint())); Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, TapiStringConstants.E_ODU, - xpdrClMaps.get(i).getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString()); + xpdrClMaps.get(i).getLogicalConnectionPoint())).getBytes(StandardCharsets.UTF_8)).toString()); Name onedName = new NameBuilder() .setValueName("eNodeEdgePoint_N") .setValue(String.join("+", nodeId, TapiStringConstants.E_ODU, @@ -671,7 +801,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { Map onepMap = new HashMap<>(); // PHOTONIC MEDIA nep Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", orNodeId, - TapiStringConstants.PHTNC_MEDIA, tpId)).getBytes(Charset.forName("UTF-8"))).toString()); + TapiStringConstants.PHTNC_MEDIA, tpId)).getBytes(StandardCharsets.UTF_8)).toString()); Name nepName = new NameBuilder() .setValueName(TapiStringConstants.PHTNC_MEDIA + "NodeEdgePoint") .setValue(String.join("+", orNodeId, TapiStringConstants.PHTNC_MEDIA, tpId)) @@ -690,7 +820,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { // MC nep Uuid nepUuid1 = new Uuid(UUID.nameUUIDFromBytes((String.join("+", orNodeId, - TapiStringConstants.MC, tpId)).getBytes(Charset.forName("UTF-8"))).toString()); + TapiStringConstants.MC, tpId)).getBytes(StandardCharsets.UTF_8)).toString()); Name nepName1 = new NameBuilder() .setValueName(TapiStringConstants.MC + "NodeEdgePoint") .setValue(String.join("+", orNodeId, TapiStringConstants.MC, tpId)) @@ -714,7 +844,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { // OTSiMC nep Uuid nepUuid2 = new Uuid(UUID.nameUUIDFromBytes((String.join("+", orNodeId, TapiStringConstants.OTSI_MC, - tpId)).getBytes(Charset.forName("UTF-8"))).toString()); + tpId)).getBytes(StandardCharsets.UTF_8)).toString()); Name nepName2 = new NameBuilder() .setValueName(TapiStringConstants.OTSI_MC + "NodeEdgePoint") .setValue(String.join("+", orNodeId, TapiStringConstants.OTSI_MC, tpId)) @@ -741,7 +871,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { Map msipl = new HashMap<>(); for (int i = 0; i < nb; i++) { Uuid sipUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", "SIP", nodeid, - tpid)).getBytes(Charset.forName("UTF-8"))).toString()); + tpid)).getBytes(StandardCharsets.UTF_8)).toString()); MappedServiceInterfacePoint msip = new MappedServiceInterfacePointBuilder() .setServiceInterfacePointUuid(sipUuid).build(); ServiceInterfacePoint sip = createSIP(sipUuid, layerProtocol, tpid, nodeid, supportedInterfaceCapability, @@ -780,7 +910,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { private Node createRoadmTapiNode(String orNodeId, Map oneplist) { // UUID Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", orNodeId, - TapiStringConstants.PHTNC_MEDIA)).getBytes(Charset.forName("UTF-8"))).toString()); + TapiStringConstants.PHTNC_MEDIA)).getBytes(StandardCharsets.UTF_8)).toString()); // Names Name nodeNames = new NameBuilder().setValueName("roadm node name") .setValue(String.join("+", orNodeId, TapiStringConstants.PHTNC_MEDIA)).build(); @@ -792,13 +922,13 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.COST_HOP_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); return new NodeBuilder() @@ -843,7 +973,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { ruleList.put(rule.key(), rule); NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder() .setUuid(new Uuid(UUID.nameUUIDFromBytes((orNodeId + " node rule group") - .getBytes(Charset.forName("UTF-8"))).toString())) + .getBytes(StandardCharsets.UTF_8)).toString())) .setRule(ruleList) .setNodeEdgePoint(nepMap) .build(); @@ -851,8 +981,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { return nodeRuleGroupMap; } - private Map createTapiTransitionalLinks(String nodeId, List xpdrNetMaps, Uuid nodeUuidDsr, - Uuid nodeUuidOtsi) { + private Map createTapiTransitionalLinks(String nodeId, List xpdrNetMaps) { Map linkMap = new HashMap<>(); for (Mapping mapping : xpdrNetMaps) { Link transiLink = tapiLink.createTapiLink(nodeId, mapping.getLogicalConnectionPoint(), nodeId, @@ -951,18 +1080,18 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { NodeEdgePoint inep = new NodeEdgePointBuilder() .setTopologyUuid(this.tapiTopoUuid) .setNodeUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, - TapiStringConstants.OTSI)).getBytes(Charset.forName("UTF-8"))).toString())) + TapiStringConstants.OTSI)).getBytes(StandardCharsets.UTF_8)).toString())) .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, TapiStringConstants.I_OTSI, tpMapping.getLogicalConnectionPoint())) - .getBytes(Charset.forName("UTF-8"))).toString())) + .getBytes(StandardCharsets.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())) + TapiStringConstants.OTSI)).getBytes(StandardCharsets.UTF_8)).toString())) .setNodeEdgePointUuid(new Uuid(UUID.nameUUIDFromBytes( (String.join("+", nodeId, TapiStringConstants.E_OTSI, - tpMapping.getLogicalConnectionPoint())).getBytes(Charset.forName("UTF-8"))).toString())) + tpMapping.getLogicalConnectionPoint())).getBytes(StandardCharsets.UTF_8)).toString())) .build(); nepList.put(inep.key(), inep); nepList.put(enep.key(), enep); @@ -970,13 +1099,13 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder() @@ -985,7 +1114,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { .build(); NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder() .setUuid(new Uuid( - UUID.nameUUIDFromBytes(("otsi node rule group " + count).getBytes(Charset.forName("UTF-8"))) + UUID.nameUUIDFromBytes(("otsi node rule group " + count).getBytes(StandardCharsets.UTF_8)) .toString())) .setRule(ruleList) .setNodeEdgePoint(nepList) @@ -1019,23 +1148,23 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { LOG.info("EDOU TP = {}", String.join("+", nodeId, TapiStringConstants.E_ODU, tp.getValue())); LOG.info("DSR TP = {}", String.join("+", nodeId, TapiStringConstants.DSR, tp.getValue())); Uuid tpUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, - TapiStringConstants.E_ODU, tp.getValue())).getBytes(Charset.forName("UTF-8"))).toString()); + TapiStringConstants.E_ODU, tp.getValue())).getBytes(StandardCharsets.UTF_8)).toString()); Uuid tp1Uuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", nodeId, - TapiStringConstants.DSR, tp.getValue())).getBytes(Charset.forName("UTF-8"))).toString()); + TapiStringConstants.DSR, tp.getValue())).getBytes(StandardCharsets.UTF_8)).toString()); if (onepl.containsKey(new OwnedNodeEdgePointKey(tpUuid)) && 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())) + .getBytes(StandardCharsets.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())) + .getBytes(StandardCharsets.UTF_8)).toString())) .setNodeEdgePointUuid(tpUuid) .build(); nepList.put(nep1.key(), nep1); @@ -1046,13 +1175,13 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder() @@ -1061,7 +1190,7 @@ public class TapiNetworkModelServiceImpl implements TapiNetworkModelService { .build(); NodeRuleGroup nodeRuleGroup = new NodeRuleGroupBuilder() .setUuid(new Uuid( - UUID.nameUUIDFromBytes(("dsr node rule group " + count).getBytes(Charset.forName("UTF-8"))) + UUID.nameUUIDFromBytes(("dsr node rule group " + count).getBytes(StandardCharsets.UTF_8)) .toString())) .setRule(ruleList) .setNodeEdgePoint(nepList) diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiPortMappingListener.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiPortMappingListener.java index e7668c007..1e2e7ce4d 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiPortMappingListener.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/TapiPortMappingListener.java @@ -43,15 +43,26 @@ public class TapiPortMappingListener implements DataTreeChangeListener { Map mappingBef = nodesBef.getMapping(); LOG.info("Change in node {} with OR version = {}", nodeId, nodesAft.getNodeInfo().getOpenroadmVersion().getName()); - if (mappingAft != null && mappingBef == null) { + if (mappingAft == null) { + LOG.warn("Mapping already existed in the datastore, which means that node {} already existed " + + "in TAPI topology. The action to take will be different", nodeId); + continue; + } + if (mappingBef == null) { LOG.info("New mapping for node {} = {}", nodeId, mappingAft); LOG.info("As the mapping is now created for the first time, " + "we can proceed with the creation of the node {} in the TAPI topology", nodeId); this.tapiNetworkModelService.createTapiNode(nodeId, nodesAft.getNodeInfo().getOpenroadmVersion().getIntValue(), nodesAft); } else { - LOG.warn("Mapping already existed in the datastore, which means that node {} already existed " - + "in TAPI topology. The action to take will be different", nodeId); + for (Map.Entry entry : mappingAft.entrySet()) { + Mapping oldMapping = mappingBef.get(entry.getKey()); + Mapping newMapping = mappingAft.get(entry.getKey()); + if (!oldMapping.getPortAdminState().equals(newMapping.getPortAdminState()) + || !oldMapping.getPortOperState().equals(newMapping.getPortOperState())) { + this.tapiNetworkModelService.updateTapiTopology(nodeId, entry.getValue()); + } + } } } } diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiLink.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiLink.java index 6bdb19145..4d11a2c97 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiLink.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/utils/TapiLink.java @@ -132,13 +132,13 @@ public class TapiLink { CostCharacteristic costCharacteristic = new CostCharacteristicBuilder() .setCostAlgorithm("Restricted Shortest Path - RSP") .setCostName("HOP_COUNT") - .setCostValue("12345678") + .setCostValue(TapiStringConstants.COST_HOP_VALUE) .build(); LatencyCharacteristic latencyCharacteristic = new LatencyCharacteristicBuilder() - .setFixedLatencyCharacteristic("12345678") - .setQueingLatencyCharacteristic("12345678") - .setJitterCharacteristic("12345678") - .setWanderCharacteristic("12345678") + .setFixedLatencyCharacteristic(TapiStringConstants.FIXED_LATENCY_VALUE) + .setQueingLatencyCharacteristic(TapiStringConstants.QUEING_LATENCY_VALUE) + .setJitterCharacteristic(TapiStringConstants.JITTER_VALUE) + .setWanderCharacteristic(TapiStringConstants.WANDER_VALUE) .setTrafficPropertyName("FIXED_LATENCY") .build(); RiskCharacteristic riskCharacteristic = new RiskCharacteristicBuilder() diff --git a/tapimodels/src/main/yang/tapi-notification@2018-12-10.yang b/tapimodels/src/main/yang/tapi-notification@2018-12-10.yang new file mode 100644 index 000000000..2cab3d531 --- /dev/null +++ b/tapimodels/src/main/yang/tapi-notification@2018-12-10.yang @@ -0,0 +1,603 @@ +module tapi-notification { + namespace "urn:onf:otcc:yang:tapi-notification"; + prefix tapi-notification; + import tapi-common { + prefix tapi-common; + } + organization "ONF OTCC (Open Transport Configuration & Control) Project"; + contact " + Project Web: + Project List: + Editor: Karthik Sethuraman + "; + description " + This module contains TAPI Notification Model definitions. + Source: TapiNotification.uml + - The TAPI YANG models included in this TAPI release are a *normative* part of the TAPI SDK. + - The YANG specifications have been generated from the corresponding UML model using the [ONF EAGLE UML2YANG mapping tool] + + and further edited manually to comply with the [ONF IISOMI UML2YANG mapping guidelines] + + - Status of YANG model artifacts can be determined by referring to the corresponding UML artifacts. + As described in the UML models, some artifacts are considered *experimental*, and thus the corresponding YANG artifacts. + - The ONF TAPI release process does not guarantee backward compatibility of YANG models across major versions of TAPI releases. + The YANG model backward compatibility criteria are outlined in section 11 of . + YANG models included in this release may not be backward compatible with previous TAPI releases. + Copyright (c) 2018 Open Networking Foundation (ONF). All rights reserved. + License: This module is distributed under the Apache License 2.0"; + revision 2018-12-10 { + description "ONF Transport API version 2.1.1. + Changes included in this TAPI release (v2.1.1) are listed in + "; + reference "ONF-TR-527, ONF-TR-512, ONF-TR-531, RFC 7950, RFC 6087 and ONF TAPI UML model + "; + } + revision 2018-10-16 { + description "ONF Transport API version 2.1.0. + Changes included in this TAPI release (v2.1.0) are listed in + "; + reference "ONF-TR-527, ONF-TR-512, ONF-TR-531, RFC 7950, RFC 6087 and ONF TAPI UML model + "; + } + revision 2018-03-07 { + description "ONF Transport API version 2.0.2 + This YANG module has been generated from the TAPI UML Model using the IISOMI-Eagle xmi2yang mapping tool. + Changes in this revision: "; + reference "ONF-TR-527, ONF-TR-512, ONF-TR-531, RFC 6020, RFC 6087 and ONF TAPI UML model + "; + } + revision 2018-02-16 { + description "ONF Transport API version 2.0.1 + This YANG module has been generated from the TAPI UML Model using the IISOMI-Eagle xmi2yang mapping tool. + Changes in this revision: "; + reference "ONF-TR-527, ONF-TR-512, ONF-TR-531, RFC 6020, RFC 6087 and ONF TAPI UML model + "; + } + revision 2018-01-02 { + description "ONF Transport API version 2.0.0 + This YANG module has been generated from the TAPI UML Model using the IISOMI-Eagle xmi2yang mapping tool. + Changes in this revision: "; + reference "ONF-TR-527, ONF-TR-512, ONF-TR-531, RFC 6020, RFC 6087 and ONF TAPI UML model + "; + } + augment "/tapi-common:context" { + container notification-context { + uses notification-context; + description "Augments the base TAPI Context with NotificationService information"; + } + description "Augments the base TAPI Context with NotificationService information"; + } + + /************************** + * package object-classes + **************************/ + grouping notification-subscription-service { + list notification { + key 'uuid'; + config false; + uses notification; + description "none"; + } + container notification-channel { + uses notification-channel; + description "none"; + } + container subscription-filter { + uses subscription-filter; + description "none"; + } + leaf subscription-state { + type subscription-state; + description "none"; + } + leaf-list supported-notification-types { + type notification-type; + config false; + min-elements 1; + description "none"; + } + leaf-list supported-object-types { + type object-type; + config false; + min-elements 1; + description "none"; + } + uses tapi-common:service-spec; + description "none"; + } + grouping subscription-filter { + leaf-list requested-notification-types { + type notification-type; + config false; + description "none"; + } + leaf-list requested-object-types { + type object-type; + config false; + description "none"; + } + leaf-list requested-layer-protocols { + type tapi-common:layer-protocol-name; + config false; + description "none"; + } + leaf-list requested-object-identifier { + type tapi-common:uuid; + config false; + description "none"; + } + leaf include-content { + type boolean; + config false; + description "Indicates whether the published Notification includes content or just the Notification Id (which enables retrieval of the notification at the later stage)"; + } + uses tapi-common:local-class; + description "none"; + } + notification notification { + uses notification; + description "none"; + } + grouping notification { + leaf notification-type { + type notification-type; + description "none"; + } + leaf target-object-type { + type object-type; + description "none"; + } + leaf target-object-identifier { + type tapi-common:uuid; + description "none"; + } + list target-object-name { + key 'value-name'; + min-elements 1; + uses tapi-common:name-and-value; + description "none"; + } + leaf event-time-stamp { + type tapi-common:date-and-time; + description "none"; + } + leaf sequence-number { + type uint64; + config false; + description "A monotonous increasing sequence number associated with the notification. + The exact semantics of how this sequence number is assigned (per channel or subscription or source or system) is left undefined."; + } + leaf source-indicator { + type source-indicator; + description "none"; + } + leaf layer-protocol-name { + type tapi-common:layer-protocol-name; + description "none"; + } + list changed-attributes { + key 'value-name'; + uses name-and-value-change; + description "none"; + } + list additional-info { + key 'value-name'; + uses tapi-common:name-and-value; + description "none"; + } + leaf additional-text { + type string; + description "none"; + } + container tca-info { + uses tca-info; + description "none"; + } + container alarm-info { + uses alarm-info; + description "none"; + } + uses tapi-common:resource-spec; + description "none"; + } + grouping notification-channel { + leaf stream-address { + type string; + config false; + description "The address/location/URI of the channel/stream to which the subscribed notifications are published. + This specifics of this is typically dependent on the implementation protocol & mechanism and hence is typed as a string."; + } + leaf next-sequence-no { + type uint64; + config false; + description "The sequence number of the next notification that will be published on the channel"; + } + uses tapi-common:local-class; + description "none"; + } + grouping notification-context { + list notif-subscription { + key 'uuid'; + uses notification-subscription-service; + description "none"; + } + list notification { + key 'uuid'; + config false; + uses notification; + description "none"; + } + description "none"; + } + grouping alarm-info { + leaf is-transient { + type boolean; + config false; + description "none"; + } + leaf perceived-severity { + type perceived-severity-type; + config false; + description "none"; + } + leaf probable-cause { + type string; + config false; + description "none"; + } + leaf service-affecting { + type service-affecting; + description "none"; + } + description "none"; + } + grouping tca-info { + leaf is-transient { + type boolean; + config false; + description "none"; + } + leaf threshold-crossing { + type threshold-crossing-type; + description "none"; + } + leaf threshold-parameter { + type string; + config false; + description "none"; + } + leaf threshold-value { + type uint64; + config false; + description "none"; + } + leaf perceived-severity { + type perceived-tca-severity; + description "none"; + } + leaf measurement-interval { + type tapi-common:date-and-time; + description "none"; + } + leaf suspect-interval-flag { + type boolean; + description "none"; + } + description "none"; + } + + /************************** + * package type-definitions + **************************/ + grouping name-and-value-change { + leaf value-name { + type string; + description "The name of the value. The value need not have a name."; + } + leaf old-value { + type string; + description "The value"; + } + leaf new-value { + type string; + description "The value"; + } + description "A scoped name-value triple, including old value and new value"; + } + typedef notification-type { + type enumeration { + enum OBJECT_CREATION { + description "Not a normal state. The system is unable to determine the correct value."; + } + enum OBJECT_DELETION { + description "none"; + } + enum ATTRIBUTE_VALUE_CHANGE { + description "none"; + } + enum ALARM_EVENT { + description "none"; + } + enum THRESHOLD_CROSSING_ALERT { + description "none"; + } + } + description "List of supported Notifications types."; + } + typedef object-type { + type enumeration { + enum TOPOLOGY { + description "none"; + } + enum NODE { + description "none"; + } + enum LINK { + description "none"; + } + enum CONNECTION { + description "none"; + } + enum PATH { + description "none"; + } + enum CONNECTIVITY_SERVICE { + description "none"; + } + enum VIRTUAL_NETWORK_SERVICE { + description "none"; + } + enum PATH_COMPUTATION_SERVICE { + description "none"; + } + enum NODE_EDGE_POINT { + description "none"; + } + enum SERVICE_INTERFACE_POINT { + description "none"; + } + enum CONNECTION_END_POINT { + description "none"; + } + enum MAINTENANCE_ENTITY_GROUP { + description "none"; + } + enum MAINTENANCE_ENTITY { + description "none"; + } + enum MEG_END_POINT { + description "none"; + } + enum MEG_INTERMEDIATE_POINT { + description "none"; + } + enum SWITCH_CONTROL { + description "none"; + } + enum SWITCH { + description "none"; + } + enum ROUTE { + description "none"; + } + enum NODE_RULE_GROUP { + description "none"; + } + enum INTER_RULE_GROUP { + description "none"; + } + enum RULE { + description "none"; + } + enum OAM_JOB { + description "none"; + } + } + description "The list of TAPI Global Object Class types on which Notifications can be raised."; + } + typedef source-indicator { + type enumeration { + enum RESOURCE_OPERATION { + description "none"; + } + enum MANAGEMENT_OPERATION { + description "none"; + } + enum UNKNOWN { + description "none"; + } + } + description "none"; + } + typedef subscription-state { + type enumeration { + enum SUSPENDED { + description "none"; + } + enum ACTIVE { + description "none"; + } + } + description "none"; + } + typedef perceived-severity-type { + type enumeration { + enum CRITICAL { + description "none"; + } + enum MAJOR { + description "none"; + } + enum MINOR { + description "none"; + } + enum WARNING { + description "none"; + } + enum CLEARED { + description "none"; + } + } + description "none"; + } + typedef threshold-crossing-type { + type enumeration { + enum THRESHOLD_ABOVE { + description "none"; + } + enum THRESHOLD_BELOW { + description "none"; + } + enum CLEARED { + description "none"; + } + } + description "none"; + } + typedef service-affecting { + type enumeration { + enum SERVICE_AFFECTING { + description "none"; + } + enum NOT_SERVICE_AFFECTING { + description "none"; + } + enum UNKNOWN { + description "none"; + } + } + description "none"; + } + typedef perceived-tca-severity { + type enumeration { + enum WARNING { + description "none"; + } + enum CLEAR { + description "none"; + } + } + description "none"; + } + + /************************** + * package interfaces + **************************/ + rpc get-supported-notification-types { + description "none"; + output { + leaf-list supported-notification-types { + type notification-type; + min-elements 1; + description "none"; + } + leaf-list supported-object-types { + type object-type; + min-elements 1; + description "none"; + } + } + } + rpc create-notification-subscription-service { + description "none"; + input { + container subscription-filter { + uses subscription-filter; + description "none"; + } + leaf subscription-state { + type subscription-state; + description "none"; + } + } + output { + container subscription-service { + uses notification-subscription-service; + description "none"; + } + } + } + rpc update-notification-subscription-service { + description "none"; + input { + leaf subscription-id-or-name { + type string; + description "none"; + } + container subscription-filter { + uses subscription-filter; + description "none"; + } + leaf subscription-state { + type subscription-state; + description "none"; + } + } + output { + container subscription-service { + uses notification-subscription-service; + description "none"; + } + } + } + rpc delete-notification-subscription-service { + description "none"; + input { + leaf subscription-id-or-name { + type string; + description "none"; + } + } + output { + container subscription-service { + uses notification-subscription-service; + description "none"; + } + } + } + rpc get-notification-subscription-service-details { + description "none"; + input { + leaf subscription-id-or-name { + type string; + description "none"; + } + } + output { + container subscription-service { + uses notification-subscription-service; + description "none"; + } + } + } + rpc get-notification-subscription-service-list { + description "none"; + output { + list subscription-service { + key 'uuid'; + uses notification-subscription-service; + description "none"; + } + } + } + rpc get-notification-list { + description "none"; + input { + leaf subscription-id-or-name { + type string; + description "none"; + } + leaf time-period { + type string; + description "none"; + } + } + output { + list notification { + key 'uuid'; + uses notification; + description "none"; + } + } + } +} \ No newline at end of file -- 2.36.6