Sync Common folder 66/78166/7
authorDhruv Bhardwaj <db929a@att.com>
Mon, 26 Nov 2018 18:51:56 +0000 (13:51 -0500)
committerguillaume.lambert <guillaume.lambert@orange.com>
Thu, 7 Mar 2019 13:39:26 +0000 (14:39 +0100)
1. Updated transportpce-portmapping.yang to support device version
2. Added support for flex-grid (fixed mapping)
3. Network Transaction service
4. Cross Connect support for version 2.2
5. Interface support for version 2.2
6. Portmapping support for 2.2
7. Updated openroadm 1.2 yang models
8. Added openroadm 2.2 yang models

Change-Id: I1a5c1e2f93399c0cccb10f1db2d41b3052794dfd

118 files changed:
api/src/main/yang/transportpce-portmapping@2017-02-28.yang
common/src/main/java/org/opendaylight/transportpce/common/NetworkUtils.java
common/src/main/java/org/opendaylight/transportpce/common/StringConstants.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnect.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl.java
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl121.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl22.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexInterface.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtils.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtilsImpl.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingImpl.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion22.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionImpl.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionService.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/network/RequestProcessor.java [new file with mode: 0644]
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfaces.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl.java
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java [new file with mode: 0755]
common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl22.java [new file with mode: 0755]
common/src/main/resources/OSGI-INF/blueprint/common-blueprint.xml
common/src/test/java/org/opendaylight/transportpce/common/NetworkTransaction [new file with mode: 0644]
olm/src/test/java/org/opendaylight/transportpce/olm/OlmPowerServiceRpcImplTest.java
olm/src/test/java/org/opendaylight/transportpce/olm/OlmProviderTest.java
olm/src/test/java/org/opendaylight/transportpce/olm/power/PowerMgmtTest.java
olm/src/test/java/org/opendaylight/transportpce/olm/service/OlmPowerServiceImplTest.java
ordmodels/common/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev171215/PmDataTypeBuilder.java [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-alarm@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-alarm@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-common-types@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-common-types@2017-09-29.yang
ordmodels/common/src/main/yang/org-openroadm-common-types@2017-12-15.yang [moved from ordmodels/common/src/main/yang/org-openroadm-common-types@2017-06-26.yang with 83% similarity]
ordmodels/common/src/main/yang/org-openroadm-equipment-states-types@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-equipment-states-types@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-layerRate@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-layerRate@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-maintenance@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-maintenance@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-manifest-file@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-otn-common-types@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-otn-common-types@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-pm-types@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-pm-types@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-pm@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-pm@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-port-types@2017-09-29.yang
ordmodels/common/src/main/yang/org-openroadm-port-types@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-probable-cause@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-probable-cause@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-resource-types@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-resource-types@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-resource@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-resource@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-switching-pool-types@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-tca@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-tca@2017-12-15.yang [new file with mode: 0644]
ordmodels/common/src/main/yang/org-openroadm-user-mgmt@2016-10-14.yang
ordmodels/common/src/main/yang/org-openroadm-user-mgmt@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev171215/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-database@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-database@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-de-operations@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-de-operations@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-device-resource-types@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-device@2017-02-06.yang
ordmodels/device/src/main/yang/org-openroadm-device@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-ethernet-interfaces@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-ethernet-interfaces@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-file-transfer@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-file-transfer@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-fwdl@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-fwdl@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-interfaces2017-06-26.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-interfaces@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-lldp@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-lldp@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-maintenance-loopback@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-maintenance-loopback@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-maintenance-testsignal@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-maintenance-testsignal@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-media-channel-interfaces@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-network-media-channel-interfaces@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-optical-channel-interfaces@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-optical-channel-interfaces@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-optical-multiplex-interfaces@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-optical-transport-interfaces@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-optical-transport-interfaces@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-otn-common@2017-06-26.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-otn-odu-interfaces@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-otn-odu-interfaces@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-otn-otu-interfaces@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-otn-otu-interfaces@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-physical-types@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-physical-types@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-pluggable-optics-holder-capability@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-port-capability@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-prot-otn-linear-aps@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-rstp@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-rstp@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-swdl@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-swdl@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-syslog@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-syslog@2017-12-15.yang [new file with mode: 0644]
ordmodels/device/src/main/yang/org-openroadm-wavelength-map@2016-10-14.yang
ordmodels/device/src/main/yang/org-openroadm-wavelength-map@2017-12-15.yang [new file with mode: 0644]
ordmodels/network/src/main/yang/ietf-network-topology@2015-06-08.yang
ordmodels/network/src/main/yang/ietf-network@2015-06-08.yang
ordmodels/service/src/main/yang/org-openroadm-common-service-types@2016-10-14.yang
ordmodels/service/src/main/yang/org-openroadm-routing-constraints@2016-10-14.yang
ordmodels/service/src/main/yang/org-openroadm-service@2016-10-14.yang
ordmodels/service/src/main/yang/org-openroadm-topology@2016-10-14.yang
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplCreateOtsOmsTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplDeleteTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplRollbackTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImplSetupTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplDeleteTest.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImplTest.java

index 3e892da1995d89967908a08a9f9843387428e0b5..371f0f910097a178e94cf0c99b42c1e35cf37020 100644 (file)
@@ -29,6 +29,21 @@ module transportpce-portmapping {
         description
           "Unique identifier for node in the network";
       }
+
+      leaf openroadm-version{
+        type enumeration {
+          enum "1.2.1" {
+            value 1;
+            description
+              "Version 1.2.1";
+            }
+            enum "2.2" {
+              value 2;
+              description
+                "Version 2.2";
+            }
+          }
+        }
       leaf node-type{
         type org-openroadm-common-types:node-types;
         description
index ded1ce3f6d89dff32a0a37b084f231983db0694e..ef0751cdcba367f382f06ae467f068ed0c7ccb9d 100644 (file)
@@ -16,4 +16,9 @@ public final class NetworkUtils {
     public static final String UNDERLAY_NETWORK_ID = "openroadm-network";
     public static final String OVERLAY_NETWORK_ID = "openroadm-topology";
 
+    public enum Operation {
+        CREATE,
+        DELETE
+    }
+
 }
index 09f7753fb81a78ed0c4944e0e5435f872a483149..1fc3731ebb42d1c38a0190e8d4cdab671047e93c 100644 (file)
@@ -12,6 +12,12 @@ public final class StringConstants {
 
     public static final String OPENROADM_DEVICE_MODEL_NAME = "org-openroadm-device";
     public static final String DEFAULT_NETCONF_NODEID = "controller-config";
+    public static final String OPENROADM_DEVICE_VERSION_2_2 = "(http://org/openroadm/device?revision=2017-12-15)org-openroadm-device";
+    public static final String OPENROADM_DEVICE_VERSION_1_2_1 = "(http://org/openroadm/device?revision=2017-02-06)org-openroadm-device";
+    public static final String NETWORK_TOKEN = "XPDR1-NETWORK";
+    public static final String TTP_TOKEN = "TTP";
+    public static final String CLIENT_TOKEN = "XPDR1-CLIENT";
+    public static final String PP_TOKEN = "PP";
 
     private StringConstants() {
         // hiding the default constructor
index c0c6e8598ea1a989070519f15cfd1012b0c1b7cf..7531b13a70dc3f66093453123cef305e5191097e 100644 (file)
@@ -8,12 +8,10 @@
 
 package org.opendaylight.transportpce.common.crossconnect;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Optional;
-
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.get.connection.port.trail.output.Ports;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
 
 public interface CrossConnect {
 
@@ -28,7 +26,7 @@ public interface CrossConnect {
      *
      * @return Roadm connection subtree from the device.
      */
-    Optional<RoadmConnections> getCrossConnect(String deviceId, String connectionNumber);
+    <T> Optional<T> getCrossConnect(String deviceId, String connectionNumber);
 
     /**
      * This method does a post(edit-config) on roadm connection subtree for a
@@ -75,10 +73,25 @@ public interface CrossConnect {
      *            Destination logical connection point.
      *
      * @return list of Ports object type.
-     *
-     * @throws OpenRoadmInterfaceException
-     *            OpenRoadm Interface Exception.
      */
-    List<Ports> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
+    <T> List<T> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
             throws OpenRoadmInterfaceException;
+
+    /**
+     * This method does an edit-config on roadm connection subtree for a given
+     * connection number in order to set power level for use by the optical
+     * power control.
+     *
+     * @param deviceId
+     *            Device id.
+     * @param mode
+     *            Optical control modelcan be off, power or gainLoss.
+     * @param powerValue
+     *            Power value in DBm.
+     * @param connectionNumber
+     *            Name of the cross connect.
+     * @return true/false based on status of operation.
+     */
+    boolean setPowerLevel(String deviceId, Enum mode, BigDecimal powerValue,
+                          String connectionNumber);
 }
index b67f76c6fdbc3bd162bed1f1afe515a5e93f76ce..a52805b82ff8c5eecf1928357df7ce1b208795f7 100644 (file)
@@ -8,34 +8,16 @@
 
 package org.opendaylight.transportpce.common.crossconnect;
 
-import com.google.common.util.concurrent.ListenableFuture;
+import static org.opendaylight.transportpce.common.StringConstants.OPENROADM_DEVICE_VERSION_1_2_1;
+import static org.opendaylight.transportpce.common.StringConstants.OPENROADM_DEVICE_VERSION_2_2;
 
-import java.util.Collections;
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Optional;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-import org.opendaylight.controller.md.sal.binding.api.MountPoint;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.transportpce.common.Timeouts;
-import org.opendaylight.transportpce.common.device.DeviceTransaction;
+
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.OpticalControlMode;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.GetConnectionPortTrailInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.GetConnectionPortTrailOutput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OrgOpenroadmDeviceService;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.DestinationBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.SourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.get.connection.port.trail.output.Ports;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -44,145 +26,83 @@ public class CrossConnectImpl implements CrossConnect {
     private static final Logger LOG = LoggerFactory.getLogger(CrossConnectImpl.class);
 
     private final DeviceTransactionManager deviceTransactionManager;
-
-    public CrossConnectImpl(DeviceTransactionManager deviceTransactionManager) {
+    protected CrossConnect crossConnect;
+    private final MappingUtils mappingUtils;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
+
+    public CrossConnectImpl(DeviceTransactionManager deviceTransactionManager, MappingUtils mappingUtils,
+                            CrossConnectImpl121 crossConnectImpl121,
+                            CrossConnectImpl22 crossConnectImpl22) {
         this.deviceTransactionManager = deviceTransactionManager;
+        this.mappingUtils = mappingUtils;
+        this.crossConnectImpl121 = crossConnectImpl121;
+        this.crossConnectImpl22 = crossConnectImpl22;
+        this.crossConnect = null;
     }
 
-    @Override
-    public Optional<RoadmConnections> getCrossConnect(String deviceId, String connectionNumber) {
-        return deviceTransactionManager.getDataFromDevice(deviceId, LogicalDatastoreType.OPERATIONAL,
-                generateRdmConnectionIID(connectionNumber), Timeouts.DEVICE_READ_TIMEOUT,
-                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-    }
-
-    @Override
-    public Optional<String> postCrossConnect(String deviceId, Long waveNumber, String srcTp, String destTp) {
-        RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder();
-        String connectionNumber = generateConnectionNumber(srcTp, destTp, waveNumber);
-        rdmConnBldr.setConnectionNumber(connectionNumber);
-        rdmConnBldr.setWavelengthNumber(waveNumber);
-        rdmConnBldr.setOpticalControlMode(OpticalControlMode.Off);
-        rdmConnBldr.setSource(new SourceBuilder().setSrcIf(srcTp + "-" + waveNumber.toString()).build());
-        rdmConnBldr.setDestination(new DestinationBuilder().setDstIf(destTp + "-" + waveNumber.toString()).build());
-        InstanceIdentifier<RoadmConnections> rdmConnectionIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                .child(RoadmConnections.class, new RoadmConnectionsKey(rdmConnBldr.getConnectionNumber()));
-
-        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(deviceId);
-        DeviceTransaction deviceTx;
-        try {
-            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
-            if (deviceTxOpt.isPresent()) {
-                deviceTx = deviceTxOpt.get();
-            } else {
-                LOG.error("Device transaction for device {} was not found!", deviceId);
-                return Optional.empty();
-            }
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
-            return Optional.empty();
+    public Optional<?> getCrossConnect(String nodeId, String connectionNumber) {
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            return crossConnectImpl121.getCrossConnect(nodeId,connectionNumber);
         }
-
-        // post the cross connect on the device
-        deviceTx.put(LogicalDatastoreType.CONFIGURATION, rdmConnectionIID, rdmConnBldr.build());
-        ListenableFuture<Void> submit =
-                deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
-        try {
-            submit.get();
-            LOG.info("Roadm-connection successfully created: {}-{}-{}", srcTp, destTp, waveNumber);
-            return Optional.of(connectionNumber);
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Failed to post {}. Exception: {}", rdmConnBldr.build(), e);
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            return crossConnectImpl22.getCrossConnect(nodeId,connectionNumber);
         }
-        return Optional.empty();
+        return null;
     }
 
-    @Override
-    public boolean deleteCrossConnect(String deviceId, String connectionNumber) {
-        //Check if cross connect exists before delete
-        if (!getCrossConnect(deviceId, connectionNumber).isPresent()) {
-            LOG.warn("Cross connect does not exist, halting delete");
-            return false;
+
+    public Optional<String> postCrossConnect(String nodeId, Long waveNumber, String srcTp, String destTp) {
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        LOG.info("Cross Connect post request received for node {} with version {}",nodeId,openRoadmVersion);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            LOG.info("Device Version is 1.2.1");
+            return crossConnectImpl121.postCrossConnect(nodeId, waveNumber, srcTp, destTp);
         }
-        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(deviceId);
-        DeviceTransaction deviceTx;
-        try {
-            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
-            if (deviceTxOpt.isPresent()) {
-                deviceTx = deviceTxOpt.get();
-            } else {
-                LOG.error("Device transaction for device {} was not found!", deviceId);
-                return false;
-            }
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
-            return false;
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            LOG.info("Device Version is 2.2");
+            return crossConnectImpl22.postCrossConnect(nodeId, waveNumber, srcTp, destTp);
         }
+        LOG.info("Device Version not found");
+        return null;
+
+    }
+
 
-        // post the cross connect on the device
-        deviceTx.delete(LogicalDatastoreType.CONFIGURATION, generateRdmConnectionIID(connectionNumber));
-        ListenableFuture<Void> submit =
-                deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
-        try {
-            submit.get();
-            LOG.info("Roadm connection successfully deleted ");
-            return true;
-        } catch (InterruptedException | ExecutionException e) {
-            LOG.warn("Failed to delete {}", connectionNumber, e);
+    public boolean deleteCrossConnect(String nodeId, String connectionNumber) {
+
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            return crossConnectImpl121.deleteCrossConnect(nodeId, connectionNumber);
+        }
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            return crossConnectImpl22.deleteCrossConnect(nodeId, connectionNumber);
         }
         return false;
     }
 
-    @Override
-    public List<Ports> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
+    public List<?> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
             throws OpenRoadmInterfaceException {
-        String connectionName = generateConnectionNumber(srcTp, destTp, waveNumber);
-        Optional<MountPoint> mountPointOpt = deviceTransactionManager.getDeviceMountPoint(nodeId);
-        List<Ports> ports = null;
-        MountPoint mountPoint;
-        if (mountPointOpt.isPresent()) {
-            mountPoint = mountPointOpt.get();
-        } else {
-            LOG.error("Failed to obtain mount point for device {}!", nodeId);
-            return Collections.emptyList();
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            return crossConnectImpl121.getConnectionPortTrail(nodeId, waveNumber, srcTp, destTp);
         }
-        final Optional<RpcConsumerRegistry> service = mountPoint.getService(RpcConsumerRegistry.class).toJavaUtil();
-        if (!service.isPresent()) {
-            LOG.error("Failed to get RpcService for node {}", nodeId);
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            return crossConnectImpl22.getConnectionPortTrail(nodeId, waveNumber, srcTp, destTp);
         }
-        final OrgOpenroadmDeviceService rpcService = service.get().getRpcService(OrgOpenroadmDeviceService.class);
-        final GetConnectionPortTrailInputBuilder portTrainInputBuilder = new GetConnectionPortTrailInputBuilder();
-        portTrainInputBuilder.setConnectionNumber(connectionName);
-        final Future<RpcResult<GetConnectionPortTrailOutput>> portTrailOutput = rpcService.getConnectionPortTrail(
-            portTrainInputBuilder.build());
-        if (portTrailOutput != null) {
-            try {
-                RpcResult<GetConnectionPortTrailOutput> connectionPortTrailOutputRpcResult = portTrailOutput.get();
-                GetConnectionPortTrailOutput connectionPortTrailOutput = connectionPortTrailOutputRpcResult.getResult();
-                if (connectionPortTrailOutput == null) {
-                    throw new OpenRoadmInterfaceException(String.format("RPC get connection port trail called on"
-                            + " node %s returned null!", nodeId));
-                }
-                LOG.info("Getting port trail for node {}'s connection number {}", nodeId, connectionName);
-                ports = connectionPortTrailOutput.getPorts();
-                for (Ports port : ports) {
-                    LOG.info("{} - Circuit pack {} - Port {}", nodeId, port.getCircuitPackName(), port.getPortName());
-                }
-            } catch (InterruptedException | ExecutionException e) {
-                LOG.warn("Exception caught", e);
-            }
-        } else {
-            LOG.warn("Port trail is null in getConnectionPortTrail for nodeId {}", nodeId);
-        }
-        return ports != null ? ports : Collections.emptyList();
-    }
-
-    private InstanceIdentifier<RoadmConnections> generateRdmConnectionIID(String connectionNumber) {
-        return InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber));
+        return null;
     }
 
-    private String generateConnectionNumber(String srcTp, String destTp, Long waveNumber) {
-        return srcTp + "-" + destTp + "-" + waveNumber;
+    public boolean setPowerLevel(String nodeId, Enum mode, BigDecimal powerValue,
+                                 String connectionNumber) {
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            return crossConnectImpl121.setPowerLevel(nodeId,mode,powerValue,connectionNumber);
+        }
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            return crossConnectImpl22.setPowerLevel(nodeId,mode,powerValue,connectionNumber);
+        }
+        return false;
     }
 }
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl121.java b/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl121.java
new file mode 100644 (file)
index 0000000..a748389
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.common.crossconnect;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import java.math.BigDecimal;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.transportpce.common.Timeouts;
+import org.opendaylight.transportpce.common.device.DeviceTransaction;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.OpticalControlMode;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.PowerDBm;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.GetConnectionPortTrailInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.GetConnectionPortTrailOutput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OrgOpenroadmDeviceService;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.DestinationBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.SourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.get.connection.port.trail.output.Ports;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CrossConnectImpl121 {
+    private static final Logger LOG = LoggerFactory.getLogger(CrossConnectImpl121.class);
+
+    private final DeviceTransactionManager deviceTransactionManager;
+
+    public CrossConnectImpl121(DeviceTransactionManager deviceTransactionManager) {
+        this.deviceTransactionManager = deviceTransactionManager;
+    }
+
+    public Optional<RoadmConnections> getCrossConnect(String deviceId, String connectionNumber) {
+        return deviceTransactionManager.getDataFromDevice(deviceId, LogicalDatastoreType.OPERATIONAL,
+                generateRdmConnectionIID(connectionNumber), Timeouts.DEVICE_READ_TIMEOUT,
+                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+    }
+
+    public Optional<String> postCrossConnect(String deviceId, Long waveNumber, String srcTp, String destTp) {
+        RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder();
+        String connectionNumber = generateConnectionNumber(srcTp, destTp, waveNumber);
+        rdmConnBldr.setConnectionNumber(connectionNumber);
+        rdmConnBldr.setWavelengthNumber(waveNumber);
+        rdmConnBldr.setOpticalControlMode(OpticalControlMode.Off);
+        rdmConnBldr.setSource(new SourceBuilder().setSrcIf(srcTp + "-" + waveNumber.toString()).build());
+        rdmConnBldr.setDestination(new DestinationBuilder().setDstIf(destTp + "-" + waveNumber.toString()).build());
+        InstanceIdentifier<RoadmConnections> rdmConnectionIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                .child(RoadmConnections.class, new RoadmConnectionsKey(rdmConnBldr.getConnectionNumber()));
+
+        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(deviceId);
+        DeviceTransaction deviceTx;
+        try {
+            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+            if (deviceTxOpt.isPresent()) {
+                deviceTx = deviceTxOpt.get();
+            } else {
+                LOG.error("Device transaction for device {} was not found!", deviceId);
+                return Optional.empty();
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
+            return Optional.empty();
+        }
+
+        // post the cross connect on the device
+        deviceTx.put(LogicalDatastoreType.CONFIGURATION, rdmConnectionIID, rdmConnBldr.build());
+        ListenableFuture<Void> submit =
+                deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+        try {
+            submit.get();
+            LOG.info("Roadm-connection successfully created: {}-{}-{}", srcTp, destTp, waveNumber);
+            return Optional.of(connectionNumber);
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.warn("Failed to post {}. Exception: {}", rdmConnBldr.build(), e);
+        }
+        return Optional.empty();
+    }
+
+    public boolean deleteCrossConnect(String deviceId, String connectionNumber) {
+        //Check if cross connect exists before delete
+        if (!getCrossConnect(deviceId, connectionNumber).isPresent()) {
+            LOG.warn("Cross connect does not exist, halting delete");
+            return false;
+        }
+        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(deviceId);
+        DeviceTransaction deviceTx;
+        try {
+            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+            if (deviceTxOpt.isPresent()) {
+                deviceTx = deviceTxOpt.get();
+            } else {
+                LOG.error("Device transaction for device {} was not found!", deviceId);
+                return false;
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
+            return false;
+        }
+
+        // post the cross connect on the device
+        deviceTx.delete(LogicalDatastoreType.CONFIGURATION, generateRdmConnectionIID(connectionNumber));
+        ListenableFuture<Void> submit =
+                deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+        try {
+            submit.get();
+            LOG.info("Roadm connection successfully deleted ");
+            return true;
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.warn("Failed to delete {}", connectionNumber, e);
+        }
+        return false;
+    }
+
+
+    public List<Ports> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
+            throws OpenRoadmInterfaceException {
+        String connectionName = generateConnectionNumber(srcTp, destTp, waveNumber);
+        Optional<MountPoint> mountPointOpt = deviceTransactionManager.getDeviceMountPoint(nodeId);
+        List<Ports> ports = null;
+        MountPoint mountPoint;
+        if (mountPointOpt.isPresent()) {
+            mountPoint = mountPointOpt.get();
+        } else {
+            LOG.error("Failed to obtain mount point for device {}!", nodeId);
+            return Collections.emptyList();
+        }
+        final Optional<RpcConsumerRegistry> service = mountPoint.getService(RpcConsumerRegistry.class).toJavaUtil();
+        if (!service.isPresent()) {
+            LOG.error("Failed to get RpcService for node {}", nodeId);
+        }
+        final OrgOpenroadmDeviceService rpcService = service.get().getRpcService(OrgOpenroadmDeviceService.class);
+        final GetConnectionPortTrailInputBuilder portTrainInputBuilder = new GetConnectionPortTrailInputBuilder();
+        portTrainInputBuilder.setConnectionNumber(connectionName);
+        final Future<RpcResult<GetConnectionPortTrailOutput>> portTrailOutput = rpcService.getConnectionPortTrail(
+                portTrainInputBuilder.build());
+        if (portTrailOutput != null) {
+            try {
+                RpcResult<GetConnectionPortTrailOutput> connectionPortTrailOutputRpcResult = portTrailOutput.get();
+                GetConnectionPortTrailOutput connectionPortTrailOutput = connectionPortTrailOutputRpcResult.getResult();
+                if (connectionPortTrailOutput == null) {
+                    throw new OpenRoadmInterfaceException(String.format("RPC get connection port trail called on"
+                            + " node %s returned null!", nodeId));
+                }
+                LOG.info("Getting port trail for node {}'s connection number {}", nodeId, connectionName);
+                ports = connectionPortTrailOutput.getPorts();
+                for (Ports port : ports) {
+                    LOG.info("{} - Circuit pack {} - Port {}", nodeId, port.getCircuitPackName(), port.getPortName());
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                LOG.warn("Exception caught", e);
+            }
+        } else {
+            LOG.warn("Port trail is null in getConnectionPortTrail for nodeId {}", nodeId);
+        }
+        return ports != null ? ports : Collections.emptyList();
+    }
+
+    private InstanceIdentifier<RoadmConnections> generateRdmConnectionIID(String connectionNumber) {
+        return InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber));
+    }
+
+    private String generateConnectionNumber(String srcTp, String destTp, Long waveNumber) {
+        return srcTp + "-" + destTp + "-" + waveNumber;
+    }
+
+    public boolean setPowerLevel(String deviceId, Enum mode, BigDecimal powerValue, String connectionNumber) {
+
+        Optional<RoadmConnections> rdmConnOpt = getCrossConnect(deviceId, connectionNumber);
+        if (rdmConnOpt.isPresent()) {
+            RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConnOpt.get());
+            rdmConnBldr.setOpticalControlMode(OpticalControlMode.class.cast(mode));
+            if (powerValue != null) {
+                rdmConnBldr.setTargetOutputPower(new PowerDBm(powerValue));
+            }
+            RoadmConnections newRdmConn = rdmConnBldr.build();
+
+            Future<Optional<DeviceTransaction>> deviceTxFuture =
+                    deviceTransactionManager.getDeviceTransaction(deviceId);
+            DeviceTransaction deviceTx;
+            try {
+                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+                if (deviceTxOpt.isPresent()) {
+                    deviceTx = deviceTxOpt.get();
+                } else {
+                    LOG.error("Transaction for device {} was not found!", deviceId);
+                    return false;
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                LOG.error("Unable to get transaction for device {}!", deviceId, e);
+                return false;
+            }
+
+            // post the cross connect on the device
+            InstanceIdentifier<RoadmConnections> roadmConnIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber));
+            deviceTx.put(LogicalDatastoreType.CONFIGURATION, roadmConnIID, newRdmConn);
+            ListenableFuture<Void> submit = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+                    Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+            try {
+                submit.get();
+                LOG.info("Roadm connection power level successfully set ");
+                return true;
+            } catch (InterruptedException | ExecutionException ex) {
+                LOG.warn("Failed to post {}", newRdmConn, ex);
+            }
+
+        } else {
+            LOG.warn("Roadm-Connection is null in set power level ({})", connectionNumber);
+        }
+        return false;
+    }
+
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl22.java b/common/src/main/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl22.java
new file mode 100644 (file)
index 0000000..ab82e79
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.common.crossconnect;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import java.math.BigDecimal;
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.md.sal.binding.api.MountPoint;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.transportpce.common.Timeouts;
+import org.opendaylight.transportpce.common.device.DeviceTransaction;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev171215.OpticalControlMode;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev171215.PowerDBm;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.GetConnectionPortTrailInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.GetConnectionPortTrailOutput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.OrgOpenroadmDeviceService;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.connection.DestinationBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.connection.SourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.get.connection.port.trail.output.Ports;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CrossConnectImpl22 {
+
+    private static final Logger LOG = LoggerFactory.getLogger(CrossConnectImpl22.class);
+    private final DeviceTransactionManager deviceTransactionManager;
+
+    public CrossConnectImpl22(DeviceTransactionManager deviceTransactionManager) {
+        this.deviceTransactionManager = deviceTransactionManager;
+    }
+
+    public Optional<RoadmConnections> getCrossConnect(String deviceId, String connectionNumber) {
+        //TODO Change it to Operational later for real device
+        return deviceTransactionManager.getDataFromDevice(deviceId, LogicalDatastoreType.CONFIGURATION,
+                generateRdmConnectionIID(connectionNumber), Timeouts.DEVICE_READ_TIMEOUT,
+                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+    }
+
+
+    public Optional<String> postCrossConnect(String deviceId, Long waveNumber, String srcTp, String destTp) {
+        RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder();
+        String connectionNumber = generateConnectionName(srcTp, destTp, waveNumber);
+        rdmConnBldr.setConnectionName(connectionNumber);
+
+        rdmConnBldr.setOpticalControlMode(OpticalControlMode.Off);
+
+        rdmConnBldr.setSource(new SourceBuilder().setSrcIf(srcTp + "-" + waveNumber.toString()).build());
+
+        rdmConnBldr.setDestination(new DestinationBuilder().setDstIf(destTp + "-" + waveNumber.toString()).build());
+
+
+        InstanceIdentifier<RoadmConnections> rdmConnectionIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                .child(RoadmConnections.class, new RoadmConnectionsKey(rdmConnBldr.getConnectionName()));
+
+        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(deviceId);
+        DeviceTransaction deviceTx;
+        try {
+            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+            if (deviceTxOpt.isPresent()) {
+                deviceTx = deviceTxOpt.get();
+            } else {
+                LOG.error("Device transaction for device {} was not found!", deviceId);
+                return Optional.empty();
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
+            return Optional.empty();
+        }
+
+        // post the cross connect on the device
+        deviceTx.put(LogicalDatastoreType.CONFIGURATION, rdmConnectionIID, rdmConnBldr.build());
+        ListenableFuture<Void> submit =
+                deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+        try {
+            submit.get();
+            LOG.info("Roadm-connection successfully created: {}-{}-{}", srcTp, destTp, waveNumber);
+            return Optional.of(connectionNumber);
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.warn("Failed to post {}. Exception: {}", rdmConnBldr.build(), e);
+        }
+        return Optional.empty();
+    }
+
+
+    public boolean deleteCrossConnect(String deviceId, String connectionName) {
+
+        //Check if cross connect exists before delete
+        if (!getCrossConnect(deviceId, connectionName).isPresent()) {
+            LOG.warn("Cross connect does not exist, halting delete");
+            return false;
+        }
+        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(deviceId);
+        DeviceTransaction deviceTx;
+        try {
+            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+            if (deviceTxOpt.isPresent()) {
+                deviceTx = deviceTxOpt.get();
+            } else {
+                LOG.error("Device transaction for device {} was not found!", deviceId);
+                return false;
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.error("Unable to obtain device transaction for device {}!", deviceId, e);
+            return false;
+        }
+
+        // post the cross connect on the device
+        deviceTx.delete(LogicalDatastoreType.CONFIGURATION, generateRdmConnectionIID(connectionName));
+        ListenableFuture<Void> submit =
+                deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT, Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+        try {
+            submit.get();
+            LOG.info("Roadm connection successfully deleted ");
+            return true;
+        } catch (InterruptedException | ExecutionException e) {
+            LOG.warn("Failed to delete {}", connectionName, e);
+        }
+        return false;
+    }
+
+
+    public List<Ports> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
+            throws OpenRoadmInterfaceException {
+        String connectionName = generateConnectionName(srcTp, destTp, waveNumber);
+        Optional<MountPoint> mountPointOpt = deviceTransactionManager.getDeviceMountPoint(nodeId);
+        List<Ports> ports = null;
+        MountPoint mountPoint;
+        if (mountPointOpt.isPresent()) {
+            mountPoint = mountPointOpt.get();
+        } else {
+            LOG.error("Failed to obtain mount point for device {}!", nodeId);
+            return Collections.emptyList();
+        }
+        final Optional<RpcConsumerRegistry> service = mountPoint.getService(RpcConsumerRegistry.class).toJavaUtil();
+        if (!service.isPresent()) {
+            LOG.error("Failed to get RpcService for node {}", nodeId);
+        }
+        final OrgOpenroadmDeviceService rpcService = service.get().getRpcService(OrgOpenroadmDeviceService.class);
+        final GetConnectionPortTrailInputBuilder portTrainInputBuilder = new GetConnectionPortTrailInputBuilder();
+        portTrainInputBuilder.setConnectionName(connectionName);
+        final Future<RpcResult<GetConnectionPortTrailOutput>> portTrailOutput = rpcService.getConnectionPortTrail(
+                portTrainInputBuilder.build());
+        if (portTrailOutput != null) {
+            try {
+                RpcResult<GetConnectionPortTrailOutput> connectionPortTrailOutputRpcResult = portTrailOutput.get();
+                GetConnectionPortTrailOutput connectionPortTrailOutput = connectionPortTrailOutputRpcResult.getResult();
+                if (connectionPortTrailOutput == null) {
+                    throw new OpenRoadmInterfaceException(String.format("RPC get connection port trail called on"
+                            + " node %s returned null!", nodeId));
+                }
+                LOG.info("Getting port trail for node {}'s connection number {}", nodeId, connectionName);
+                ports = connectionPortTrailOutput.getPorts();
+                for (Ports port : ports) {
+                    LOG.info("{} - Circuit pack {} - Port {}", nodeId, port.getCircuitPackName(), port.getPortName());
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                LOG.warn("Exception caught", e);
+            }
+        } else {
+            LOG.warn("Port trail is null in getConnectionPortTrail for nodeId {}", nodeId);
+        }
+        return ports != null ? ports : Collections.emptyList();
+    }
+
+
+    public boolean setPowerLevel(String deviceId, Enum mode, BigDecimal powerValue, String connectionName) {
+        Optional<RoadmConnections> rdmConnOpt = getCrossConnect(deviceId, connectionName);
+        if (rdmConnOpt.isPresent()) {
+            RoadmConnectionsBuilder rdmConnBldr = new RoadmConnectionsBuilder(rdmConnOpt.get());
+            rdmConnBldr.setOpticalControlMode(OpticalControlMode.values()[mode.ordinal()]);
+            if (powerValue != null) {
+                rdmConnBldr.setTargetOutputPower(new PowerDBm(powerValue));
+            }
+            RoadmConnections newRdmConn = rdmConnBldr.build();
+
+            Future<Optional<DeviceTransaction>> deviceTxFuture =
+                    deviceTransactionManager.getDeviceTransaction(deviceId);
+            DeviceTransaction deviceTx;
+            try {
+                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+                if (deviceTxOpt.isPresent()) {
+                    deviceTx = deviceTxOpt.get();
+                } else {
+                    LOG.error("Transaction for device {} was not found!", deviceId);
+                    return false;
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                LOG.error("Unable to get transaction for device {}!", deviceId, e);
+                return false;
+            }
+
+            // post the cross connect on the device
+            InstanceIdentifier<RoadmConnections> roadmConnIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(RoadmConnections.class, new RoadmConnectionsKey(connectionName));
+            deviceTx.put(LogicalDatastoreType.CONFIGURATION, roadmConnIID, newRdmConn);
+            ListenableFuture<Void> submit = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+                    Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+            try {
+                submit.get();
+                LOG.info("Roadm connection power level successfully set ");
+                return true;
+            } catch (InterruptedException | ExecutionException ex) {
+                LOG.warn("Failed to post {}", newRdmConn, ex);
+            }
+
+        } else {
+            LOG.warn("Roadm-Connection is null in set power level ({})", connectionName);
+        }
+        return false;
+    }
+
+    private InstanceIdentifier<RoadmConnections> generateRdmConnectionIID(String connectionNumber) {
+        return InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                .child(RoadmConnections.class, new RoadmConnectionsKey(connectionNumber));
+    }
+
+    private String generateConnectionName(String srcTp, String destTp, Long waveNumber) {
+        return srcTp + "-" + destTp + "-" + waveNumber;
+    }
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java b/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexImpl.java
new file mode 100644 (file)
index 0000000..dd5bd03
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright Â© 2017 Orange, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.common.fixedflex;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class FixedFlexImpl implements FixedFlexInterface {
+    private static final Logger LOG = LoggerFactory.getLogger(FixedFlexImpl.class);
+    private long index;
+    private double centerFrequency;
+    private double start;
+    private double stop;
+    private double wavelength;
+
+    public FixedFlexImpl(Long index, double centreFrequency, double start, double stop, double wavelength) {
+        this.index = index;
+        this.centerFrequency = centreFrequency;
+        this.start = start;
+        this.stop = stop;
+        this.wavelength = wavelength;
+    }
+
+    public FixedFlexImpl() {
+        this.index = 0L;
+        this.centerFrequency = 0;
+        this.start = 0;
+        this.stop = 0;
+        this.wavelength = 0;
+    }
+
+    @Override
+    /**
+     * @param index Wavelength number
+     * @return Returns FixedFlexImp object with the calculated result.
+     **/
+    public FixedFlexImpl getFixedFlexWaveMapping(long wlIndex) {
+        FixedFlexImpl fixedFlex = new FixedFlexImpl();
+        fixedFlex.centerFrequency = 196.1 - (wlIndex - 1) * 0.05;
+        fixedFlex.wavelength = 1528.77 + ((wlIndex - 1) * 0.39);
+        fixedFlex.start = fixedFlex.centerFrequency - 0.025;
+        fixedFlex.stop = fixedFlex.centerFrequency + 0.025;
+        return fixedFlex;
+    }
+
+    public double getCenterFrequency() {
+        return centerFrequency;
+    }
+
+    public double getStart() {
+        return start;
+    }
+
+    public long getIndex() {
+        return index;
+    }
+
+    public double getStop() {
+        return stop;
+    }
+
+    public double getWavelength() {
+        return wavelength;
+    }
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexInterface.java b/common/src/main/java/org/opendaylight/transportpce/common/fixedflex/FixedFlexInterface.java
new file mode 100644 (file)
index 0000000..9367da2
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright Â© 2017 Orange, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.common.fixedflex;
+/**
+ * <p>
+ *     Mapping 2.2 devices to Fixed flex.
+ * </p>
+ **/
+
+public interface FixedFlexInterface {
+    /**
+     * Calculates the center frequency, wavelength, start and stop for a wavelength number.
+     *
+     * @param index Wavelength number
+     * @return Returns FixedFlexImp object with the calculated result.
+     */
+    FixedFlexImpl getFixedFlexWaveMapping(long index);
+
+    double getCenterFrequency();
+
+    double getStart();
+
+    double getStop();
+
+    double getWavelength();
+
+    long getIndex();
+}
+
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtils.java b/common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtils.java
new file mode 100644 (file)
index 0000000..42797c7
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.common.mapping;
+
+public interface MappingUtils {
+
+    /*
+        This method returns the OpenROADM yang release
+        supported by the device.
+     */
+    String getOpenRoadmVersion(String nodeId);
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtilsImpl.java b/common/src/main/java/org/opendaylight/transportpce/common/mapping/MappingUtilsImpl.java
new file mode 100644 (file)
index 0000000..3e2d055
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.common.mapping;
+
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MappingUtilsImpl implements MappingUtils {
+
+    private static final Logger LOG = LoggerFactory.getLogger(MappingUtilsImpl.class);
+
+    private final DataBroker dataBroker;
+
+    public MappingUtilsImpl(DataBroker dataBroker) {
+
+        this.dataBroker = dataBroker;
+
+    }
+
+    public String getOpenRoadmVersion(String nodeId) {
+        /*
+         * Getting physical mapping corresponding to logical connection point
+         */
+        InstanceIdentifier<Nodes> portMappingIID = InstanceIdentifier.builder(Network.class).child(Nodes.class,
+                new NodesKey(nodeId)).build();
+        try (ReadOnlyTransaction readTx = dataBroker.newReadOnlyTransaction()) {
+            Optional<Nodes> mapObject =
+                    readTx.read(LogicalDatastoreType.CONFIGURATION, portMappingIID).get().toJavaUtil();
+            if (mapObject.isPresent()) {
+                Nodes mapping = mapObject.get();
+                switch (mapping.getOpenroadmVersion()) {
+                    case _22:
+                        return StringConstants.OPENROADM_DEVICE_VERSION_2_2;
+                    case _121:
+                        return StringConstants.OPENROADM_DEVICE_VERSION_1_2_1;
+                    default:
+                        return StringConstants.OPENROADM_DEVICE_VERSION_1_2_1;
+                }
+            } else {
+                LOG.warn("Could not find mapping for nodeId {}",
+                        nodeId);
+            }
+        } catch (InterruptedException | ExecutionException ex) {
+            LOG.error("Unable to read mapping for nodeId {}",nodeId, ex);
+        }
+        return null;
+    }
+}
index 029cf949adb903400e303f38a46235b1901b1c68..2dac08d0543b6bd55510eb848c384bda408584b5 100644 (file)
  */
 
 package org.opendaylight.transportpce.common.mapping;
+import static org.opendaylight.transportpce.common.StringConstants.OPENROADM_DEVICE_VERSION_1_2_1;
+import static org.opendaylight.transportpce.common.StringConstants.OPENROADM_DEVICE_VERSION_2_2;
 
-import com.google.common.util.concurrent.CheckedFuture;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Optional;
-import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import java.util.stream.Collectors;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.transportpce.common.Timeouts;
-import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
-import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
-import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
-import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.NetworkBuilder;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesBuilder;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegree;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeKey;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingBuilder;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.NodeTypes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.CircuitPack;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.Port;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.Ports;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.PortsKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.degree.ConnectionPorts;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Info;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Protocols;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.PortConfig;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 public class PortMappingImpl implements PortMapping {
 
     private static final Logger LOG = LoggerFactory.getLogger(PortMappingImpl.class);
 
     private final DataBroker dataBroker;
-    private final DeviceTransactionManager deviceTransactionManager;
-    private final OpenRoadmInterfaces openRoadmInterfaces;
+    private final MappingUtils mappingUtils;
+    private final PortMappingVersion22 portMappingVersion22;
+    private final PortMappingVersion121 portMappingVersion121;
+
+    public PortMappingImpl(DataBroker dataBroker,PortMappingVersion22 portMappingVersion22,MappingUtils mappingUtils,
+                           PortMappingVersion121 portMappingVersion121) {
 
-    public PortMappingImpl(DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
-        OpenRoadmInterfaces openRoadmInterfaces) {
         this.dataBroker = dataBroker;
-        this.deviceTransactionManager = deviceTransactionManager;
-        this.openRoadmInterfaces = openRoadmInterfaces;
+        this.mappingUtils = mappingUtils;
+        this.portMappingVersion22 = portMappingVersion22;
+        this.portMappingVersion121 = portMappingVersion121;
     }
 
     @Override
     public boolean createMappingData(String nodeId) {
 
-        LOG.info("Create Mapping Data for node {}", nodeId);
-        List<Mapping> portMapList = new ArrayList<>();
-        InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
-        Optional<Info> deviceInfoOptional = this.deviceTransactionManager.getDataFromDevice(nodeId,
-            LogicalDatastoreType.OPERATIONAL, infoIID,
-            Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-
-        Info deviceInfo;
-        if (deviceInfoOptional.isPresent()) {
-            deviceInfo = deviceInfoOptional.get();
-        } else {
-            LOG.warn("Device info subtree is absent for {}", nodeId);
-            return false;
-        }
-        if (deviceInfo.getNodeType() == null) {
-            LOG.error("Node type field is missing"); // TODO make mandatory in yang
-            return false;
-        }
-        switch (deviceInfo.getNodeType()) {
-
-            case Rdm:
-                // Get TTP port mapping
-                if (!createTtpPortMapping(nodeId, deviceInfo, portMapList)) {
-                    // return false if mapping creation for TTP's failed
-                    LOG.warn("Unable to create mapping for TTP's on node {}", nodeId);
-                    return false;
-                }
-
-                // Get PP port mapping
-                if (!createPpPortMapping(nodeId, deviceInfo, portMapList)) {
-                    // return false if mapping creation for PP's failed
-                    LOG.warn("Unable to create mapping for PP's on node {}", nodeId);
-                    return false;
-                }
-                break;
-            case Xpdr:
-                if (!createXpdrPortMapping(nodeId, portMapList)) {
-                    LOG.warn("Unable to create mapping for Xponder on node {}", nodeId);
-                    return false;
-                }
-                break;
-            default:
-                LOG.error("Unable to create mapping for node {} : unknown nodetype ", nodeId);
-                break;
-
-        }
-        return postPortMapping(deviceInfo, portMapList, deviceInfo.getNodeType().getIntValue(), null);
-    }
-
-    /**
-     * This private method gets the list of external ports on a degree. For each
-     * port in the degree, it does a get on port subtree with
-     * circuit-pack-name/port-name as key in order to get the logical connection
-     * point name corresponding to it.
-     *
-     * @param deviceInfo
-     *            Info subtree read from the device
-     * @param portMapList
-     *            Reference to the list containing the mapping to be pushed to
-     *            MD-SAL
-     *
-     * @return true/false based on status of operation
-     */
-    private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
-        // Creating mapping data for degree TTP's
-
-        List<Degree> degrees = getDegrees(nodeId, deviceInfo);
-        List<ConnectionPorts> degreeConPorts = getDegreePorts(degrees);
-        Map<String, String> interfaceList = getEthInterfaceList(nodeId);
-        List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees, nodeId, interfaceList);
-        LOG.info("Map looks like this {}",interfaceList);
-
-        postPortMapping(deviceInfo, null, deviceInfo.getNodeType().getIntValue(), cpToDegreeList);
-
-        // Getting circuit-pack-name/port-name corresponding to TTP's
-        for (ConnectionPorts cp : degreeConPorts) {
-            String circuitPackName = cp.getCircuitPackName();
-            String portName = cp.getPortName().toString();
-            InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
-                .child(Ports.class, new PortsKey(portName));
-
-            LOG.info("Fetching logical Connection Point value for port {} at circuit pack {}", portName,
-                circuitPackName);
-            Optional<Ports> portObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
-                LogicalDatastoreType.OPERATIONAL, portIID,
-                Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-            if (portObject.isPresent()) {
-                Ports port = portObject.get();
-                if (port.getLogicalConnectionPoint() != null) {
-                    LOG.info("Logical Connection Point for {} {} is {}", circuitPackName, portName,
-                        port.getLogicalConnectionPoint());
-                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
-                        port.getLogicalConnectionPoint()));
-                } else {
-                    LOG.warn("Logical Connection Point value is missing for {} {}", circuitPackName,
-                        port.getPortName());
-                }
-            } else {
-                LOG.warn("Port {} is not present in node {} in circuit pack {}!", portName, nodeId, circuitPackName);
-                continue; // TODO continue or return true?
-            }
-        }
-        return true;
-    }
-
-    private List<Degree> getDegrees(String deviceId, Info ordmInfo) {
-        List<Degree> degrees = new ArrayList<>();
-        Integer maxDegree;
-
-        // Get value for max degree from info subtree, required for iteration
-        // if not present assume to be 20 (temporary)
-        if (ordmInfo.getMaxDegrees() != null) {
-            maxDegree = ordmInfo.getMaxDegrees();
-        } else {
-            maxDegree = 20;
-        }
-
-        for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
-            LOG.info("Getting Connection ports for Degree Number {}", degreeCounter);
-            InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                .child(Degree.class, new DegreeKey(degreeCounter));
-            Optional<Degree> ordmDegreeObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
-                LogicalDatastoreType.CONFIGURATION,
-                deviceIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-            if (ordmDegreeObject.isPresent()) {
-                degrees.add(ordmDegreeObject.get());
-            } else {
-                LOG.info("Device has {} degree", degreeCounter - 1);
-                break;
-            }
-        }
-        return degrees;
-    }
-
-    /**
-     * This private method gets the list of circuit packs on an Srg. For each
-     * circuit pack on an Srg, it does a get on circuit-pack subtree with
-     * circuit-pack-name as key in order to get the list of ports. It then
-     * iterates over the list of ports to get ports with port-qual as
-     * roadm-external. It appends a TX,RX,TXRX to the logical connection point
-     * name based on the direction of the port.
-     *
-     * @param nodeId
-     *            Id of device
-     * @param deviceInfo
-     *            Info subtree read from the device
-     * @param portMapList
-     *            Reference to the list containing the mapping to be pushed to
-     *            MD-SAL
-     *
-     * @return true/false based on status of operation
-     */
-
-    private boolean createPpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
-        // Creating mapping data for SRG's PP
-        HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
-            .CircuitPacks>> srgCps = getSrgCps(nodeId, deviceInfo);
-        Set<Map.Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206
-            .srg.CircuitPacks>>> circuitPacks = srgCps.entrySet();
-        for (Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
-                .CircuitPacks>> entry : circuitPacks) {
-            Integer srgIndex = entry.getKey();
-            for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks cp : entry
-                .getValue()) {
-                String circuitPackName = cp.getCircuitPackName();
-                InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                    .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName));
-                Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
-                    LogicalDatastoreType.OPERATIONAL, cpIID,
-                    Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-
-                if (!circuitPackObject.isPresent() || (circuitPackObject.get().getPorts() == null)) {
-                    LOG.warn("{} : Circuit pack {} not found or without ports.", nodeId, circuitPackName);
-                    continue; // TODO continue or return false?
-                }
-                CircuitPacks circuitPack = circuitPackObject.get();
-                for (Ports port : circuitPack.getPorts()) {
-                    if (port.getLogicalConnectionPoint() != null) {
-                        String logicalConnectionPoint = getLogicalConnectionPort(port, srgIndex);
-                        LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId, circuitPackName, port
-                            .getPortName(),
-                            logicalConnectionPoint);
-                        portMapList.add(createMappingObject(nodeId, port, circuitPackName, logicalConnectionPoint));
-                    } else if (Port.PortQual.RoadmInternal.equals(port.getPortQual())) {
-                        LOG.info("Port is internal, skipping Logical Connection Point missing for {} {}",
-                            circuitPackName,
-                            port.getPortName());
-                    } else if (port.getLogicalConnectionPoint() == null) {
-                        LOG.info("Value missing, Skipping Logical Connection Point missing for {} {}", circuitPackName,
-                            port.getPortName());
-                    }
-                }
-            }
-        }
-        return true;
-    }
-
-    /**
-     * This method does a get operation on shared risk group subtree of the
-     * netconf device's config datastore and returns a list of all circuit packs
-     * objects that are part of srgs. It is required to do a selective get on
-     * all the circuit packs that contain add/drop ports of interest.
-     *
-     * @param deviceId
-     *            Device id
-     * @param ordmInfo
-     *            Info subtree from the device
-     * @return List of circuit packs object belonging to- shared risk group
-     *         subtree
-     */
-    private HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
-        .CircuitPacks>> getSrgCps(String deviceId, Info ordmInfo) {
-        HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
-            .CircuitPacks>> cpPerSrg = new HashMap<>();
-        Integer maxSrg;
-        // Get value for max Srg from info subtree, required for iteration
-        // if not present assume to be 20 (temporary)
-        if (ordmInfo.getMaxSrgs() != null) {
-            maxSrg = ordmInfo.getMaxSrgs();
-        } else {
-            maxSrg = 20;
-        }
-        for (int srgCounter = 1; srgCounter <= maxSrg; srgCounter++) {
-            List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps =
-                new ArrayList<>();
-            LOG.info("Getting Circuitpacks for Srg Number {}", srgCounter);
-            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                .child(SharedRiskGroup.class, new SharedRiskGroupKey(srgCounter));
-            Optional<SharedRiskGroup> ordmSrgObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
-                LogicalDatastoreType.CONFIGURATION,
-                srgIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-            if (ordmSrgObject.isPresent()) {
-                srgCps.addAll(ordmSrgObject.get().getCircuitPacks());
-                cpPerSrg.put(ordmSrgObject.get().getSrgNumber(), srgCps);
-            }
-        }
-        LOG.info("Device {} has {} Srg", deviceId, cpPerSrg.size());
-        return cpPerSrg;
-    }
-
-    /**
-     * This private method gets the list of circuit packs on a xponder. For each
-     * circuit pack on a Xponder, it does a get on circuit-pack subtree with
-     * circuit-pack-name as key in order to get the list of ports. It then
-     * iterates over the list of ports to get ports with port-qual as
-     * xpdr-network/xpdr-client. The line and client ports are saved as:
-     *
-     * <p>
-     * 1. LINEn
-     *
-     * <p>
-     * 2. CLNTn
-     *
-     * @param nodeId
-     *            Id of device
-     * @param portMapList
-     *            Reference to the list containing the mapping to be pushed to
-     *            MD-SAL
-     *
-     * @return true/false based on status of operation
-     */
-    private boolean createXpdrPortMapping(String nodeId, List<Mapping> portMapList) {
-        // Creating for Xponder Line and Client Ports
-        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class);
-        Optional<OrgOpenroadmDevice> deviceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
-            LogicalDatastoreType.OPERATIONAL, deviceIID,
-            Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-
-        // Variable to keep track of number of line ports
-        int line = 1;
-        // Variable to keep track of number of client ports
-        int client = 1;
-        if (!deviceObject.isPresent() || (deviceObject.get().getCircuitPacks() == null)) {
-            LOG.warn("Circuit Packs are not present for {}", nodeId);
-            return false; // TODO return false or continue?
+        String openROADMversion = mappingUtils.getOpenRoadmVersion(nodeId);
+        if (openROADMversion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            return portMappingVersion121.createMappingData(nodeId);
         }
-
-        List<CircuitPacks> circuitPackList = deviceObject.get().getCircuitPacks();
-        circuitPackList.sort(Comparator.comparing(CircuitPack::getCircuitPackName));
-
-        for (CircuitPacks cp : circuitPackList) {
-            String circuitPackName = cp.getCircuitPackName();
-            if (cp.getPorts() == null) {
-                LOG.warn("Ports were not found for circuit pack: {}", circuitPackName);
-                continue;
-            }
-            for (Ports port : cp.getPorts()) {
-                if (Port.PortQual.XpdrNetwork.equals(port.getPortQual())) {
-                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
-                        "XPDR1-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN + line));
-                    line++;
-                } else if (Port.PortQual.XpdrClient.equals(port.getPortQual())) {
-                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
-                        "XPDR1-" + OpenRoadmInterfacesImpl.CLIENT_TOKEN + client));
-                    client++;
-                } else {
-                    LOG.warn("Not supported type of port! Port type: {}", port.getPortQual());
-                }
-            }
+        else if (openROADMversion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            return portMappingVersion22.createMappingData(nodeId);
         }
-        return true;
-    }
-
-    /**
-     * This private method builds the mapping object to be pushed in MD-SAL in
-     * order to save port mapping. In case of TTP ports, it also saves the
-     * OTS,OMS interfaces provisioned on the port.
-     *
-     * @param port
-     *            Reference to device's port subtree object.
-     * @param circuitPackName
-     *            Name of cp where port exists.
-     * @param logicalConnectionPoint
-     *            logical name of the port.
-     *
-     * @return true/false based on status of operation
-     */
-
-    private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
-        String logicalConnectionPoint) {
-        MappingBuilder mpBldr = new MappingBuilder();
-        mpBldr.withKey(new MappingKey(logicalConnectionPoint)).setLogicalConnectionPoint(logicalConnectionPoint)
-            .setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
-
-        // Get OMS and OTS interface provisioned on the TTP's
-        if (logicalConnectionPoint.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) && (port.getInterfaces() != null)) {
-            for (Interfaces interfaces : port.getInterfaces()) {
-                try {
-                    Optional<Interface> openRoadmInterface = this.openRoadmInterfaces.getInterface(nodeId,
-                        interfaces.getInterfaceName());
-                    if (openRoadmInterface.isPresent()) {
-                        Class<? extends InterfaceType> interfaceType = openRoadmInterface.get().getType();
-                        // Check if interface type is OMS or OTS
-                        if (interfaceType.equals(OpenROADMOpticalMultiplex.class)) {
-                            mpBldr.setSupportingOms(interfaces.getInterfaceName());
-                        }
-                        if (interfaceType.equals(OpticalTransport.class)) {
-                            mpBldr.setSupportingOts(interfaces.getInterfaceName());
-                        }
-                    } else {
-                        LOG.warn("Interface {} from node {} was null!", interfaces.getInterfaceName(), nodeId);
-                    }
-                } catch (OpenRoadmInterfaceException ex) {
-                    LOG.warn("Error while getting interface {} from node {}!", interfaces.getInterfaceName(), nodeId,
-                        ex);
-                }
-            }
-        }
-        return mpBldr.build();
-    }
 
-    private CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber, String nodeId,
-            Map<String, String> interfaceList) {
-        String interfaceName = null;
-        if (interfaceList.get(circuitPackName) !=  null) {
-            interfaceName = interfaceList.get(circuitPackName);
-        }
-        return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
-        .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
-    }
-
-    private static List<ConnectionPorts> getDegreePorts(List<Degree> degrees) {
-        return degrees.stream().filter(degree -> degree.getConnectionPorts() != null)
-            .flatMap(degree -> degree.getConnectionPorts().stream()).collect(Collectors.toList());
-    }
-
-    private List<CpToDegree> getCpToDegreeList(List<Degree> degrees, String nodeId,
-            Map<String, String> interfaceList) {
-        List<CpToDegree> cpToDegreeList = new ArrayList<>();
-        for (Degree degree : degrees) {
-            if (degree.getCircuitPacks() != null) {
-                LOG.info("Inside CP to degree list");
-                cpToDegreeList.addAll(degree.getCircuitPacks().stream()
-                        .map(cp -> createCpToDegreeObject(cp.getCircuitPackName() ,
-                                degree.getDegreeNumber().toString(), nodeId ,interfaceList))
-                        .collect(Collectors.toList()));
-            }
+        else {
+            return false;
         }
-        return cpToDegreeList;
     }
 
-    /**
-     * This method for ports the portMapping corresponding to the
-     * portmapping.yang file to the MD-SAL datastore.
-     *
-     * <p>
-     * 1. Supporting circuit pack 2. Supporting port 3. Supporting OMS interface
-     * (if port on ROADM)
-     *
-     * @param deviceInfo
-     *            Info subtree from the device.
-     * @param portMapList
-     *            Reference to the list containing the mapping to be pushed to
-     *            MD-SAL.
-     *
-     * @return Result true/false based on status of operation.
-     */
-    private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList, Integer nodeType,
-        List<CpToDegree> cp2DegreeList) {
-        NodesBuilder nodesBldr = new NodesBuilder();
-        nodesBldr.withKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
-        nodesBldr.setNodeType(NodeTypes.forValue(nodeType));
-
-        if (portMapList != null) {
-            nodesBldr.setMapping(portMapList);
-        }
-        if (cp2DegreeList != null) {
-            nodesBldr.setCpToDegree(cp2DegreeList);
-        }
-
-        List<Nodes> nodesList = new ArrayList<>();
-        nodesList.add(nodesBldr.build());
-
-        NetworkBuilder nwBldr = new NetworkBuilder();
-        nwBldr.setNodes(nodesList);
 
-        final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
-        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
-        Network network = nwBldr.build();
-        writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
-        CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
-        try {
-            submit.checkedGet();
-            return true;
-
-        } catch (TransactionCommitFailedException e) {
-            LOG.warn("Failed to post {}", network, e);
-            return false;
-        }
-    }
 
     @Override
     public Mapping getMapping(String nodeId, String logicalConnPoint) {
@@ -546,48 +91,8 @@ public class PortMappingImpl implements PortMapping {
         return null;
     }
 
-    private static String getLogicalConnectionPort(Ports port, int srgCounter) {
-        String logicalConnectionPoint = null;
-        if (port.getLogicalConnectionPoint() != null) {
-            switch (port.getPortDirection()) {
-                case Tx:
-                    // Port direction is transmit
-                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
-                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint() + "-TX";
-                    } else {
-                        logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TX";
-                    }
-                    break;
-                case Rx:
-                    // Port direction is receive
-                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
-                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint() + "-RX";
-                    } else {
-                        logicalConnectionPoint = port.getLogicalConnectionPoint() + "-RX";
-                    }
-                    break;
-                case Bidirectional:
-                    // port is bidirectional
-                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
-                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint();
-                    } else {
-                        logicalConnectionPoint = port.getLogicalConnectionPoint();
-                    }
-                    if (!port.getLogicalConnectionPoint().endsWith("-TXRX")) {
-                        logicalConnectionPoint = logicalConnectionPoint.concat("-TXRX");
-                    }
-                    break;
-                default:
-                    // Unsupported Port direction
-                    LOG.error("Unsupported port direction for port {}  {}", port, port.getPortDirection());
-                    return null; // TODO return false or continue?
-            }
-            return logicalConnectionPoint;
-        }
-        LOG.warn("Unsupported port direction for port {} - {} - LogicalConnectionPoint is null",
-            port, port.getPortDirection());
-        return null; // TODO return false or continue?
-    }
+
+
 
     @Override
     public void deleteMappingData(String nodeId) {
@@ -607,87 +112,20 @@ public class PortMappingImpl implements PortMapping {
 
     @Override
     public boolean updateMapping(String nodeId, Mapping oldMapping) {
-        LOG.info("Updating Mapping Data {} for node {}", oldMapping, nodeId);
-        InstanceIdentifier<Ports> portIId = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
-            CircuitPacks.class, new CircuitPacksKey(oldMapping.getSupportingCircuitPackName())).child(Ports.class,
-                new PortsKey(oldMapping.getSupportingPort()));
-        if ((oldMapping != null) && (nodeId != null)) {
-            try {
-                Optional<Ports> portObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
-                    LogicalDatastoreType.OPERATIONAL, portIId, Timeouts.DEVICE_READ_TIMEOUT,
-                    Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-                if (portObject.isPresent()) {
-                    Ports port = portObject.get();
-                    Mapping newMapping = createMappingObject(nodeId, port, oldMapping.getSupportingCircuitPackName(),
-                        oldMapping.getLogicalConnectionPoint());
 
-                    final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
-                    InstanceIdentifier<Mapping> mapIID = InstanceIdentifier.create(Network.class).child(Nodes.class,
-                        new NodesKey(nodeId)).child(Mapping.class, new MappingKey(oldMapping
-                            .getLogicalConnectionPoint()));
-                    writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, mapIID, newMapping);
-                    CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
-                    submit.checkedGet();
-                    return true;
-                }
-                return false;
-            } catch (TransactionCommitFailedException e) {
-                LOG.error("Transaction Commit Error updating Mapping {} for node {}", oldMapping
-                    .getLogicalConnectionPoint(), nodeId, e);
-                return false;
-            }
-        } else {
-            LOG.error("Impossible to update mapping");
-            return false;
-        }
-    }
 
-    private Map<String, String> getEthInterfaceList(String nodeId) {
-        LOG.info("It is calling get ethernet interface");
-        Map<String, String> cpToInterfaceMap = new HashMap<>();
-        InstanceIdentifier<Protocols> protocolsIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                .child(Protocols.class);
-        Optional<Protocols> protocolObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
-                LogicalDatastoreType.OPERATIONAL, protocolsIID, Timeouts.DEVICE_READ_TIMEOUT,
-                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-        if (!protocolObject.isPresent() || (protocolObject.get().augmentation(Protocols1.class) == null)) {
-            LOG.warn("LLDP subtree is missing : isolated openroadm device");
-            return cpToInterfaceMap;
+        String openROADMversion = mappingUtils.getOpenRoadmVersion(nodeId);
+        if (openROADMversion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            return portMappingVersion121.updateMapping(nodeId,oldMapping);
         }
-        List<PortConfig> portConfigList = protocolObject.get().augmentation(Protocols1.class).getLldp().getPortConfig();
-        if (!portConfigList.isEmpty()) {
-            for (PortConfig portConfig : portConfigList) {
-                if (portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
-                    InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
-                            .child(Interface.class, new InterfaceKey(portConfig.getIfName()));
-                    Optional<Interface> interfaceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
-                            LogicalDatastoreType.OPERATIONAL, interfaceIID, Timeouts.DEVICE_READ_TIMEOUT,
-                            Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-                    if (interfaceObject.isPresent()
-                            && (interfaceObject.get().getSupportingCircuitPackName() != null)) {
-                        String supportingCircuitPackName = interfaceObject.get().getSupportingCircuitPackName();
-                        cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
-                        InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier
-                                .create(OrgOpenroadmDevice.class).child(CircuitPacks.class,
-                                        new CircuitPacksKey(supportingCircuitPackName));
-                        Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(
-                                nodeId, LogicalDatastoreType.OPERATIONAL, circuitPacksIID, Timeouts
-                                                .DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-                        if (circuitPackObject.isPresent()
-                                && (circuitPackObject.get().getParentCircuitPack() != null)) {
-                            cpToInterfaceMap.put(circuitPackObject.get().getParentCircuitPack()
-                                    .getCircuitPackName(), portConfig.getIfName());
-                        }
-                    }
-                } else {
-                    LOG.warn("PortConfig Admi Status is not equal Txandrx");
-                }
-            }
-        } else {
-            LOG.warn("Couldnt find port config under LLDP for Node : {}", nodeId);
+        else if (openROADMversion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            return portMappingVersion22.updateMapping(nodeId,oldMapping);
+        }
+
+        else {
+            return false;
         }
-        LOG.info("Processiong is done.. now returning..");
-        return cpToInterfaceMap;
     }
 
+
 }
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121.java b/common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121.java
new file mode 100644 (file)
index 0000000..32cd7b3
--- /dev/null
@@ -0,0 +1,542 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.common.mapping;
+import com.google.common.util.concurrent.CheckedFuture;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.transportpce.common.Timeouts;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.NetworkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegree;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.NodeTypes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.CircuitPack;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.Port;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.Ports;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.PortsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.degree.ConnectionPorts;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Protocols;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.Protocols1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.Lldp;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.lldp.container.lldp.PortConfig;
+
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+public class PortMappingVersion121 {
+
+    private static final Logger LOG = LoggerFactory.getLogger(PortMappingImpl.class);
+
+    private final DataBroker dataBroker;
+    private final DeviceTransactionManager deviceTransactionManager;
+    private final OpenRoadmInterfaces openRoadmInterfaces;
+
+    public PortMappingVersion121(DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
+                                  OpenRoadmInterfaces openRoadmInterfaces) {
+        this.dataBroker = dataBroker;
+        this.deviceTransactionManager = deviceTransactionManager;
+        this.openRoadmInterfaces = openRoadmInterfaces;
+    }
+
+    public boolean createMappingData(String nodeId) {
+
+        LOG.info("Create Mapping Data for node {}", nodeId);
+        List<Mapping> portMapList = new ArrayList<>();
+        InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
+        Optional<Info> deviceInfoOptional = this.deviceTransactionManager.getDataFromDevice(nodeId,
+            LogicalDatastoreType.OPERATIONAL, infoIID,Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+
+        Info deviceInfo;
+        if (deviceInfoOptional.isPresent()) {
+            deviceInfo = deviceInfoOptional.get();
+        } else {
+            LOG.warn("Device info subtree is absent for {}", nodeId);
+            return false;
+        }
+        if (deviceInfo.getNodeType() == null) {
+            LOG.error("Node type field is missing"); // TODO make mandatory in yang
+            return false;
+        }
+        switch (deviceInfo.getNodeType()) {
+
+            case Rdm:
+                // Get TTP port mapping
+                if (!createTtpPortMapping(nodeId, deviceInfo, portMapList)) {
+                    // return false if mapping creation for TTP's failed
+                    LOG.warn("Unable to create mapping for TTP's on node {}", nodeId);
+                    return false;
+                }
+
+                // Get PP port mapping
+                if (!createPpPortMapping(nodeId, deviceInfo, portMapList)) {
+                    // return false if mapping creation for PP's failed
+                    LOG.warn("Unable to create mapping for PP's on node {}", nodeId);
+                    return false;
+                }
+                break;
+            case Xpdr:
+                if (!createXpdrPortMapping(nodeId, portMapList)) {
+                    LOG.warn("Unable to create mapping for Xponder on node {}", nodeId);
+                    return false;
+                }
+                break;
+            default:
+                LOG.error("Unable to create mapping for node {} : unknown nodetype ", nodeId);
+                break;
+
+        }
+        return postPortMapping(deviceInfo, portMapList, deviceInfo.getNodeType().getIntValue(), null);
+    }
+
+    private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList, Integer nodeType,
+                                    List<CpToDegree> cp2DegreeList) {
+        NodesBuilder nodesBldr = new NodesBuilder();
+        nodesBldr.withKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
+        nodesBldr.setNodeType(NodeTypes.forValue(nodeType));
+        nodesBldr.setOpenroadmVersion(Nodes.OpenroadmVersion._121);
+        if (portMapList != null) {
+            nodesBldr.setMapping(portMapList);
+        }
+        if (cp2DegreeList != null) {
+            nodesBldr.setCpToDegree(cp2DegreeList);
+        }
+
+        List<Nodes> nodesList = new ArrayList<>();
+        nodesList.add(nodesBldr.build());
+
+        NetworkBuilder nwBldr = new NetworkBuilder();
+        nwBldr.setNodes(nodesList);
+
+        final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
+        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
+        Network network = nwBldr.build();
+        writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
+        CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
+        try {
+            submit.checkedGet();
+            return true;
+
+        } catch (TransactionCommitFailedException e) {
+            LOG.warn("Failed to post {}", network, e);
+            return false;
+        }
+    }
+
+    private static String getLogicalConnectionPort(Ports port, int srgCounter) {
+        String logicalConnectionPoint = null;
+        if (port.getLogicalConnectionPoint() != null) {
+            switch (port.getPortDirection()) {
+                case Tx:
+                    // Port direction is transmit
+                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint() + "-TX";
+                    } else {
+                        logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TX";
+                    }
+                    break;
+                case Rx:
+                    // Port direction is receive
+                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint() + "-RX";
+                    } else {
+                        logicalConnectionPoint = port.getLogicalConnectionPoint() + "-RX";
+                    }
+                    break;
+                case Bidirectional:
+                    // port is bidirectional
+                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint();
+                    } else {
+                        logicalConnectionPoint = port.getLogicalConnectionPoint();
+                    }
+                    if (!port.getLogicalConnectionPoint().endsWith("-TXRX")) {
+                        logicalConnectionPoint = logicalConnectionPoint.concat("-TXRX");
+                    }
+                    break;
+                default:
+                    // Unsupported Port direction
+                    LOG.error("Unsupported port direction for port {}  {}", port, port.getPortDirection());
+                    return null; // TODO return false or continue?
+            }
+            return logicalConnectionPoint;
+        }
+        LOG.warn("Unsupported port direction for port {} - {} - LogicalConnectionPoint is null",
+                 port, port.getPortDirection());
+        return null; // TODO return false or continue?
+    }
+
+    private HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+            .CircuitPacks>> getSrgCps(String deviceId, Info ordmInfo) {
+        HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+                .CircuitPacks>> cpPerSrg = new HashMap<>();
+        Integer maxSrg;
+        // Get value for max Srg from info subtree, required for iteration
+        // if not present assume to be 20 (temporary)
+        if (ordmInfo.getMaxSrgs() != null) {
+            maxSrg = ordmInfo.getMaxSrgs();
+        } else {
+            maxSrg = 20;
+        }
+        for (int srgCounter = 1; srgCounter <= maxSrg; srgCounter++) {
+            List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps =
+                    new ArrayList<>();
+            LOG.info("Getting Circuitpacks for Srg Number {}", srgCounter);
+            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(SharedRiskGroup.class, new SharedRiskGroupKey(srgCounter));
+            Optional<SharedRiskGroup> ordmSrgObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
+                LogicalDatastoreType.CONFIGURATION, srgIID,
+                Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+            if (ordmSrgObject.isPresent()) {
+                srgCps.addAll(ordmSrgObject.get().getCircuitPacks());
+                cpPerSrg.put(ordmSrgObject.get().getSrgNumber(), srgCps);
+            }
+        }
+        LOG.info("Device {} has {} Srg", deviceId, cpPerSrg.size());
+        return cpPerSrg;
+    }
+
+
+    private boolean createPpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
+        // Creating mapping data for SRG's PP
+        HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+                        .CircuitPacks>> srgCps = getSrgCps(nodeId, deviceInfo);
+        Set<Map.Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206
+                        .srg.CircuitPacks>>> circuitPacks = srgCps.entrySet();
+        for (Map.Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+                        .CircuitPacks>> entry : circuitPacks) {
+            Integer srgIndex = entry.getKey();
+            for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks cp : entry
+                    .getValue()) {
+                String circuitPackName = cp.getCircuitPackName();
+                InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                        .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName));
+                Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                    LogicalDatastoreType.OPERATIONAL, cpIID,
+                    Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+
+                if (!circuitPackObject.isPresent() || (circuitPackObject.get().getPorts() == null)) {
+                    LOG.warn("{} : Circuit pack {} not found or without ports.", nodeId, circuitPackName);
+                    continue; // TODO continue or return false?
+                }
+                CircuitPacks circuitPack = circuitPackObject.get();
+                for (Ports port : circuitPack.getPorts()) {
+                    if (port.getLogicalConnectionPoint() != null) {
+                        String logicalConnectionPoint = getLogicalConnectionPort(port, srgIndex);
+                        LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId, circuitPackName, port
+                                         .getPortName(),
+                                 logicalConnectionPoint);
+                        portMapList.add(createMappingObject(nodeId, port, circuitPackName, logicalConnectionPoint));
+                    } else if (Port.PortQual.RoadmInternal.equals(port.getPortQual())) {
+                        LOG.info("Port is internal, skipping Logical Connection Point missing for {} {}",
+                                 circuitPackName,
+                                 port.getPortName());
+                    } else if (port.getLogicalConnectionPoint() == null) {
+                        LOG.info("Value missing, Skipping Logical Connection Point missing for {} {}", circuitPackName,
+                                 port.getPortName());
+                    }
+                }
+            }
+        }
+        return true;
+    }
+
+    public boolean updateMapping(String nodeId, Mapping oldMapping) {
+
+
+        LOG.info("Updating Mapping Data {} for node {}", oldMapping, nodeId);
+        InstanceIdentifier<Ports> portIId = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+                CircuitPacks.class, new CircuitPacksKey(oldMapping.getSupportingCircuitPackName())).child(Ports.class,
+                    new PortsKey(oldMapping.getSupportingPort()));
+        if ((oldMapping != null) && (nodeId != null)) {
+            try {
+                Optional<Ports> portObject = deviceTransactionManager.getDataFromDevice(nodeId,
+                    LogicalDatastoreType.OPERATIONAL, portIId, Timeouts.DEVICE_READ_TIMEOUT,
+                        Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                if (portObject.isPresent()) {
+                    Ports port = portObject.get();
+                    Mapping newMapping = createMappingObject(nodeId, port, oldMapping.getSupportingCircuitPackName(),
+                                                             oldMapping.getLogicalConnectionPoint());
+
+                    final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
+                    InstanceIdentifier<Mapping> mapIID = InstanceIdentifier.create(Network.class).child(Nodes.class,
+                        new NodesKey(nodeId)).child(Mapping.class,
+                        new MappingKey(oldMapping.getLogicalConnectionPoint()));
+                    writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, mapIID, newMapping);
+                    CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
+                    submit.checkedGet();
+                    return true;
+                }
+                return false;
+            } catch (TransactionCommitFailedException e) {
+                LOG.error("Transaction Commit Error updating Mapping {} for node {}", oldMapping
+                        .getLogicalConnectionPoint(), nodeId, e);
+                return false;
+            }
+        } else {
+            LOG.error("Impossible to update mapping");
+            return false;
+        }
+    }
+
+    private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
+                                        String logicalConnectionPoint) {
+        MappingBuilder mpBldr = new MappingBuilder();
+        mpBldr.withKey(new MappingKey(logicalConnectionPoint)).setLogicalConnectionPoint(logicalConnectionPoint)
+                .setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
+
+        // Get OMS and OTS interface provisioned on the TTP's
+        if (logicalConnectionPoint.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) && (port.getInterfaces() != null)) {
+            for (Interfaces interfaces : port.getInterfaces()) {
+                try {
+                    Optional<Interface> openRoadmInterface = this.openRoadmInterfaces.getInterface(nodeId,
+                        interfaces.getInterfaceName());
+                    if (openRoadmInterface.isPresent()) {
+                        Class<? extends InterfaceType> interfaceType = openRoadmInterface.get().getType();
+                        // Check if interface type is OMS or OTS
+                        if (interfaceType.equals(OpenROADMOpticalMultiplex.class)) {
+                            mpBldr.setSupportingOms(interfaces.getInterfaceName());
+                        }
+                        if (interfaceType.equals(OpticalTransport.class)) {
+                            mpBldr.setSupportingOts(interfaces.getInterfaceName());
+                        }
+                    } else {
+                        LOG.warn("Interface {} from node {} was null!", interfaces.getInterfaceName(), nodeId);
+                    }
+                } catch (OpenRoadmInterfaceException ex) {
+                    LOG.warn("Error while getting interface {} from node {}!", interfaces.getInterfaceName(), nodeId,
+                             ex);
+                }
+            }
+        }
+        return mpBldr.build();
+    }
+
+    private List<CpToDegree> getCpToDegreeList(List<Degree> degrees, String nodeId,
+                                               Map<String, String> interfaceList) {
+        List<CpToDegree> cpToDegreeList = new ArrayList<>();
+        for (Degree degree : degrees) {
+            if (degree.getCircuitPacks() != null) {
+                LOG.info("Inside CP to degree list");
+                cpToDegreeList.addAll(degree.getCircuitPacks()
+                    .stream().map(cp -> createCpToDegreeObject(cp.getCircuitPackName() ,
+                    degree.getDegreeNumber().toString(), nodeId ,interfaceList)).collect(Collectors.toList()));
+            }
+        }
+        return cpToDegreeList;
+    }
+
+    private CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber, String nodeId,
+                                              Map<String, String> interfaceList) {
+        String interfaceName = null;
+        if (interfaceList.get(circuitPackName) !=  null) {
+            interfaceName = interfaceList.get(circuitPackName);
+        }
+        return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
+                .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
+    }
+
+    private static List<ConnectionPorts> getDegreePorts(List<Degree> degrees) {
+        return degrees.stream().filter(degree -> degree.getConnectionPorts() != null)
+                .flatMap(degree -> degree.getConnectionPorts().stream()).collect(Collectors.toList());
+    }
+
+    private Map<String, String> getEthInterfaceList(String nodeId) {
+        LOG.info("It is calling get ethernet interface");
+        Map<String, String> cpToInterfaceMap = new HashMap<>();
+        InstanceIdentifier<Lldp> lldpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                .child(Protocols.class).augmentation(Protocols1.class).child(Lldp.class);
+        Optional<Lldp> lldpObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+            LogicalDatastoreType.OPERATIONAL, lldpIID,
+            Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+        if (lldpObject.isPresent() && (lldpObject.get().getPortConfig() != null)) {
+            for (PortConfig portConfig : lldpObject.get().getPortConfig()) {
+                if (portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
+                    InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                            .child(Interface.class, new InterfaceKey(portConfig.getIfName()));
+                    Optional<Interface> interfaceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                        LogicalDatastoreType.OPERATIONAL, interfaceIID, Timeouts.DEVICE_READ_TIMEOUT,
+                            Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                    if (interfaceObject.isPresent() && (interfaceObject.get().getSupportingCircuitPackName() != null)) {
+                        String supportingCircuitPackName = interfaceObject.get().getSupportingCircuitPackName();
+                        cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
+                        InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier.create(OrgOpenroadmDevice
+                            .class).child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName));
+                        Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(
+                                nodeId, LogicalDatastoreType.OPERATIONAL, circuitPacksIID, Timeouts
+                                        .DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                        if (circuitPackObject.isPresent() && (circuitPackObject.get().getParentCircuitPack() != null)) {
+                            cpToInterfaceMap.put(circuitPackObject.get().getParentCircuitPack().getCircuitPackName() ,
+                                                 portConfig.getIfName());
+                        }
+                    }
+                }
+            }
+        } else {
+            LOG.warn("Couldnt find port config under LLDP for Node : {}", nodeId);
+        }
+        LOG.info("Processiong is done.. now returning..");
+        return cpToInterfaceMap;
+    }
+
+    private List<Degree> getDegrees(String deviceId, Info ordmInfo) {
+        List<Degree> degrees = new ArrayList<>();
+        Integer maxDegree;
+
+        // Get value for max degree from info subtree, required for iteration
+        // if not present assume to be 20 (temporary)
+        if (ordmInfo.getMaxDegrees() != null) {
+            maxDegree = ordmInfo.getMaxDegrees();
+        } else {
+            maxDegree = 20;
+        }
+
+        for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
+            LOG.info("Getting Connection ports for Degree Number {}", degreeCounter);
+            InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(Degree.class, new DegreeKey(degreeCounter));
+            Optional<Degree> ordmDegreeObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
+                LogicalDatastoreType.CONFIGURATION, deviceIID,
+                Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+            if (ordmDegreeObject.isPresent()) {
+                degrees.add(ordmDegreeObject.get());
+            } else {
+                LOG.info("Device has {} degree", degreeCounter - 1);
+                break;
+            }
+        }
+        return degrees;
+    }
+
+
+
+
+    private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
+        // Creating mapping data for degree TTP's
+
+        List<Degree> degrees = getDegrees(nodeId, deviceInfo);
+        List<ConnectionPorts> degreeConPorts = getDegreePorts(degrees);
+        Map<String, String> interfaceList = getEthInterfaceList(nodeId);
+        List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees, nodeId, interfaceList);
+        LOG.info("Map looks like this {}",interfaceList);
+
+        postPortMapping(deviceInfo, null, deviceInfo.getNodeType().getIntValue(), cpToDegreeList);
+
+        // Getting circuit-pack-name/port-name corresponding to TTP's
+        for (ConnectionPorts cp : degreeConPorts) {
+            String circuitPackName = cp.getCircuitPackName();
+            String portName = cp.getPortName().toString();
+            InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
+                    .child(Ports.class, new PortsKey(portName));
+
+            LOG.info("Fetching logical Connection Point value for port {} at circuit pack {}", portName,
+                     circuitPackName);
+            Optional<Ports> portObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                LogicalDatastoreType.OPERATIONAL, portIID,
+                Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+            if (portObject.isPresent()) {
+                Ports port = portObject.get();
+                if (port.getLogicalConnectionPoint() != null) {
+                    LOG.info("Logical Connection Point for {} {} is {}", circuitPackName, portName,
+                             port.getLogicalConnectionPoint());
+                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+                                                        port.getLogicalConnectionPoint()));
+                } else {
+                    LOG.warn("Logical Connection Point value is missing for {} {}", circuitPackName,
+                             port.getPortName());
+                }
+            } else {
+                LOG.warn("Port {} is not present in node {} in circuit pack {}!", portName, nodeId, circuitPackName);
+                continue; // TODO continue or return true?
+            }
+        }
+        return true;
+    }
+
+    private boolean createXpdrPortMapping(String nodeId, List<Mapping> portMapList) {
+        // Creating for Xponder Line and Client Ports
+        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class);
+        Optional<OrgOpenroadmDevice> deviceObject =
+                deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, deviceIID,
+                Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+
+        // Variable to keep track of number of line ports
+        int line = 1;
+        // Variable to keep track of number of client ports
+        int client = 1;
+        if (!deviceObject.isPresent() || deviceObject.get().getCircuitPacks() == null) {
+            LOG.warn("Circuit Packs are not present for {}", nodeId);
+            return false; // TODO return false or continue?
+        }
+
+        List<CircuitPacks> circuitPackList = deviceObject.get().getCircuitPacks();
+        circuitPackList.sort(Comparator.comparing(CircuitPack::getCircuitPackName));
+
+        for (CircuitPacks cp : circuitPackList) {
+            String circuitPackName = cp.getCircuitPackName();
+            if (cp.getPorts() == null) {
+                LOG.warn("Ports were not found for circuit pack: {}", circuitPackName);
+                continue;
+            }
+            for (Ports port : cp.getPorts()) {
+                if (Port.PortQual.XpdrNetwork.equals(port.getPortQual())) {
+                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+                                                        StringConstants.NETWORK_TOKEN + line));
+                    line++;
+                } else if (Port.PortQual.XpdrClient.equals(port.getPortQual())) {
+                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+                                                        StringConstants.CLIENT_TOKEN + client));
+                    client++;
+                } else {
+                    LOG.warn("Not supported type of port! Port type: {}", port.getPortQual());
+                }
+            }
+        }
+        return true;
+    }
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion22.java b/common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion22.java
new file mode 100644 (file)
index 0000000..f22d2db
--- /dev/null
@@ -0,0 +1,545 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.common.mapping;
+import com.google.common.util.concurrent.CheckedFuture;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.transportpce.common.Timeouts;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.Network;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.NetworkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.NodesKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegree;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.CpToDegreeKey;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.MappingKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.NodeTypes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.Port;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.CircuitPack;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.circuit.pack.Ports;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.circuit.pack.PortsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.circuit.packs.CircuitPacks;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.circuit.packs.CircuitPacksKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.degree.ConnectionPorts;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.Degree;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.DegreeKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.Protocols;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.port.Interfaces;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.InterfaceType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OpenROADMOpticalMultiplex;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OpticalTransport;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev171215.Protocols1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev171215.lldp.container.Lldp;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev171215.lldp.container.lldp.PortConfig;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+
+
+public class PortMappingVersion22 {
+    private static final Logger LOG = LoggerFactory.getLogger(PortMappingImpl.class);
+
+    private final DataBroker dataBroker;
+    private final DeviceTransactionManager deviceTransactionManager;
+    private final OpenRoadmInterfaces openRoadmInterfaces;
+
+    public PortMappingVersion22(DataBroker dataBroker, DeviceTransactionManager deviceTransactionManager,
+                                OpenRoadmInterfaces openRoadmInterfaces) {
+        this.dataBroker = dataBroker;
+        this.deviceTransactionManager = deviceTransactionManager;
+        this.openRoadmInterfaces = openRoadmInterfaces;
+    }
+
+    public boolean createMappingData(String nodeId) {
+
+        LOG.info("Create Mapping Data for node {}", nodeId);
+        List<Mapping> portMapList = new ArrayList<>();
+        InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
+        Optional<Info> deviceInfoOptional = this.deviceTransactionManager
+            .getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, infoIID,
+            Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+
+        Info deviceInfo;
+        if (deviceInfoOptional.isPresent()) {
+            deviceInfo = deviceInfoOptional.get();
+        } else {
+            LOG.warn("Device info subtree is absent for {}", nodeId);
+            return false;
+        }
+        if (deviceInfo.getNodeType() == null) {
+            LOG.error("Node type field is missing"); // TODO make mandatory in yang
+            return false;
+        }
+        switch (deviceInfo.getNodeType()) {
+
+            case Rdm:
+                // Get TTP port mapping
+                if (!createTtpPortMapping(nodeId, deviceInfo, portMapList)) {
+                    // return false if mapping creation for TTP's failed
+                    LOG.warn("Unable to create mapping for TTP's on node {}", nodeId);
+                    return false;
+                }
+
+                // Get PP port mapping
+                if (!createPpPortMapping(nodeId, deviceInfo, portMapList)) {
+                    // return false if mapping creation for PP's failed
+                    LOG.warn("Unable to create mapping for PP's on node {}", nodeId);
+                    return false;
+                }
+                break;
+            case Xpdr:
+                if (!createXpdrPortMapping(nodeId, portMapList)) {
+                    LOG.warn("Unable to create mapping for Xponder on node {}", nodeId);
+                    return false;
+                }
+                break;
+            default:
+                LOG.error("Unable to create mapping for node {} : unknown nodetype ", nodeId);
+                break;
+
+        }
+        return postPortMapping(deviceInfo, portMapList, deviceInfo.getNodeType().getIntValue(), null);
+    }
+
+    public boolean updateMapping(String nodeId, Mapping oldMapping) {
+
+
+        LOG.info("Updating Mapping Data {} for node {}", oldMapping, nodeId);
+        InstanceIdentifier<Ports> portIId = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+                CircuitPacks.class, new CircuitPacksKey(oldMapping.getSupportingCircuitPackName())).child(Ports.class,
+                    new PortsKey(oldMapping.getSupportingPort()));
+        if ((oldMapping != null) && (nodeId != null)) {
+            try {
+                Optional<Ports> portObject = deviceTransactionManager.getDataFromDevice(nodeId,
+                    LogicalDatastoreType.OPERATIONAL, portIId, Timeouts.DEVICE_READ_TIMEOUT,
+                    Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                if (portObject.isPresent()) {
+                    Ports port = portObject.get();
+                    Mapping newMapping = createMappingObject(nodeId, port, oldMapping.getSupportingCircuitPackName(),
+                                                             oldMapping.getLogicalConnectionPoint());
+
+                    final WriteTransaction writeTransaction = this.dataBroker.newWriteOnlyTransaction();
+                    InstanceIdentifier<Mapping> mapIID = InstanceIdentifier.create(Network.class).child(Nodes.class,
+                        new NodesKey(nodeId)).child(Mapping.class,
+                        new MappingKey(oldMapping.getLogicalConnectionPoint()));
+                    writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, mapIID, newMapping);
+                    CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
+                    submit.checkedGet();
+                    return true;
+                }
+                return false;
+            } catch (TransactionCommitFailedException e) {
+                LOG.error("Transaction Commit Error updating Mapping {} for node {}", oldMapping
+                        .getLogicalConnectionPoint(), nodeId, e);
+                return false;
+            }
+        } else {
+            LOG.error("Impossible to update mapping");
+            return false;
+        }
+    }
+
+    private boolean createXpdrPortMapping(String nodeId, List<Mapping> portMapList) {
+        // Creating for Xponder Line and Client Ports
+        InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class);
+        Optional<OrgOpenroadmDevice> deviceObject =
+                deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL, deviceIID,
+                    Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+
+        // Variable to keep track of number of line ports
+        int line = 1;
+        // Variable to keep track of number of client ports
+        int client = 1;
+        if (!deviceObject.isPresent() || (deviceObject.get().getCircuitPacks() == null)) {
+            LOG.warn("Circuit Packs are not present for {}", nodeId);
+            return false; // TODO return false or continue?
+        }
+
+        List<CircuitPacks> circuitPackList = deviceObject.get().getCircuitPacks();
+        circuitPackList.sort(Comparator.comparing(CircuitPack::getCircuitPackName));
+
+        for (CircuitPacks cp : circuitPackList) {
+            String circuitPackName = cp.getCircuitPackName();
+            if (cp.getPorts() == null) {
+                LOG.warn("Ports were not found for circuit pack: {}", circuitPackName);
+                continue;
+            }
+            for (Ports port : cp.getPorts()) {
+                if (Port.PortQual.XpdrNetwork.equals(port.getPortQual())) {
+                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+                                                        StringConstants.NETWORK_TOKEN + line));
+                    line++;
+                } else if (Port.PortQual.XpdrClient.equals(port.getPortQual())) {
+                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+                                                        StringConstants.CLIENT_TOKEN + client));
+                    client++;
+                } else {
+                    LOG.warn("Not supported type of port! Port type: {}", port.getPortQual());
+                }
+            }
+        }
+        return true;
+    }
+
+
+
+    private HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.srg
+            .CircuitPacks>> getSrgCps(String deviceId, Info ordmInfo) {
+        HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.srg
+                .CircuitPacks>> cpPerSrg = new HashMap<>();
+        Integer maxSrg;
+        // Get value for max Srg from info subtree, required for iteration
+        // if not present assume to be 20 (temporary)
+        if (ordmInfo.getMaxSrgs() != null) {
+            maxSrg = ordmInfo.getMaxSrgs();
+        } else {
+            maxSrg = 20;
+        }
+        for (int srgCounter = 1; srgCounter <= maxSrg; srgCounter++) {
+            List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.srg.CircuitPacks> srgCps =
+                    new ArrayList<>();
+            LOG.info("Getting Circuitpacks for Srg Number {}", srgCounter);
+            InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(SharedRiskGroup.class, new SharedRiskGroupKey(srgCounter));
+            Optional<SharedRiskGroup> ordmSrgObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
+                LogicalDatastoreType.CONFIGURATION, srgIID,
+                Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+            if (ordmSrgObject.isPresent()) {
+                srgCps.addAll(ordmSrgObject.get().getCircuitPacks());
+                cpPerSrg.put(ordmSrgObject.get().getSrgNumber(), srgCps);
+            }
+        }
+        LOG.info("Device {} has {} Srg", deviceId, cpPerSrg.size());
+        return cpPerSrg;
+    }
+
+    private boolean createPpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
+        // Creating mapping data for SRG's PP
+        HashMap<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.srg
+                .CircuitPacks>> srgCps = getSrgCps(nodeId, deviceInfo);
+        Set<Map.Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215
+                .srg.CircuitPacks>>> circuitPacks = srgCps.entrySet();
+        for (Map.Entry<Integer, List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.srg
+                .CircuitPacks>> entry : circuitPacks) {
+            Integer srgIndex = entry.getKey();
+            for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.srg.CircuitPacks cp : entry
+                    .getValue()) {
+                String circuitPackName = cp.getCircuitPackName();
+                InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                        .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName));
+                Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                    LogicalDatastoreType.OPERATIONAL, cpIID,
+                    Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+
+                if (!circuitPackObject.isPresent() || (circuitPackObject.get().getPorts() == null)) {
+                    LOG.warn("{} : Circuit pack {} not found or without ports.", nodeId, circuitPackName);
+                    continue; // TODO continue or return false?
+                }
+                CircuitPacks circuitPack = circuitPackObject.get();
+                for (Ports port : circuitPack.getPorts()) {
+                    if (port.getLogicalConnectionPoint() != null) {
+                        String logicalConnectionPoint = getLogicalConnectionPort(port, srgIndex);
+                        LOG.info("{} : Logical Connection Point for {} {} is {}", nodeId, circuitPackName, port
+                                         .getPortName(),
+                                 logicalConnectionPoint);
+                        portMapList.add(createMappingObject(nodeId, port, circuitPackName, logicalConnectionPoint));
+                    } else if (Port.PortQual.RoadmInternal.equals(port.getPortQual())) {
+                        LOG.info("Port is internal, skipping Logical Connection Point missing for {} {}",
+                                 circuitPackName,
+                                 port.getPortName());
+                    } else if (port.getLogicalConnectionPoint() == null) {
+                        LOG.info("Value missing, Skipping Logical Connection Point missing for {} {}", circuitPackName,
+                                 port.getPortName());
+                    }
+                }
+            }
+        }
+        return true;
+    }
+
+    private static String getLogicalConnectionPort(Ports port, int srgCounter) {
+        String logicalConnectionPoint = null;
+        if (port.getLogicalConnectionPoint() != null) {
+            switch (port.getPortDirection()) {
+                case Tx:
+                    // Port direction is transmit
+                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint() + "-TX";
+                    } else {
+                        logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TX";
+                    }
+                    break;
+                case Rx:
+                    // Port direction is receive
+                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint() + "-RX";
+                    } else {
+                        logicalConnectionPoint = port.getLogicalConnectionPoint() + "-RX";
+                    }
+                    break;
+                case Bidirectional:
+                    // port is bidirectional
+                    if (!port.getLogicalConnectionPoint().contains("SRG")) {
+                        logicalConnectionPoint = "SRG" + srgCounter + "-" + port.getLogicalConnectionPoint();
+                    } else {
+                        logicalConnectionPoint = port.getLogicalConnectionPoint();
+                    }
+                    if (!port.getLogicalConnectionPoint().endsWith("-TXRX")) {
+                        logicalConnectionPoint = logicalConnectionPoint.concat("-TXRX");
+                    }
+                    break;
+                default:
+                    // Unsupported Port direction
+                    LOG.error("Unsupported port direction for port {}  {}", port, port.getPortDirection());
+                    return null; // TODO return false or continue?
+            }
+            return logicalConnectionPoint;
+        }
+        LOG.warn("Unsupported port direction for port {} - {} - LogicalConnectionPoint is null",
+                 port, port.getPortDirection());
+        return null; // TODO return false or continue?
+    }
+
+
+    private List<Degree> getDegrees(String deviceId, Info ordmInfo) {
+        List<Degree> degrees = new ArrayList<>();
+        Integer maxDegree;
+
+        // Get value for max degree from info subtree, required for iteration
+        // if not present assume to be 20 (temporary)
+        if (ordmInfo.getMaxDegrees() != null) {
+            maxDegree = ordmInfo.getMaxDegrees();
+        } else {
+            maxDegree = 20;
+        }
+
+        for (int degreeCounter = 1; degreeCounter <= maxDegree; degreeCounter++) {
+            LOG.info("Getting Connection ports for Degree Number {}", degreeCounter);
+            InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(Degree.class, new DegreeKey(degreeCounter));
+            Optional<Degree> ordmDegreeObject = this.deviceTransactionManager.getDataFromDevice(deviceId,
+                LogicalDatastoreType.CONFIGURATION, deviceIID,
+                Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+            if (ordmDegreeObject.isPresent()) {
+                degrees.add(ordmDegreeObject.get());
+            } else {
+                LOG.info("Device has {} degree", degreeCounter - 1);
+                break;
+            }
+        }
+        return degrees;
+    }
+
+    private static List<ConnectionPorts> getDegreePorts(List<Degree> degrees) {
+        return degrees.stream().filter(degree -> degree.getConnectionPorts() != null)
+                .flatMap(degree -> degree.getConnectionPorts().stream()).collect(Collectors.toList());
+    }
+
+    private Map<String, String> getEthInterfaceList(String nodeId) {
+        LOG.info("It is calling get ethernet interface");
+        Map<String, String> cpToInterfaceMap = new HashMap<>();
+        InstanceIdentifier<Lldp> lldpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                .child(Protocols.class).augmentation(Protocols1.class).child(Lldp.class);
+        Optional<Lldp> lldpObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+            LogicalDatastoreType.OPERATIONAL, lldpIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+        if (lldpObject.isPresent() && (lldpObject.get().getPortConfig() != null)) {
+            for (PortConfig portConfig : lldpObject.get().getPortConfig()) {
+                if (portConfig.getAdminStatus().equals(PortConfig.AdminStatus.Txandrx)) {
+                    InstanceIdentifier<Interface> interfaceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                            .child(Interface.class, new InterfaceKey(portConfig.getIfName()));
+                    Optional<Interface> interfaceObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                        LogicalDatastoreType.OPERATIONAL, interfaceIID, Timeouts.DEVICE_READ_TIMEOUT,
+                        Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                    if (interfaceObject.isPresent() && (interfaceObject.get().getSupportingCircuitPackName() != null)) {
+                        String supportingCircuitPackName = interfaceObject.get().getSupportingCircuitPackName();
+                        cpToInterfaceMap.put(supportingCircuitPackName, portConfig.getIfName());
+                        InstanceIdentifier<CircuitPacks> circuitPacksIID = InstanceIdentifier.create(OrgOpenroadmDevice
+                            .class).child(CircuitPacks.class, new CircuitPacksKey(supportingCircuitPackName));
+                        Optional<CircuitPacks> circuitPackObject = this.deviceTransactionManager.getDataFromDevice(
+                                nodeId, LogicalDatastoreType.OPERATIONAL, circuitPacksIID, Timeouts
+                                        .DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+                        if (circuitPackObject.isPresent() && (circuitPackObject.get().getParentCircuitPack() != null)) {
+                            cpToInterfaceMap.put(circuitPackObject.get().getParentCircuitPack().getCircuitPackName(),
+                                                 portConfig.getIfName());
+                        }
+                    }
+                }
+            }
+        } else {
+            LOG.warn("Couldnt find port config under LLDP for Node : {}", nodeId);
+        }
+        LOG.info("Processiong is done.. now returning..");
+        return cpToInterfaceMap;
+    }
+
+    private List<CpToDegree> getCpToDegreeList(List<Degree> degrees, String nodeId,
+                                               Map<String, String> interfaceList) {
+        List<CpToDegree> cpToDegreeList = new ArrayList<>();
+        for (Degree degree : degrees) {
+            if (degree.getCircuitPacks() != null) {
+                LOG.info("Inside CP to degree list");
+                cpToDegreeList.addAll(degree.getCircuitPacks().stream()
+                    .map(cp -> createCpToDegreeObject(cp.getCircuitPackName(),
+                    degree.getDegreeNumber().toString(), nodeId, interfaceList)).collect(Collectors.toList()));
+            }
+        }
+        return cpToDegreeList;
+    }
+
+    private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList, Integer nodeType,
+                                    List<CpToDegree> cp2DegreeList) {
+        NodesBuilder nodesBldr = new NodesBuilder();
+        nodesBldr.withKey(new NodesKey(deviceInfo.getNodeId().getValue())).setNodeId(deviceInfo.getNodeId().getValue());
+        nodesBldr.setNodeType(NodeTypes.forValue(nodeType));
+        nodesBldr.setOpenroadmVersion(Nodes.OpenroadmVersion._121);
+        if (portMapList != null) {
+            nodesBldr.setMapping(portMapList);
+        }
+        if (cp2DegreeList != null) {
+            nodesBldr.setCpToDegree(cp2DegreeList);
+        }
+
+        List<Nodes> nodesList = new ArrayList<>();
+        nodesList.add(nodesBldr.build());
+
+        NetworkBuilder nwBldr = new NetworkBuilder();
+        nwBldr.setNodes(nodesList);
+
+        final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
+        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
+        Network network = nwBldr.build();
+        writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, network);
+        CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
+        try {
+            submit.checkedGet();
+            return true;
+
+        } catch (TransactionCommitFailedException e) {
+            LOG.warn("Failed to post {}", network, e);
+            return false;
+        }
+    }
+
+    private CpToDegree createCpToDegreeObject(String circuitPackName, String degreeNumber, String nodeId,
+                                              Map<String, String> interfaceList) {
+        String interfaceName = null;
+        if (interfaceList.get(circuitPackName) != null) {
+            interfaceName = interfaceList.get(circuitPackName);
+        }
+        return new CpToDegreeBuilder().withKey(new CpToDegreeKey(circuitPackName)).setCircuitPackName(circuitPackName)
+                .setDegreeNumber(new Long(degreeNumber)).setInterfaceName(interfaceName).build();
+    }
+
+    private Mapping createMappingObject(String nodeId, Ports port, String circuitPackName,
+                                        String logicalConnectionPoint) {
+        MappingBuilder mpBldr = new MappingBuilder();
+        mpBldr.withKey(new MappingKey(logicalConnectionPoint)).setLogicalConnectionPoint(logicalConnectionPoint)
+                .setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
+
+        // Get OMS and OTS interface provisioned on the TTP's
+        if (logicalConnectionPoint.contains(OpenRoadmInterfacesImpl.TTP_TOKEN) && (port.getInterfaces() != null)) {
+            for (Interfaces interfaces : port.getInterfaces()) {
+                try {
+                    Optional<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface>
+                        openRoadmInterface = this.openRoadmInterfaces
+                            .getInterface(nodeId, interfaces.getInterfaceName());
+                    if (openRoadmInterface.isPresent()) {
+                        Class<? extends InterfaceType> interfaceType = (Class<? extends InterfaceType>)
+                            openRoadmInterface.get().getType();
+                        // Check if interface type is OMS or OTS
+                        if (interfaceType.equals(OpenROADMOpticalMultiplex.class)) {
+                            mpBldr.setSupportingOms(interfaces.getInterfaceName());
+                        }
+                        if (interfaceType.equals(OpticalTransport.class)) {
+                            mpBldr.setSupportingOts(interfaces.getInterfaceName());
+                        }
+                    } else {
+                        LOG.warn("Interface {} from node {} was null!", interfaces.getInterfaceName(), nodeId);
+                    }
+                } catch (OpenRoadmInterfaceException ex) {
+                    LOG.warn("Error while getting interface {} from node {}!", interfaces.getInterfaceName(), nodeId,
+                             ex);
+                }
+            }
+        }
+        return mpBldr.build();
+    }
+
+    private boolean createTtpPortMapping(String nodeId, Info deviceInfo, List<Mapping> portMapList) {
+        // Creating mapping data for degree TTP's
+
+        List<Degree> degrees = getDegrees(nodeId, deviceInfo);
+        List<ConnectionPorts> degreeConPorts = getDegreePorts(degrees);
+        Map<String, String> interfaceList = getEthInterfaceList(nodeId);
+        List<CpToDegree> cpToDegreeList = getCpToDegreeList(degrees, nodeId, interfaceList);
+        LOG.info("Map looks like this {}", interfaceList);
+
+        postPortMapping(deviceInfo, null, deviceInfo.getNodeType().getIntValue(), cpToDegreeList);
+
+        // Getting circuit-pack-name/port-name corresponding to TTP's
+        for (ConnectionPorts cp : degreeConPorts) {
+            String circuitPackName = cp.getCircuitPackName();
+            String portName = cp.getPortName().toString();
+            InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+                    .child(CircuitPacks.class, new CircuitPacksKey(circuitPackName))
+                    .child(Ports.class, new PortsKey(portName));
+
+            LOG.info("Fetching logical Connection Point value for port {} at circuit pack {}", portName,
+                     circuitPackName);
+            Optional<Ports> portObject = this.deviceTransactionManager.getDataFromDevice(nodeId,
+                LogicalDatastoreType.OPERATIONAL, portIID, Timeouts.DEVICE_READ_TIMEOUT,
+                Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+            if (portObject.isPresent()) {
+                Ports port = portObject.get();
+                if (port.getLogicalConnectionPoint() != null) {
+                    LOG.info("Logical Connection Point for {} {} is {}", circuitPackName, portName,
+                             port.getLogicalConnectionPoint());
+                    portMapList.add(createMappingObject(nodeId, port, circuitPackName,
+                                                        port.getLogicalConnectionPoint()));
+                } else {
+                    LOG.warn("Logical Connection Point value is missing for {} {}", circuitPackName,
+                             port.getPortName());
+                }
+            } else {
+                LOG.warn("Port {} is not present in node {} in circuit pack {}!", portName, nodeId, circuitPackName);
+                continue; // TODO continue or return true?
+            }
+        }
+        return true;
+    }
+
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionImpl.java b/common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionImpl.java
new file mode 100644 (file)
index 0000000..b073de5
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright Â© 2017 AT&T, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.common.network;
+
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+
+
+public class NetworkTransactionImpl implements NetworkTransactionService {
+
+    RequestProcessor requestProcessor;
+
+    public NetworkTransactionImpl(RequestProcessor requestProcessor) {
+        this.requestProcessor = requestProcessor;
+
+    }
+
+    public <T extends DataObject> CheckedFuture<com.google.common.base.Optional<T>,
+        ReadFailedException> read(LogicalDatastoreType store, InstanceIdentifier<T> path) {
+        return requestProcessor.read(store, path);
+    }
+
+
+
+    public void delete(LogicalDatastoreType store, InstanceIdentifier<?> path) {
+        requestProcessor.delete(store, path);
+    }
+
+
+    public <T extends DataObject> void put(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data, boolean createMissingParents) {
+
+        requestProcessor.put(store, path, data, createMissingParents);
+    }
+
+    @Override
+    public <T extends DataObject> void put(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data) {
+        requestProcessor.put(store, path, data);
+    }
+
+    public ListenableFuture<Void> submit() {
+        return requestProcessor.submit();
+    }
+
+    @Override
+    public void close() {
+
+        requestProcessor.close();
+    }
+
+    public <T extends DataObject> void merge(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data) {
+        requestProcessor.merge(store, path, data);
+    }
+
+    public <T extends DataObject> void merge(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data, boolean createMissingParents) {
+
+        requestProcessor.merge(store, path, data, createMissingParents);
+    }
+
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionService.java b/common/src/main/java/org/opendaylight/transportpce/common/network/NetworkTransactionService.java
new file mode 100644 (file)
index 0000000..4313df1
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright Â© 2017 AT&T, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.common.network;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.ListenableFuture;
+
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+
+
+public interface NetworkTransactionService {
+
+    <T extends DataObject> CheckedFuture<Optional<T>, ReadFailedException> read(LogicalDatastoreType store,
+                                                                                InstanceIdentifier<T> path);
+
+    void delete(LogicalDatastoreType store, InstanceIdentifier<?> path);
+
+    <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
+                                    boolean createMissingParents);
+
+
+    <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path,T data);
+
+    <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data);
+
+    <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
+                                      boolean createMissingParents);
+
+    ListenableFuture<Void> submit();
+
+    void close();
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/network/RequestProcessor.java b/common/src/main/java/org/opendaylight/transportpce/common/network/RequestProcessor.java
new file mode 100644 (file)
index 0000000..f64c181
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright Â© 2017 Orange, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.transportpce.common.network;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+public class RequestProcessor {
+
+    private static final Logger LOG = LoggerFactory.getLogger(RequestProcessor.class);
+
+    private final DataBroker dataBroker;
+    private ReadWriteTransaction rwTx;
+    private ReadOnlyTransaction readTx;
+    private ReentrantReadWriteLock lock;
+
+
+
+    public RequestProcessor(DataBroker dataBroker) {
+        this.dataBroker = dataBroker;
+        rwTx = dataBroker.newReadWriteTransaction();
+        readTx = dataBroker.newReadOnlyTransaction();
+        lock = new ReentrantReadWriteLock();
+        LOG.info("RequestProcessor instantiated");
+
+    }
+
+    public <T extends DataObject> CheckedFuture<Optional<T>,
+        ReadFailedException> read(LogicalDatastoreType store,InstanceIdentifier<T> path) {
+
+        CheckedFuture<Optional<T>, ReadFailedException> result = null;
+        acquireReadLock();
+        LOG.debug("Number of threads in queue to read " + lock.getQueueLength());
+        result = rwTx.read(store, path);
+
+        releaseReadLock();
+        return result;
+    }
+
+    public <T extends DataObject> void delete(LogicalDatastoreType store, InstanceIdentifier<?> path) {
+
+        acquireLock();
+        LOG.info("Number of delete requests waiting in queue :" + lock.getQueueLength());
+        rwTx.delete(store, path);
+    }
+
+    public <T extends DataObject> void put(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data, boolean createMissingParents) {
+
+        acquireLock();
+        LOG.debug("Number of put requests waiting in queue :" + lock.getQueueLength());
+        rwTx.put(store, path, data, createMissingParents);
+    }
+
+    public <T extends DataObject> void put(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data) {
+
+        acquireLock();
+        LOG.debug("Number of put requests waiting in queue :" + lock.getQueueLength());
+        rwTx.put(store, path, data);
+    }
+
+
+    public <T extends DataObject> void merge(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data, boolean createMissingParents) {
+
+        acquireLock();
+        LOG.debug("Number of merge requests waiting in queue :" + lock.getQueueLength());
+        rwTx.merge(store, path, data, createMissingParents);
+    }
+
+    public <T extends DataObject> void merge(LogicalDatastoreType store,
+        InstanceIdentifier<T> path, T data) {
+
+        acquireLock();
+        LOG.debug("Number of merge requests waiting in queue :" + lock.getQueueLength());
+        rwTx.merge(store, path, data);
+    }
+
+    public ListenableFuture<Void> submit() {
+        acquireLock();
+        ListenableFuture<Void> future = null;
+        future = rwTx.submit();
+        releaseLock();
+        resetRwTx();
+        return future;
+    }
+
+    public void close() {
+        releaseLock();
+    }
+
+    private void acquireLock() {
+        if (!lock.writeLock().isHeldByCurrentThread()) {
+            lock.writeLock().lock();
+            LOG.debug("Number of write lock requests waiting in queue :" + lock.getQueueLength());
+            LOG.info("Write Lock acquired by : " + Thread.currentThread().getName());
+            rwTx = resetRwTx();
+        } else {
+            LOG.debug("Lock already acquired by : " + Thread.currentThread().getName());
+        }
+    }
+
+    private void acquireReadLock() {
+        if (lock.getReadHoldCount() > 0) {
+            LOG.info("Read Lock already acquired by : " + Thread.currentThread().getName());
+        } else {
+            lock.readLock().lock();
+            rwTx = resetRwTx();
+            LOG.info("Read Lock acquired by : " + Thread.currentThread().getName());
+        }
+    }
+
+    private void releaseLock() {
+        if (lock.writeLock().isHeldByCurrentThread()) {
+            LOG.info("Write Lock released by : " + Thread.currentThread().getName());
+            lock.writeLock().unlock();
+        }
+    }
+
+    private void releaseReadLock() {
+        LOG.info("Read Lock released by : " + Thread.currentThread().getName());
+        lock.readLock().unlock();
+    }
+
+    private ReadWriteTransaction resetRwTx() {
+        LOG.info("Resetting the read write transaction .....");
+        rwTx = dataBroker.newReadWriteTransaction();
+        return rwTx;
+    }
+}
index fa45f1913f300518d0272300c9a4186febdd680c..f2c10a2978176ea473776cc5b64015463a1fe41e 100644 (file)
@@ -10,9 +10,6 @@ package org.opendaylight.transportpce.common.openroadminterfaces;
 
 import java.util.Optional;
 
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
-
 public interface OpenRoadmInterfaces {
 
     /**
@@ -32,7 +29,7 @@ public interface OpenRoadmInterfaces {
      * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
      *
      */
-    void postInterface(String nodeId, InterfaceBuilder ifBuilder) throws OpenRoadmInterfaceException;
+    <T> void postInterface(String nodeId, T ifBuilder) throws OpenRoadmInterfaceException;
 
     /**
      * This methods does an edit-config operation on the openROADM device in
@@ -62,7 +59,7 @@ public interface OpenRoadmInterfaces {
      *
      * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
      */
-    Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;
+    <T> Optional<T> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;
 
     /**
      * This methods does an edit-config operation on the openROADM device in
index 5492eb5c11b3c29ec4b3066d9365bea6afb2b5d7..eba991d2fae8719aa9a3a823cc9674cdb298d9c7 100644 (file)
 
 package org.opendaylight.transportpce.common.openroadminterfaces;
 
-import com.google.common.util.concurrent.ListenableFuture;
+import static org.opendaylight.transportpce.common.StringConstants.OPENROADM_DEVICE_VERSION_1_2_1;
+import static org.opendaylight.transportpce.common.StringConstants.OPENROADM_DEVICE_VERSION_2_2;
+
 import java.util.Optional;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.transportpce.common.Timeouts;
-import org.opendaylight.transportpce.common.device.DeviceTransaction;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev161014.AdminStates;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev161014.States;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOdu;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOtu;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.maintenance.loopback.rev161014.maint.loopback.MaintLoopbackBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.maintenance.testsignal.rev161014.maint.testsignal.MaintTestsignalBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.odu.container.OduBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 public class OpenRoadmInterfacesImpl implements OpenRoadmInterfaces {
 
     private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfacesImpl.class);
 
+    private final DeviceTransactionManager deviceTransactionManager;
+    OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    MappingUtils mappingUtils;
+
     // TODO move somewhere to constants
     public static final String NETWORK_TOKEN = "NETWORK";
     public static final String TTP_TOKEN = "TTP";
     public static final String CLIENT_TOKEN = "CLIENT";
     public static final String PP_TOKEN = "PP";
 
-    private final DeviceTransactionManager deviceTransactionManager;
 
-    public OpenRoadmInterfacesImpl(DeviceTransactionManager deviceTransactionManager) {
+    public OpenRoadmInterfacesImpl(DeviceTransactionManager deviceTransactionManager,MappingUtils mappingUtils,
+        OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121,OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22) {
         this.deviceTransactionManager = deviceTransactionManager;
+        this.mappingUtils = mappingUtils;
+        this.openRoadmInterfacesImpl121 = openRoadmInterfacesImpl121;
+        this.openRoadmInterfacesImpl22 = openRoadmInterfacesImpl22;
     }
 
     @Override
-    public void postInterface(String nodeId, InterfaceBuilder ifBuilder) throws OpenRoadmInterfaceException {
-        Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(nodeId);
-        DeviceTransaction deviceTx;
-        try {
-            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
-            if (deviceTxOpt.isPresent()) {
-                deviceTx = deviceTxOpt.get();
-            } else {
-                throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
-                    nodeId));
-            }
-        } catch (InterruptedException | ExecutionException e) {
-            throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
-                nodeId), e);
+    public <T> void postInterface(String nodeId, T ifBuilder) throws OpenRoadmInterfaceException {
+
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        LOG.info("Interface post request received for node {} with version {}",nodeId,openRoadmVersion);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            LOG.info("Device Version is 1.2.1");
+            InterfaceBuilder ifBuilder121 = convertInstanceOfInterface(ifBuilder, InterfaceBuilder.class);
+            openRoadmInterfacesImpl121.postInterface(nodeId,ifBuilder121);
         }
-
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
-            Interface.class, new InterfaceKey(ifBuilder.getName()));
-        deviceTx.put(LogicalDatastoreType.CONFIGURATION, interfacesIID, ifBuilder.build());
-        ListenableFuture<Void> txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
-            Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
-        try {
-            txSubmitFuture.get();
-            LOG.info("Successfully posted interface {} on node {}", ifBuilder.getName(), nodeId);
-        } catch (InterruptedException | ExecutionException e) {
-            throw new OpenRoadmInterfaceException(String.format("Failed to post interface %s on node %s!", ifBuilder
-                .getName(), nodeId), e);
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.InterfaceBuilder
+                ifBuilder22 = convertInstanceOfInterface(ifBuilder, org.opendaylight.yang.gen.v1.http.org.openroadm
+                .device.rev171215.interfaces.grp.InterfaceBuilder.class);
+            openRoadmInterfacesImpl22.postInterface(nodeId,ifBuilder22);
         }
     }
 
     @Override
-    public Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
-        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
-            Interface.class, new InterfaceKey(interfaceName));
-        return this.deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.CONFIGURATION,
-            interfacesIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+    public <T> Optional<T>  getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
+
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        LOG.info("Interface get request received for node {} with version {}",nodeId,openRoadmVersion);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            LOG.info("Device Version is 1.2.1");
+            return (Optional<T>) openRoadmInterfacesImpl121.getInterface(nodeId,interfaceName);
+        }
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            return (Optional<T>) openRoadmInterfacesImpl22.getInterface(nodeId,interfaceName);
+        }
+        return null;
     }
 
     @Override
-    public void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
-        Optional<Interface> intf2DeleteOpt;
-        try {
-            intf2DeleteOpt = getInterface(nodeId, interfaceName);
-        } catch (OpenRoadmInterfaceException e) {
-            throw new OpenRoadmInterfaceException(String.format("Failed to check if interface %s exists on node %s!",
-                interfaceName, nodeId), e);
+    public void deleteInterface(String nodeId, String interfaceName)
+        throws OpenRoadmInterfaceException {
+
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
+        LOG.info("Interface delete request received for node {} with version {}",nodeId,openRoadmVersion);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            LOG.info("Device Version is 1.2.1");
+            openRoadmInterfacesImpl121.deleteInterface(nodeId,interfaceName);
         }
-        if (intf2DeleteOpt.isPresent()) {
-            Interface intf2Delete = intf2DeleteOpt.get();
-            // State admin state to out of service
-            InterfaceBuilder ifBuilder = new InterfaceBuilder(intf2Delete);
-            if (ifBuilder.getType() == OtnOdu.class) {
-                Interface1Builder oduBuilder = new Interface1Builder(intf2Delete.augmentation(Interface1.class));
-                OduBuilder odu = new OduBuilder(oduBuilder.getOdu());
-                if (odu.getMaintTestsignal() != null) {
-                    MaintTestsignalBuilder maintSignalBuilder = new MaintTestsignalBuilder();
-                    maintSignalBuilder.setEnabled(false);
-                    odu.setMaintTestsignal(maintSignalBuilder.build());
-                }
-                oduBuilder.setOdu(odu.build());
-                ifBuilder.addAugmentation(Interface1.class, oduBuilder.build());
-            } else if (ifBuilder.getType() == OtnOtu.class) {
-                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder
-                    otuBuilder =
-                    new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder(
-                        intf2Delete.augmentation(
-                        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class));
-                OtuBuilder otu = new OtuBuilder(otuBuilder.getOtu());
-                if (otu.getMaintLoopback() != null) {
-                    MaintLoopbackBuilder maintLoopBackBuilder = new MaintLoopbackBuilder();
-                    maintLoopBackBuilder.setEnabled(false);
-                    otu.setMaintLoopback(maintLoopBackBuilder.build());
-                }
-                otuBuilder.setOtu(otu.build());
-                ifBuilder.addAugmentation(
-                    org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class,
-                    otuBuilder.build());
-            }
-            ifBuilder.setAdministrativeState(AdminStates.OutOfService);
-            // post interface with updated admin state
-            try {
-                postInterface(nodeId, ifBuilder);
-            } catch (OpenRoadmInterfaceException ex) {
-                throw new OpenRoadmInterfaceException(String.format("Failed to set state of interface %s to %s while"
-                    + " deleting it!", interfaceName, AdminStates.OutOfService), ex);
-            }
-
-            InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
-                Interface.class, new InterfaceKey(interfaceName));
-            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(
-                nodeId);
-            DeviceTransaction deviceTx;
-            try {
-                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
-                if (deviceTxOpt.isPresent()) {
-                    deviceTx = deviceTxOpt.get();
-                } else {
-                    throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
-                        nodeId));
-                }
-            } catch (InterruptedException | ExecutionException e) {
-                throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
-                    nodeId), e);
-            }
-
-            deviceTx.delete(LogicalDatastoreType.CONFIGURATION, interfacesIID);
-            ListenableFuture<Void> submit = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
-                Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
-
-            try {
-                submit.get();
-                LOG.info("Successfully deleted {} on node {}", interfaceName, nodeId);
-            } catch (InterruptedException | ExecutionException e) {
-                throw new OpenRoadmInterfaceException(String.format("Failed to delete interface %s on " + "node %s",
-                    interfaceName, nodeId), e);
-            }
-            // change the equipment state on circuit pack if xpdr node
-            if (intf2Delete.getName().contains(OpenRoadmInterfacesImpl.CLIENT_TOKEN) || intf2Delete.getName().contains(
-                OpenRoadmInterfacesImpl.NETWORK_TOKEN)) {
-                postEquipmentState(nodeId, intf2Delete.getSupportingCircuitPackName(), false);
-            }
-
-        } else {
-            LOG.info("Interface does not exist, cannot delete on node {}", nodeId);
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            openRoadmInterfacesImpl22.deleteInterface(nodeId,interfaceName);
         }
     }
 
     @Override
     public void postEquipmentState(String nodeId, String circuitPackName, boolean activate)
         throws OpenRoadmInterfaceException {
+        String openRoadmVersion = mappingUtils.getOpenRoadmVersion(nodeId);
 
-        InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
-            CircuitPacks.class, new CircuitPacksKey(circuitPackName));
-        Optional<CircuitPacks> cpOpt = this.deviceTransactionManager.getDataFromDevice(nodeId,
-            LogicalDatastoreType.CONFIGURATION, circuitPackIID, Timeouts.DEVICE_READ_TIMEOUT,
-            Timeouts.DEVICE_READ_TIMEOUT_UNIT);
-        CircuitPacks cp = null;
-        if (cpOpt.isPresent()) {
-            cp = cpOpt.get();
-        } else {
-            throw new OpenRoadmInterfaceException(String.format(
-                "Could not find CircuitPack %s in equipment config datastore for node %s", circuitPackName, nodeId));
-        }
-        CircuitPacksBuilder cpBldr = new CircuitPacksBuilder(cp);
-        boolean change = false;
-        if (activate) {
-            if (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedInuse)) {
-                cpBldr.setEquipmentState(States.NotReservedInuse);
-                change = true;
-            }
-        } else if (
-            (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedAvailable))) {
-            cpBldr.setEquipmentState(States.NotReservedAvailable);
-            change = true;
+        LOG.info("Interface delete request received for node {} with version {}",nodeId,openRoadmVersion);
+        if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_1_2_1)) {
+            LOG.info("Device Version is 1.2.1");
+            openRoadmInterfacesImpl121.postEquipmentState(nodeId, circuitPackName, activate);
         }
-        if (change) {
-            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(
-                nodeId);
-            DeviceTransaction deviceTx;
-            try {
-                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
-                if (deviceTxOpt.isPresent()) {
-                    deviceTx = deviceTxOpt.get();
-                } else {
-                    throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
-                        nodeId));
-                }
-            } catch (InterruptedException | ExecutionException e) {
-                throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
-                    nodeId), e);
-            }
-            deviceTx.put(LogicalDatastoreType.CONFIGURATION, circuitPackIID, cpBldr.build());
-            ListenableFuture<Void> txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
-                Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
-            try {
-                txSubmitFuture.get();
-                LOG.info("Successfully posted equipment state change on node {}", nodeId);
-            } catch (InterruptedException | ExecutionException e) {
-                throw new OpenRoadmInterfaceException(String.format("Failed to post equipment state on node %s!",
-                    nodeId), e);
-            }
+        else if (openRoadmVersion.equals(OPENROADM_DEVICE_VERSION_2_2)) {
+            openRoadmInterfacesImpl22.postEquipmentState(nodeId, circuitPackName, activate);
         }
+
     }
 
+    private <T> T convertInstanceOfInterface(Object object, Class<T> classToCast) {
+        try {
+            return classToCast.cast(object);
+        } catch (ClassCastException e) {
+            return null;
+        }
+    }
 }
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java b/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl121.java
new file mode 100755 (executable)
index 0000000..3eddbcb
--- /dev/null
@@ -0,0 +1,235 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.common.openroadminterfaces;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.transportpce.common.Timeouts;
+import org.opendaylight.transportpce.common.device.DeviceTransaction;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev161014.AdminStates;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev161014.States;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOdu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOtu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.maintenance.loopback.rev161014.maint.loopback.MaintLoopbackBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.maintenance.testsignal.rev161014.maint.testsignal.MaintTestsignalBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.Interface1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev161014.odu.container.OduBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.otu.container.OtuBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenRoadmInterfacesImpl121 {
+
+    private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfacesImpl121.class);
+
+    private final DeviceTransactionManager deviceTransactionManager;
+
+    public OpenRoadmInterfacesImpl121(DeviceTransactionManager deviceTransactionManager) {
+        this.deviceTransactionManager = deviceTransactionManager;
+    }
+
+    public void postInterface(String nodeId, InterfaceBuilder ifBuilder) throws OpenRoadmInterfaceException {
+        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(nodeId);
+        DeviceTransaction deviceTx;
+        try {
+            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+            if (deviceTxOpt.isPresent()) {
+                deviceTx = deviceTxOpt.get();
+            } else {
+                throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
+                    nodeId));
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
+                nodeId), e);
+        }
+
+        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+            Interface.class, new InterfaceKey(ifBuilder.getName()));
+        deviceTx.put(LogicalDatastoreType.CONFIGURATION, interfacesIID, ifBuilder.build());
+        ListenableFuture<Void> txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+            Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+        try {
+            txSubmitFuture.get();
+            LOG.info("Successfully posted interface {} on node {}", ifBuilder.getName(), nodeId);
+        } catch (InterruptedException | ExecutionException e) {
+            throw new OpenRoadmInterfaceException(String.format("Failed to post interface %s on node %s!", ifBuilder
+                .getName(), nodeId), e);
+        }
+    }
+
+
+    public Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
+        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+            .child(Interface.class, new InterfaceKey(interfaceName));
+        return deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.CONFIGURATION,
+            interfacesIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+    }
+
+
+    public void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
+        Optional<Interface> intf2DeleteOpt;
+        try {
+            intf2DeleteOpt = getInterface(nodeId, interfaceName);
+        } catch (OpenRoadmInterfaceException e) {
+            throw new OpenRoadmInterfaceException(String.format("Failed to check if interface %s exists on node %s!",
+                interfaceName, nodeId), e);
+        }
+        if (intf2DeleteOpt.isPresent()) {
+            Interface intf2Delete = intf2DeleteOpt.get();
+            // State admin state to out of service
+            InterfaceBuilder ifBuilder = new InterfaceBuilder(intf2Delete);
+            if (ifBuilder.getType() == OtnOdu.class) {
+                Interface1Builder oduBuilder = new Interface1Builder(intf2Delete.augmentation(Interface1.class));
+                OduBuilder odu = new OduBuilder(oduBuilder.getOdu());
+                if (odu.getMaintTestsignal() != null) {
+                    MaintTestsignalBuilder maintSignalBuilder = new MaintTestsignalBuilder();
+                    maintSignalBuilder.setEnabled(false);
+                    odu.setMaintTestsignal(maintSignalBuilder.build());
+                }
+                oduBuilder.setOdu(odu.build());
+                ifBuilder.addAugmentation(Interface1.class, oduBuilder.build());
+            } else if (ifBuilder.getType() == OtnOtu.class) {
+                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder
+                    otuBuilder =
+                    new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1Builder(
+                        intf2Delete.augmentation(
+                            org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1
+                                .class));
+                OtuBuilder otu = new OtuBuilder(otuBuilder.getOtu());
+                if (otu.getMaintLoopback() != null) {
+                    MaintLoopbackBuilder maintLoopBackBuilder = new MaintLoopbackBuilder();
+                    maintLoopBackBuilder.setEnabled(false);
+                    otu.setMaintLoopback(maintLoopBackBuilder.build());
+                }
+                otuBuilder.setOtu(otu.build());
+                ifBuilder.addAugmentation(
+                    org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev161014.Interface1.class,
+                    otuBuilder.build());
+            }
+            ifBuilder.setAdministrativeState(AdminStates.OutOfService);
+            // post interface with updated admin state
+            try {
+                postInterface(nodeId, ifBuilder);
+            } catch (OpenRoadmInterfaceException ex) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to set state of interface %s to %s while"
+                    + " deleting it!", interfaceName, AdminStates.OutOfService), ex);
+            }
+
+            InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+                Interface.class, new InterfaceKey(interfaceName));
+            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(
+                nodeId);
+            DeviceTransaction deviceTx;
+            try {
+                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+                if (deviceTxOpt.isPresent()) {
+                    deviceTx = deviceTxOpt.get();
+                } else {
+                    throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
+                        nodeId));
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
+                    nodeId), e);
+            }
+
+            deviceTx.delete(LogicalDatastoreType.CONFIGURATION, interfacesIID);
+            ListenableFuture<Void> submit = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+                Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+
+            try {
+                submit.get();
+                LOG.info("Successfully deleted {} on node {}", interfaceName, nodeId);
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to delete interface %s on " + "node %s",
+                    interfaceName, nodeId), e);
+            }
+            // change the equipment state on circuit pack if xpdr node
+            if (intf2Delete.getName().contains(StringConstants.CLIENT_TOKEN) || intf2Delete.getName().contains(
+                StringConstants.NETWORK_TOKEN)) {
+                postEquipmentState(nodeId, intf2Delete.getSupportingCircuitPackName(), false);
+            }
+
+        } else {
+            LOG.info("Interface does not exist, cannot delete on node {}", nodeId);
+        }
+    }
+
+    public void postEquipmentState(String nodeId, String circuitPackName, boolean activate)
+        throws OpenRoadmInterfaceException {
+
+        InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+            CircuitPacks.class, new CircuitPacksKey(circuitPackName));
+        Optional<CircuitPacks> cpOpt = this.deviceTransactionManager.getDataFromDevice(nodeId,
+            LogicalDatastoreType.CONFIGURATION, circuitPackIID, Timeouts.DEVICE_READ_TIMEOUT,
+            Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+        CircuitPacks cp = null;
+        if (cpOpt.isPresent()) {
+            cp = cpOpt.get();
+        } else {
+            throw new OpenRoadmInterfaceException(String.format(
+                "Could not find CircuitPack %s in equipment config datastore for node %s", circuitPackName, nodeId));
+        }
+        CircuitPacksBuilder cpBldr = new CircuitPacksBuilder(cp);
+        boolean change = false;
+        if (activate) {
+            if (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedInuse)) {
+                cpBldr.setEquipmentState(States.NotReservedInuse);
+                change = true;
+            }
+        } else if (
+            (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedAvailable))) {
+            cpBldr.setEquipmentState(States.NotReservedAvailable);
+            change = true;
+        }
+        if (change) {
+            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(
+                nodeId);
+            DeviceTransaction deviceTx;
+            try {
+                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+                if (deviceTxOpt.isPresent()) {
+                    deviceTx = deviceTxOpt.get();
+                } else {
+                    throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
+                        nodeId));
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
+                    nodeId), e);
+            }
+            deviceTx.put(LogicalDatastoreType.CONFIGURATION, circuitPackIID, cpBldr.build());
+            ListenableFuture<Void> txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+                Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+            try {
+                txSubmitFuture.get();
+                LOG.info("Successfully posted equipment state change on node {}", nodeId);
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to post equipment state on node %s!",
+                    nodeId), e);
+            }
+        }
+    }
+
+}
diff --git a/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl22.java b/common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl22.java
new file mode 100755 (executable)
index 0000000..b4cd4cc
--- /dev/null
@@ -0,0 +1,235 @@
+/*
+ * Copyright Â© 2017 AT&T and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.common.openroadminterfaces;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.transportpce.common.Timeouts;
+import org.opendaylight.transportpce.common.device.DeviceTransaction;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.circuit.packs.CircuitPacks;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.circuit.packs.CircuitPacksBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.circuit.packs.CircuitPacksKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.InterfaceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev171215.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev171215.AdminStates;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev171215.States;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OtnOdu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OtnOtu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.maintenance.loopback.rev171215.maint.loopback.MaintLoopbackBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.maintenance.testsignal.rev171215.maint.testsignal.MaintTestsignalBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.Interface1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.Interface1Builder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev171215.odu.container.OduBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.otu.container.OtuBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenRoadmInterfacesImpl22 {
+
+    private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfacesImpl22.class);
+
+    private final DeviceTransactionManager deviceTransactionManager;
+
+    public OpenRoadmInterfacesImpl22(DeviceTransactionManager deviceTransactionManager) {
+        this.deviceTransactionManager = deviceTransactionManager;
+    }
+
+    public void postInterface(String nodeId, InterfaceBuilder ifBuilder) throws OpenRoadmInterfaceException {
+        Future<Optional<DeviceTransaction>> deviceTxFuture = deviceTransactionManager.getDeviceTransaction(nodeId);
+        DeviceTransaction deviceTx;
+        try {
+            Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+            if (deviceTxOpt.isPresent()) {
+                deviceTx = deviceTxOpt.get();
+            } else {
+                throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
+                    nodeId));
+            }
+        } catch (InterruptedException | ExecutionException e) {
+            throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
+                nodeId), e);
+        }
+
+        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+            Interface.class, new InterfaceKey(ifBuilder.getName()));
+        deviceTx.put(LogicalDatastoreType.CONFIGURATION, interfacesIID, ifBuilder.build());
+        ListenableFuture<Void> txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+            Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+        try {
+            txSubmitFuture.get();
+            LOG.info("Successfully posted interface {} on node {}", ifBuilder.getName(), nodeId);
+        } catch (InterruptedException | ExecutionException e) {
+            throw new OpenRoadmInterfaceException(String.format("Failed to post interface %s on node %s!", ifBuilder
+                .getName(), nodeId), e);
+        }
+    }
+
+
+    public Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
+        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class)
+            .child(Interface.class, new InterfaceKey(interfaceName));
+        return deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.CONFIGURATION,
+            interfacesIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+    }
+
+
+    public void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
+        Optional<Interface> intf2DeleteOpt;
+        try {
+            intf2DeleteOpt = getInterface(nodeId, interfaceName);
+        } catch (OpenRoadmInterfaceException e) {
+            throw new OpenRoadmInterfaceException(String.format("Failed to check if interface %s exists on node %s!",
+                interfaceName, nodeId), e);
+        }
+        if (intf2DeleteOpt.isPresent()) {
+            Interface intf2Delete = intf2DeleteOpt.get();
+            // State admin state to out of service
+            InterfaceBuilder ifBuilder = new InterfaceBuilder(intf2Delete);
+            if (ifBuilder.getType() == OtnOdu.class) {
+                Interface1Builder oduBuilder = new Interface1Builder(intf2Delete.augmentation(Interface1.class));
+                OduBuilder odu = new OduBuilder(oduBuilder.getOdu());
+                if (odu.getMaintTestsignal() != null) {
+                    MaintTestsignalBuilder maintSignalBuilder = new MaintTestsignalBuilder();
+                    maintSignalBuilder.setEnabled(false);
+                    odu.setMaintTestsignal(maintSignalBuilder.build());
+                }
+                oduBuilder.setOdu(odu.build());
+                ifBuilder.addAugmentation(Interface1.class, oduBuilder.build());
+            } else if (ifBuilder.getType() == OtnOtu.class) {
+                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.Interface1Builder
+                    otuBuilder =
+                    new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.Interface1Builder(
+                        intf2Delete.augmentation(
+                            org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.Interface1
+                            .class));
+                OtuBuilder otu = new OtuBuilder(otuBuilder.getOtu());
+                if (otu.getMaintLoopback() != null) {
+                    MaintLoopbackBuilder maintLoopBackBuilder = new MaintLoopbackBuilder();
+                    maintLoopBackBuilder.setEnabled(false);
+                    otu.setMaintLoopback(maintLoopBackBuilder.build());
+                }
+                otuBuilder.setOtu(otu.build());
+                ifBuilder.addAugmentation(
+                    org.opendaylight.yang.gen.v1.http.org.openroadm.otn.otu.interfaces.rev171215.Interface1.class,
+                    otuBuilder.build());
+            }
+            ifBuilder.setAdministrativeState(AdminStates.OutOfService);
+            // post interface with updated admin state
+            try {
+                postInterface(nodeId, ifBuilder);
+            } catch (OpenRoadmInterfaceException ex) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to set state of interface %s to %s while"
+                    + " deleting it!", interfaceName, AdminStates.OutOfService), ex);
+            }
+
+            InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+                Interface.class, new InterfaceKey(interfaceName));
+            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(
+                nodeId);
+            DeviceTransaction deviceTx;
+            try {
+                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+                if (deviceTxOpt.isPresent()) {
+                    deviceTx = deviceTxOpt.get();
+                } else {
+                    throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
+                        nodeId));
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
+                    nodeId), e);
+            }
+
+            deviceTx.delete(LogicalDatastoreType.CONFIGURATION, interfacesIID);
+            ListenableFuture<Void> submit = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+                Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+
+            try {
+                submit.get();
+                LOG.info("Successfully deleted {} on node {}", interfaceName, nodeId);
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to delete interface %s on " + "node %s",
+                    interfaceName, nodeId), e);
+            }
+            // change the equipment state on circuit pack if xpdr node
+            if (intf2Delete.getName().contains(StringConstants.CLIENT_TOKEN) || intf2Delete.getName().contains(
+                StringConstants.NETWORK_TOKEN)) {
+                postEquipmentState(nodeId, intf2Delete.getSupportingCircuitPackName(), false);
+            }
+
+        } else {
+            LOG.info("Interface does not exist, cannot delete on node {}", nodeId);
+        }
+    }
+
+    public void postEquipmentState(String nodeId, String circuitPackName, boolean activate)
+        throws OpenRoadmInterfaceException {
+
+        InstanceIdentifier<CircuitPacks> circuitPackIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+            CircuitPacks.class, new CircuitPacksKey(circuitPackName));
+        Optional<CircuitPacks> cpOpt = this.deviceTransactionManager.getDataFromDevice(nodeId,
+            LogicalDatastoreType.CONFIGURATION, circuitPackIID, Timeouts.DEVICE_READ_TIMEOUT,
+            Timeouts.DEVICE_READ_TIMEOUT_UNIT);
+        CircuitPacks cp = null;
+        if (cpOpt.isPresent()) {
+            cp = cpOpt.get();
+        } else {
+            throw new OpenRoadmInterfaceException(String.format(
+                "Could not find CircuitPack %s in equipment config datastore for node %s", circuitPackName, nodeId));
+        }
+        CircuitPacksBuilder cpBldr = new CircuitPacksBuilder(cp);
+        boolean change = false;
+        if (activate) {
+            if (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedInuse)) {
+                cpBldr.setEquipmentState(States.NotReservedInuse);
+                change = true;
+            }
+        } else if (
+            (cpBldr.getEquipmentState() != null && !cpBldr.getEquipmentState().equals(States.NotReservedAvailable))) {
+            cpBldr.setEquipmentState(States.NotReservedAvailable);
+            change = true;
+        }
+        if (change) {
+            Future<Optional<DeviceTransaction>> deviceTxFuture = this.deviceTransactionManager.getDeviceTransaction(
+                nodeId);
+            DeviceTransaction deviceTx;
+            try {
+                Optional<DeviceTransaction> deviceTxOpt = deviceTxFuture.get();
+                if (deviceTxOpt.isPresent()) {
+                    deviceTx = deviceTxOpt.get();
+                } else {
+                    throw new OpenRoadmInterfaceException(String.format("Device transaction was not found for node %s!",
+                        nodeId));
+                }
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to obtain device transaction for node %s!",
+                    nodeId), e);
+            }
+            deviceTx.put(LogicalDatastoreType.CONFIGURATION, circuitPackIID, cpBldr.build());
+            ListenableFuture<Void> txSubmitFuture = deviceTx.submit(Timeouts.DEVICE_WRITE_TIMEOUT,
+                Timeouts.DEVICE_WRITE_TIMEOUT_UNIT);
+            try {
+                txSubmitFuture.get();
+                LOG.info("Successfully posted equipment state change on node {}", nodeId);
+            } catch (InterruptedException | ExecutionException e) {
+                throw new OpenRoadmInterfaceException(String.format("Failed to post equipment state on node %s!",
+                    nodeId), e);
+            }
+        }
+    }
+
+}
index bf4bcc9557f58435ed4c424acc571ef475ff5afc..a65c62477aacbc87897fda980cd51d5e79e40287 100644 (file)
@@ -30,16 +30,43 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
         <argument ref="openRoadmInterfaces" />
     </bean>
 
-    <bean id="crossConnect" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl" >
+    <bean id="mappingUtils" class="org.opendaylight.transportpce.common.mapping.MappingUtilsImpl" >
+        <argument ref="dataBroker" />
+    </bean>
+
+    <bean id="crossConnect121" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl1_2_1" >
         <argument ref="deviceTransactionManager" />
     </bean>
 
-    <service ref="deviceTransactionManager" interface="org.opendaylight.transportpce.common.device.DeviceTransactionManager" />
+    <bean id="crossConnect22" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl2_2" >
+        <argument ref="deviceTransactionManager" />
+    </bean>
 
-    <service ref="openRoadmInterfaces" interface="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces" />
+    <bean id="crossConnectImpl" class="org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl" >
+        <argument ref="deviceTransactionManager" />
+        <argument ref="mappingUtils" />
+        <argument ref="crossConnect121" />
+        <argument ref="crossConnect22" />
+    </bean>
 
-    <service ref="portMapping" interface="org.opendaylight.transportpce.common.mapping.PortMapping" />
+    <bean id="requestProcessor" class="org.opendaylight.transportpce.common.network.RequestProcessor" scope="singleton" >
+        <argument ref="dataBroker" />
+    </bean>
+
+    <bean id="networkTransactionImpl" class="org.opendaylight.transportpce.common.network.NetworkTransactionImpl">
+        <argument ref="requestProcessor" />
+    </bean>
+
+    <bean id="FixedFlexImpl" class="org.opendaylight.transportpce.common.FixedFlex.FixedFlexImpl" >
+    </bean>
 
+    <service ref="deviceTransactionManager" interface="org.opendaylight.transportpce.common.device.DeviceTransactionManager" />
+    <service ref="networkTransactionImpl" interface="org.opendaylight.transportpce.common.network.NetworkTransactionService" />
+    <service ref="mappingUtils" interface="org.opendaylight.transportpce.common.mapping.MappingUtils" />
+    <service ref="openRoadmInterfaces" interface="org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces" />
+    <service ref="portMapping" interface="org.opendaylight.transportpce.common.mapping.PortMapping" />
     <service ref="crossConnect" interface="org.opendaylight.transportpce.common.crossconnect.CrossConnect" />
+    <service ref="FixedFlexImpl" interface="org.opendaylight.transportpce.common.FixedFlex.FixedFlexInterface"/>
+
 
 </blueprint>
diff --git a/common/src/test/java/org/opendaylight/transportpce/common/NetworkTransaction b/common/src/test/java/org/opendaylight/transportpce/common/NetworkTransaction
new file mode 100644 (file)
index 0000000..d4981c1
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright Â© 2017 AT&T, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.common.NetworkTransaction;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.transportpce.common.NetworkUtils;
+import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
+import org.opendaylight.transportpce.common.network.NetworkTransactionService;
+import org.opendaylight.transportpce.common.network.RequestProcessor;
+import org.opendaylight.transportpce.test.AbstractTest;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.Network;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkId;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NetworkKey;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+
+public class NetworkTransactionServiceTest extends AbstractTest {
+
+    private NetworkTransactionService networkTransactionService;
+    private LogicalDatastoreType defaultDatastore = LogicalDatastoreType.CONFIGURATION;
+    private NetworkBuilder nwBuilder = new NetworkBuilder();
+    private NetworkId nwId = new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID);
+    private Network defaultData;
+    ExecutorService executor;
+
+
+    private static final Logger LOG = LoggerFactory
+            .getLogger(NetworkTransactionServiceTest.class);
+
+    InstanceIdentifier<Network> nwInstanceIdentifier = InstanceIdentifier
+            .builder(Network.class,
+                    new NetworkKey(
+                            new NetworkId(NetworkUtils.OVERLAY_NETWORK_ID)))
+            .build();
+
+
+    @Before
+    public void instantiate() {
+
+        networkTransactionService = new NetworkTransactionImpl(new RequestProcessor(getDataBroker()));
+        nwBuilder.setNetworkId(nwId);
+        nwBuilder.setKey(nwBuilder.getKey());
+        defaultData = nwBuilder.build();
+        executor = Executors.newFixedThreadPool(3);
+
+    }
+
+    @Test
+    public void WhenOneThreadIsWritingOtherThreadsAreWaiting() {
+
+        Thread t1 = new Thread(runnable);
+        Thread t2 = new Thread(runnable);
+        Thread t3 = new Thread(runnable);
+
+        t1.start();
+        t2.start();
+        t3.start();
+
+        //Check thread 2 is waiting to acquire lock when thread 1 is executing
+        Assert.assertTrue(t2.getState().equals(Thread.State.WAITING));
+
+        LOG.info(t3.getState().toString());
+        //Check thread 3 is waiting to acquire lock when thread 1 is executing
+        Assert.assertTrue(t3.getState().equals(Thread.State.WAITING));
+
+        try {
+            t1.join();
+            //Check thread 3 is waiting to acquire lock when thread 1 is finished and thread is still in executing
+            Assert.assertTrue(t3.getState().equals(Thread.State.WAITING));
+            t2.join();
+            t3.join();
+        } catch (InterruptedException e) {
+          LOG.error(e.getMessage());
+        }
+    }
+
+    Runnable runnable = new Runnable() {
+        @Override
+        public void run() {
+            networkTransactionService.merge(defaultDatastore, nwInstanceIdentifier, defaultData);
+            try {
+
+                //Add delay to mock thread execution delay
+                Thread.sleep(10000);
+            } catch (InterruptedException e) {
+                LOG.error(e.getMessage());
+            }
+            networkTransactionService.submit();
+
+        }
+    };
+}
index bfda307dee31d8bf27278c9cdbb70241e41859dd..cf8541edc833c9d54c1c2723e6e39b4cb8c0f41e 100644 (file)
@@ -9,11 +9,13 @@
 package org.opendaylight.transportpce.olm;
 
 import com.google.common.util.concurrent.ListenableFuture;
+
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -21,12 +23,20 @@ import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.olm.power.PowerMgmt;
 import org.opendaylight.transportpce.olm.service.OlmPowerService;
 import org.opendaylight.transportpce.olm.service.OlmPowerServiceImpl;
@@ -79,6 +89,13 @@ public class OlmPowerServiceRpcImplTest extends AbstractTest {
     private PowerMgmt powerMgmt;
     private OlmPowerService olmPowerService;
     private OlmPowerServiceRpcImpl olmPowerServiceRpc;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
 
     @Before
@@ -86,10 +103,21 @@ public class OlmPowerServiceRpcImplTest extends AbstractTest {
         this.mountPoint = new MountPointStub(this.getDataBroker());
         this.mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl((this.deviceTransactionManager));
-        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
-            this.openRoadmInterfaces);
+        this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
+                this.crossConnectImpl121, this.crossConnectImpl22);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+        this.portMappingVersion22 =
+                new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMappingVersion121 =
+                new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
         this.powerMgmt = new PowerMgmt(this.getDataBroker(), this.openRoadmInterfaces, this.crossConnect,
             this.deviceTransactionManager);
         this.olmPowerService = new OlmPowerServiceImpl(this.getDataBroker(), this.powerMgmt,
index 2a8cec9bdb3d1fc9418b3ff272d53bb46b076935..c02a61d2bc399a440f09e4c708270212872103d1 100644 (file)
@@ -16,12 +16,20 @@ import org.opendaylight.controller.md.sal.binding.api.MountPointService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.olm.power.PowerMgmt;
 import org.opendaylight.transportpce.olm.service.OlmPowerService;
 import org.opendaylight.transportpce.olm.service.OlmPowerServiceImpl;
@@ -43,16 +51,34 @@ public class OlmProviderTest extends AbstractTest {
     private OlmPowerService olmPowerService;
     private RpcProviderRegistry rpcProviderRegistry;
     private OlmProvider olmProvider;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
     @Before
     public void setUp() {
         this.mountPoint = new MountPointStub(this.getDataBroker());
         this.mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl((this.deviceTransactionManager));
-        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
-            this.openRoadmInterfaces);
+        this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
+                this.crossConnectImpl121, this.crossConnectImpl22);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+        this.portMappingVersion22 = new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager,
+                this.openRoadmInterfaces);
+        this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager,
+                this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
         this.powerMgmt = new PowerMgmt(this.getDataBroker(), this.openRoadmInterfaces, this.crossConnect,
             this.deviceTransactionManager);
         this.olmPowerService = new OlmPowerServiceImpl(this.getDataBroker(), this.powerMgmt,
index 8c57f8608b8b8645b60a1eecaf71bd632729e5fe..03041193da40859bbdc27005508bc63e926c93ba 100644 (file)
@@ -9,19 +9,30 @@
 package org.opendaylight.transportpce.olm.power;
 
 import java.util.List;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.StringConstants;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.olm.stub.MountPointServiceStub;
 import org.opendaylight.transportpce.olm.stub.MountPointStub;
 import org.opendaylight.transportpce.olm.util.OlmPowerServiceRpcImplUtil;
@@ -39,16 +50,35 @@ public class PowerMgmtTest extends AbstractTest {
     private OpenRoadmInterfaces openRoadmInterfaces;
     private PortMapping portMapping;
     private PowerMgmt powerMgmt;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
     @Before
     public void setUp() {
         this.mountPoint = new MountPointStub(this.getDataBroker());
         this.mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl((this.deviceTransactionManager));
-        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
-            this.openRoadmInterfaces);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.mappingUtils = Mockito.spy(this.mappingUtils);
+        this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
+                this.crossConnectImpl121, this.crossConnectImpl22);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+        this.portMappingVersion22 =
+                new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMappingVersion121 =
+                new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
         this.powerMgmt = new PowerMgmt(this.getDataBroker(), this.openRoadmInterfaces, this.crossConnect,
             this.deviceTransactionManager);
     }
@@ -133,6 +163,8 @@ public class PowerMgmtTest extends AbstractTest {
             Thread.sleep(500);
         }
         ServicePowerSetupInput input = OlmPowerServiceRpcImplUtil.getServicePowerSetupInput3();
+        Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
+                .getOpenRoadmVersion("node 1");
         boolean output = this.powerMgmt.setPower(input);
         Assert.assertEquals(false, output);
     }
@@ -145,6 +177,8 @@ public class PowerMgmtTest extends AbstractTest {
             Thread.sleep(500);
         }
         ServicePowerSetupInput input = OlmPowerServiceRpcImplUtil.getServicePowerSetupInput4();
+        Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
+                .getOpenRoadmVersion("node 1");
         boolean output = this.powerMgmt.setPower(input);
         Assert.assertEquals(true, output);
     }
@@ -169,6 +203,8 @@ public class PowerMgmtTest extends AbstractTest {
             Thread.sleep(500);
         }
         ServicePowerSetupInput input = OlmPowerServiceRpcImplUtil.getServicePowerSetupInput2();
+        Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
+                .getOpenRoadmVersion("node 1");
         boolean output = this.powerMgmt.setPower(input);
         Assert.assertEquals(true, output);
     }
index 6ec03219cb22ef3f73a6ac4cc8ce9f4eb0c4c214..93d138879eb8d08743853bee5e4001cc66b03ba5 100644 (file)
@@ -19,12 +19,20 @@ import org.opendaylight.controller.md.sal.binding.api.MountPointService;
 import org.opendaylight.transportpce.common.NetworkUtils;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.olm.power.PowerMgmt;
 import org.opendaylight.transportpce.olm.stub.MountPointServiceStub;
 import org.opendaylight.transportpce.olm.stub.MountPointStub;
@@ -68,6 +76,13 @@ public class OlmPowerServiceImplTest  extends AbstractTest {
     private PowerMgmt powerMgmtMock;
     @InjectMocks
     private OlmPowerService olmPowerServiceMock;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
 
 
@@ -76,10 +91,21 @@ public class OlmPowerServiceImplTest  extends AbstractTest {
         this.mountPoint = new MountPointStub(this.getDataBroker());
         this.mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl((this.deviceTransactionManager));
-        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
-            this.openRoadmInterfaces);
+        this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
+                this.crossConnectImpl121, this.crossConnectImpl22);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+        this.portMappingVersion22 =
+                new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMappingVersion121 =
+                new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
         this.powerMgmt = new PowerMgmt(this.getDataBroker(), this.openRoadmInterfaces, this.crossConnect,
             this.deviceTransactionManager);
         this.olmPowerService = new OlmPowerServiceImpl(this.getDataBroker(), this.powerMgmt,
diff --git a/ordmodels/common/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev171215/PmDataTypeBuilder.java b/ordmodels/common/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev171215/PmDataTypeBuilder.java
new file mode 100644 (file)
index 0000000..7fc9678
--- /dev/null
@@ -0,0 +1,23 @@
+package org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev171215;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+public class PmDataTypeBuilder {
+    private PmDataTypeBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static PmDataType getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
index 5ed8792b6e2737a3579149229b528f2c15a333c3..ec04efd9e12c2731550b13d58300f1fd26f7b252 100644 (file)
@@ -7,12 +7,15 @@ module org-openroadm-alarm {
   }
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
+    revision-date 2016-10-14;
   }
   import org-openroadm-resource {
     prefix org-openroadm-resource;
+    revision-date 2016-10-14;
   }
   import org-openroadm-probable-cause {
     prefix org-openroadm-probable-cause;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -20,31 +23,31 @@ module org-openroadm-alarm {
     "OpenROADM.org";
   description
     "YANG definitions of an alarm.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-alarm@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-alarm@2017-12-15.yang
new file mode 100644 (file)
index 0000000..dca04b7
--- /dev/null
@@ -0,0 +1,132 @@
+module org-openroadm-alarm {
+  namespace "http://org/openroadm/alarm";
+  prefix org-openroadm-alarm;
+
+  import ietf-yang-types {
+    prefix yang;
+    revision-date 2013-07-15;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-resource {
+    prefix org-openroadm-resource;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-probable-cause {
+    prefix org-openroadm-probable-cause;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of an alarm.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping alarm {
+    leaf id {
+      type string;
+      mandatory true;
+      description
+        "Uniquely id for this alarm, within the given management domain";
+    }
+    container resource {
+      description
+        "Resource under alarm";
+      uses org-openroadm-resource:resource;
+    }
+    container probableCause {
+      description
+        "Probable cause of alarm";
+      uses org-openroadm-probable-cause:probable-cause;
+    }
+    leaf raiseTime {
+      type yang:date-and-time;
+      mandatory true;
+      description
+        "Time alarm was raised";
+    }
+    leaf severity {
+      type org-openroadm-common-types:severity;
+      mandatory true;
+      description
+        "Severity of alarm. Based on X.733 perceived severity.";
+    }
+    leaf circuit-id {
+      type string;
+      description
+        "Circuit-id for alarm correlation.";
+    }
+    leaf additional-detail {
+      type string;
+      description
+        "Provide additional descriptive text about the probable cause.";
+    }
+    leaf corrective-action {
+      type string;
+      description
+        "Provide recommended corrective actions for this probable cause, i.e. replace or restart a circuit pack, check wiring for the reported source, or secondary failure to be correlated ";
+    }
+  }
+
+  notification alarm-notification {
+    description
+      "Notification sent on initial alarm creation, as well as any time the alarm changes state, including clear";
+    uses alarm;
+  }
+  container active-alarm-list {
+    config false;
+    description
+      "List of currently active alarms. An alarm is removed from this table when the state transitions to clear.";
+    list activeAlarms {
+      key "id";
+      uses alarm;
+    }
+  }
+}
index e52b12bea67d9540288aaf60dfcf34bd31ad1fa6..35ea26be15d41dc59d5be8d8fa6ee174d3c9247d 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-common-types {
     "OpenROADM.org";
   description
     "YANG definitions of common types.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
@@ -89,7 +89,7 @@ module org-openroadm-common-types {
       fraction-digits 3;
     }
     units "dB";
-  }
+  } 
 
   typedef severity {
     description
index 5957348ea7633e3bd9d7afb6b73e42bd660a4c88..91845db183cc6ebcf3d1ffbfaaf092de4bf941f0 100644 (file)
@@ -8,31 +8,31 @@ module org-openroadm-common-types {
     "OpenROADM.org";
   description
     "YANG definitions of common types.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2017-09-29 {
@@ -204,9 +204,9 @@ module org-openroadm-common-types {
 
   typedef amplifier-gain-range {
     description
-      "Operational mode for the amplifier:
+      "Operational mode for the amplifier:  
        this parameter allows modeling different operational modes (gain ranges) ,notably for switched-gain amplifiers.
-       It indicates which performance model shall be used by the path feasibility engine.
+       It indicates which performance model shall be used by the path feasibility engine. 
        For standard amplifier, or when performance evaluation is based on incremental noise, use gain-range-1.
        When performance evaluation is based on advanced parameters, specify used gain-range (1 to 4).
        Up to release 2.1, only gain-range-1 is to be used (default value) ";
@@ -263,7 +263,7 @@ module org-openroadm-common-types {
       enum "commit" {
         value 2;
         description
-          "commit the software or database.
+          "commit the software or database. 
            For software activate, this event can happen in the following scenarios:
              1) immediately when user issue db-activate command without rollBackTimer
                 or if the rollBackTimer is specified as 00-00-00;
@@ -279,7 +279,7 @@ module org-openroadm-common-types {
           "cancel the database or software activation operation.
            For software activate, this event can happen in the following cases:
              1) when the rollBackTimer expires;
-             2) when the user issues cancel-rollback-timer with accept=false.
+             2) when the user issues cancel-rollback-timer with accept=false.  
            For database activate, this event can happen in the following cases:
              1) when the rollBackTimer expires;
              2) when the user issues cancel-rollback-timer with accept=false.";
similarity index 83%
rename from ordmodels/common/src/main/yang/org-openroadm-common-types@2017-06-26.yang
rename to ordmodels/common/src/main/yang/org-openroadm-common-types@2017-12-15.yang
index 7b19a91b286f1dec6b0ea3ae46ed4b1a07048b8f..0a1c2faa02acd045e7a16942229391ad803fff2f 100644 (file)
@@ -8,33 +8,41 @@ module org-openroadm-common-types {
     "OpenROADM.org";
   description
     "YANG definitions of common types.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
   revision 2017-06-26 {
     description
       "Version 2.0";
@@ -44,23 +52,33 @@ module org-openroadm-common-types {
       "Version 1.2";
   }
 
-  grouping physical-location {
-    leaf rack {
-      type string;
-      mandatory false;
-    }
-    leaf shelf {
-      type string;
-      mandatory false;
-    }
-    leaf slot {
-      type string;
-      mandatory false;
-    }
-    leaf subSlot {
-      type string;
-      mandatory false;
-    }
+  identity och-rate-identity {
+    description
+      "A unique och rate identification";
+  }
+
+  identity R200G {
+    base och-rate-identity;
+    description
+      "Identity for 200G Rate";
+  }
+
+  identity R100G {
+    base och-rate-identity;
+    description
+      "Identity for 100G Rate";
+  }
+
+  identity R10.7G {
+    base och-rate-identity;
+    description
+      "Identity for 10.7G Rate";
+  }
+
+  identity R11.1G {
+    base och-rate-identity;
+    description
+      "Identity for 11.1G Rate";
   }
 
   typedef node-types {
@@ -86,6 +104,21 @@ module org-openroadm-common-types {
        4. extplug for external plugable";
   }
 
+  typedef node-id-type {
+    type string {
+      length "7..63";
+      pattern "([a-zA-Z][a-zA-Z0-9-]{5,18}[a-zA-Z0-9])" {
+        error-message
+          "A node-id must be 7 to 63 characters in length.
+           A node-id can contain letters, numbers, and hyphens.
+           The first character must be a letter.
+           The last character must be a letter or number.";
+      }
+    }
+    description
+      "Globally unique identifer for a device.";
+  }
+
   typedef xpdr-node-types {
     type enumeration {
       enum "tpdr" {
@@ -94,94 +127,120 @@ module org-openroadm-common-types {
       enum "mpdr" {
         value 2;
       }
+      enum "switch" {
+        value 3;
+      }
+      enum "regen" {
+        value 4;
+      }
+      enum "regen-uni" {
+        value 5;
+      }
     }
     description
       "Identifier for Xponder node type
        1. Transponder
-       2. Muxponder";
+       2. Muxponder
+       3. OTN switchponder
+       4. Regenerator
+       5. Regenerator based on unidirectional model";
   }
 
   typedef frequency-THz {
-    description
-      "Frequency value in THz.";
     type decimal64 {
       fraction-digits 8;
     }
     units "THz";
+    description
+      "Frequency value in THz.";
   }
 
   typedef frequency-GHz {
-    description
-      "Frequency value in GHz.";
     type decimal64 {
       fraction-digits 5;
     }
     units "GHz";
+    description
+      "Frequency value in GHz.";
   }
 
   typedef power-dBm {
-    description
-      "Power value in dBm.";
     type decimal64 {
       fraction-digits 2;
     }
     units "dBm";
+    description
+      "Power value in dBm.";
   }
 
   typedef ratio-dB {
-    description
-      "Power ratio in dB.";
     type decimal64 {
       fraction-digits 3;
     }
     units "dB";
+    description
+      "Power ratio in dB.";
   }
 
   typedef fiber-pmd {
-    description
-      "Polarization Mode Dispersion expressed in ps/km(1/2).";
     type decimal64 {
       fraction-digits 2;
     }
     units "ps/(km[1/2])";
+    description
+      "Polarization Mode Dispersion expressed in ps/km(1/2).";
   }
 
   typedef amplifier-types {
     type enumeration {
-      enum "std" {
+      enum "standard" {
         value 1;
       }
     }
     description
-      "3 digit identifier for amplifier type
-       1. std for standard amplifier as defined initially
+      "identifier for amplifier type
+       1. standard for amplifier as defined initially in the ROADM MSA specifications
        To be completed if/when additional amplifier types are required ";
   }
 
-  typedef amplifier-operational-mode {
+  typedef line-amplifier-control-mode {
+    type enumeration {
+      enum "gainLoss" {
+        value 2;
+      }
+      enum "off" {
+        value 3;
+      }
+    }
     description
-      "Operational mode for the amplifier: this parameter will
-       allow modeling different operational modes for switch-gain amplifiers
-       The enum is to be completed/modified when new amplifiers are specified ";
+      "Identifies the line amplifier control mode, either off or gain.";
+  }
+
+  typedef amplifier-gain-range {
     type enumeration {
-      enum "Mode1" {
+      enum "gain-range-1" {
         value 1;
       }
-      enum "Mode2" {
+      enum "gain-range-2" {
         value 2;
       }
-      enum "Mode3" {
+      enum "gain-range-3" {
         value 3;
       }
-      enum "Mode4" {
+      enum "gain-range-4" {
         value 4;
       }
     }
+    description
+      "Operational mode for the amplifier:  
+       this parameter allows modeling different operational modes (gain ranges) ,notably for switched-gain amplifiers.
+       It indicates which performance model shall be used by the path feasibility engine. 
+       For standard amplifier, or when performance evaluation is based on incremental noise, use gain-range-1.
+       When performance evaluation is based on advanced parameters, specify used gain-range (1 to 4).
+       Up to release 2.1, only gain-range-1 is to be used (default value) ";
   }
 
   typedef severity {
-    description
-      "Severity, based on X.733 perceived severity";
     type enumeration {
       enum "critical" {
         value 1;
@@ -202,11 +261,11 @@ module org-openroadm-common-types {
         value 6;
       }
     }
+    description
+      "Severity, based on X.733 perceived severity";
   }
 
   typedef activate-notification-type {
-    description
-      "Type of notification on software or database activation events";
     type enumeration {
       enum "activate" {
         value 1;
@@ -216,7 +275,7 @@ module org-openroadm-common-types {
       enum "commit" {
         value 2;
         description
-          "commit the software or database.
+          "commit the software or database. 
            For software activate, this event can happen in the following scenarios:
              1) immediately when user issue db-activate command without rollBackTimer
                 or if the rollBackTimer is specified as 00-00-00;
@@ -232,17 +291,17 @@ module org-openroadm-common-types {
           "cancel the database or software activation operation.
            For software activate, this event can happen in the following cases:
              1) when the rollBackTimer expires;
-             2) when the user issues cancel-rollback-timer with accept=false.
+             2) when the user issues cancel-rollback-timer with accept=false.  
            For database activate, this event can happen in the following cases:
              1) when the rollBackTimer expires;
              2) when the user issues cancel-rollback-timer with accept=false.";
       }
     }
+    description
+      "Type of notification on software or database activation events";
   }
 
   typedef rpc-status {
-    description
-      "status of RPC ";
     type enumeration {
       enum "Successful" {
         value 1;
@@ -251,25 +310,11 @@ module org-openroadm-common-types {
         value 2;
       }
     }
-  }
-
-  grouping rpc-response-status {
-    leaf status {
-      type rpc-status;
-      mandatory true;
-      description
-        "Successful or Failed";
-    }
-    leaf status-message {
-      type string;
-      description
-        "Gives a more detailed status";
-    }
+    description
+      "status of RPC ";
   }
 
   typedef extended-rpc-status {
-    description
-      "status of RPC ";
     type enumeration {
       enum "Successful" {
         value 1;
@@ -281,25 +326,11 @@ module org-openroadm-common-types {
         value 3;
       }
     }
-  }
-
-  grouping extended-rpc-response-status {
-    leaf status {
-      type extended-rpc-status;
-      mandatory true;
-      description
-        "Successful, Failed or In-progress";
-    }
-    leaf status-message {
-      type string;
-      description
-        "Gives a more detailed status.";
-    }
+    description
+      "status of RPC ";
   }
 
   typedef lifecycle-state {
-    description
-      "Lifecycle state.";
     type enumeration {
       enum "deployed" {
         value 1;
@@ -325,12 +356,18 @@ module org-openroadm-common-types {
       enum "draft" {
         value 8;
       }
+      enum "deploy-failed" {
+        value 9;
+      }
+      enum "undeploy-failed" {
+        value 10;
+      }
     }
+    description
+      "Lifecycle state.";
   }
 
   typedef state {
-    description
-      "State that indicates whether the resource is able to provide fullfill its role - carry traffic, etc.";
     type enumeration {
       enum "inService" {
         value 1;
@@ -342,6 +379,8 @@ module org-openroadm-common-types {
         value 3;
       }
     }
+    description
+      "State that indicates whether the resource is able to provide fullfill its role - carry traffic, etc.";
   }
 
   typedef optic-types {
@@ -355,21 +394,6 @@ module org-openroadm-common-types {
     }
   }
 
-  grouping equipment-type {
-    leaf type {
-      type equipment-type-enum;
-      mandatory true;
-      config false;
-    }
-    leaf extension {
-      description
-        "Populated with equipment type when enum value is set to vendorExtension";
-      type string;
-      mandatory false;
-      config false;
-    }
-  }
-
   typedef equipment-type-enum {
     type enumeration {
       enum "other" {
@@ -397,8 +421,6 @@ module org-openroadm-common-types {
   }
 
   typedef optical-control-mode {
-    description
-      "Optical Control Mode: identifies specific algorithm related to power management and general optical control.";
     type enumeration {
       enum "power" {
         value 1;
@@ -410,6 +432,8 @@ module org-openroadm-common-types {
         value 3;
       }
     }
+    description
+      "Optical Control Mode: identifies specific algorithm related to power management and general optical control.";
     reference "openroadm.org: Open ROADM MSA Specification.";
   }
 
@@ -445,21 +469,21 @@ module org-openroadm-common-types {
   }
 
   typedef wavelength-duplication-type {
-    description
-      "One per srg is applied to C/D add/drop group
-       one per degree is applied to C/D/C add drop group";
     type enumeration {
       enum "one-per-srg" {
+        value 1;
         description
           "The SRG cannot handle wavelength duplication. Attempting to provision a connection on this SRG that uses the same wavelength as an existing service will result in failure.";
-        value 1;
       }
       enum "one-per-degree" {
+        value 2;
         description
           "The SRG can handle wavelength duplication, but only one per degree. Attempting to provision a connection on this SRG that uses the same wavelength as an existing service will succeed, so long as the connections are not using the same degree.";
-        value 2;
       }
     }
+    description
+      "One per srg is applied to C/D add/drop group
+       one per degree is applied to C/D/C add drop group";
   }
 
   typedef port-qual {
@@ -494,35 +518,6 @@ module org-openroadm-common-types {
     }
   }
 
-  identity och-rate-identity {
-    description
-      "A unique och rate identification";
-  }
-
-  identity R200G {
-    base och-rate-identity;
-    description
-      "Identity for 200G Rate";
-  }
-
-  identity R100G {
-    base och-rate-identity;
-    description
-      "Identity for 100G Rate";
-  }
-
-  identity R10.7G {
-    base och-rate-identity;
-    description
-      "Identity for 10.7G Rate";
-  }
-
-  identity R11.1G {
-    base och-rate-identity;
-    description
-      "Identity for 11.1G Rate";
-  }
-
   typedef modulation-format {
     type enumeration {
       enum "bpsk" {
@@ -579,4 +574,66 @@ module org-openroadm-common-types {
     description
       "Modulation format";
   }
+
+  grouping physical-location {
+    leaf rack {
+      type string;
+      mandatory false;
+    }
+    leaf shelf {
+      type string;
+      mandatory false;
+    }
+    leaf slot {
+      type string;
+      mandatory false;
+    }
+    leaf subSlot {
+      type string;
+      mandatory false;
+    }
+  }
+
+  grouping rpc-response-status {
+    leaf status {
+      type rpc-status;
+      mandatory true;
+      description
+        "Successful or Failed";
+    }
+    leaf status-message {
+      type string;
+      description
+        "Gives a more detailed status";
+    }
+  }
+
+  grouping extended-rpc-response-status {
+    leaf status {
+      type extended-rpc-status;
+      mandatory true;
+      description
+        "Successful, Failed or In-progress";
+    }
+    leaf status-message {
+      type string;
+      description
+        "Gives a more detailed status.";
+    }
+  }
+
+  grouping equipment-type {
+    leaf type {
+      type equipment-type-enum;
+      config false;
+      mandatory true;
+    }
+    leaf extension {
+      type string;
+      config false;
+      mandatory false;
+      description
+        "Populated with equipment type when enum value is set to vendorExtension";
+    }
+  }
 }
index 11ce8f55b641debe6186522cd4f6f6e4f1d3afad..b1b9936ded82919026ec1257581d1de01413b1a8 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-equipment-states-types {
     "OpenROADM.org";
   description
     "YANG definitions for types of states of equipment (slot/subslot).
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-equipment-states-types@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-equipment-states-types@2017-12-15.yang
new file mode 100644 (file)
index 0000000..72ec70e
--- /dev/null
@@ -0,0 +1,139 @@
+module org-openroadm-equipment-states-types {
+  namespace "http://org/openroadm/equipment/states/types";
+  prefix org-openroadm-equipment-states-types;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for types of states of equipment (slot/subslot).
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef admin-states {
+    type enumeration {
+      enum "inService" {
+        value 1;
+      }
+      enum "outOfService" {
+        value 2;
+      }
+      enum "maintenance" {
+        value 3;
+      }
+    }
+  }
+
+  typedef states {
+    type enumeration {
+      enum "reserved-for-facility-planned" {
+        value 1;
+        description
+          "equipment is planned for use by a service";
+      }
+      enum "not-reserved-planned" {
+        value 2;
+        description
+          "equipment is planned by not reserved for any purpose";
+      }
+      enum "reserved-for-maintenance-planned" {
+        value 3;
+        description
+          "equipment is planned for use as a maintenance spare";
+      }
+      enum "reserved-for-facility-unvalidated" {
+        value 4;
+        description
+          "equipment is reserved for use by a service but not
+           validated against planned equipment";
+      }
+      enum "not-reserved-unvalidated" {
+        value 5;
+        description
+          "equipment is not reserved for any purpose and
+           not validated against planned equipment";
+      }
+      enum "unknown-unvalidated" {
+        value 6;
+        description
+          "unknown equipment not validated against planned equipment";
+      }
+      enum "reserved-for-maintenance-unvalidated" {
+        value 7;
+        description
+          "equipment is to be used for use as a maintenance spare
+           but not validated against planned equipment";
+      }
+      enum "reserved-for-facility-available" {
+        value 8;
+        description
+          "reserved for use by a service and available";
+      }
+      enum "not-reserved-available" {
+        value 9;
+        description
+          "not reserved for use by a service and available";
+      }
+      enum "reserved-for-maintenance-available" {
+        value 10;
+        description
+          "reserved as a maintenance spare and available";
+      }
+      enum "reserved-for-reversion-inuse" {
+        value 11;
+        description
+          "equipment that is reserved as part of a home path
+           for a service that has been temporarily re-routed";
+      }
+      enum "not-reserved-inuse" {
+        value 12;
+        description
+          "equipment in use for a service";
+      }
+      enum "reserved-for-maintenance-inuse" {
+        value 13;
+        description
+          "maintenance spare equipment that is in use as a
+           maintenance spare";
+      }
+    }
+  }
+}
index e9c7eb03b9e872b97f31711d802b88048aae6bbb..f1a615239deecf5d957056edf50afee6b47df788 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-layerRate {
     "OpenROADM.org";
   description
     "YANG definitions of layer rates.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-layerRate@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-layerRate@2017-12-15.yang
new file mode 100644 (file)
index 0000000..f74f2d2
--- /dev/null
@@ -0,0 +1,94 @@
+module org-openroadm-layerRate {
+  namespace "http://org/openroadm/layerRate";
+  prefix org-openroadm-layerRate;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of layer rates.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef layer-rate-enum {
+    type enumeration {
+      enum "vendorExtension" {
+        value 1;
+        description
+          "vendor extension";
+      }
+      enum "layer2" {
+        value 2;
+        description
+          "2";
+      }
+      enum "layer3" {
+        value 3;
+        description
+          "3";
+      }
+      enum "layer4" {
+        value 4;
+        description
+          "4";
+      }
+      enum "layer5" {
+        value 5;
+        description
+          "5";
+      }
+      enum "layer6" {
+        value 6;
+        description
+          "6";
+      }
+    }
+  }
+
+  grouping layer-rate {
+    description
+      "Set list of layer rates, plus the ability to report layer rates not yet in set list.";
+    leaf type {
+      type layer-rate-enum;
+      mandatory true;
+    }
+    leaf extension {
+      type string;
+      mandatory false;
+    }
+  }
+}
index 5c6e1ff2bd2404afa7dce6000c634bdcdfb0cee1..f8c058aeb9b4b501688b55644bd96548fa28f4f4 100644 (file)
@@ -11,31 +11,31 @@ module org-openroadm-maintenance {
     "OpenROADM.org";
   description
     "YANG definitions of maintenace operations.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-maintenance@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-maintenance@2017-12-15.yang
new file mode 100644 (file)
index 0000000..20845ea
--- /dev/null
@@ -0,0 +1,101 @@
+module org-openroadm-maintenance {
+  namespace "http://org/openroadm/maintenance";
+  prefix org-openroadm-mainteance;
+
+  import org-openroadm-resource {
+    prefix org-openroadm-resource;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of maintenace operations.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef maintenance-operation {
+    type enumeration {
+      enum "terminalLoopback" {
+        value 1;
+      }
+      enum "facilityLoopback" {
+        value 2;
+      }
+      enum "testSignal" {
+        value 3;
+      }
+    }
+    description
+      "Maintenance Operation.";
+  }
+
+  grouping maintenance {
+    leaf id {
+      type string;
+      mandatory true;
+      description
+        "Uniquely identify maintenance activity";
+    }
+    container resource {
+      description
+        "Resource under maintenance";
+      uses org-openroadm-resource:resource;
+    }
+    leaf operation {
+      type maintenance-operation;
+    }
+  }
+
+  container maintenance-list {
+    description
+      "A list of active maintenance operations. Adding an entry to this list creates an active maintenance operation.  Removing an entry from this terminates a maintenance activity";
+    list maintenance {
+      key "id";
+      uses maintenance;
+    }
+  }
+}
diff --git a/ordmodels/common/src/main/yang/org-openroadm-manifest-file@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-manifest-file@2017-12-15.yang
new file mode 100644 (file)
index 0000000..1c89b01
--- /dev/null
@@ -0,0 +1,933 @@
+module org-openroadm-manifest-file {
+  namespace "http://org/openroadm/manifest-file";
+  prefix org-openroadm-manifest-file;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of sw-manifest-file
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2017, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF netconf.  These code components 
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+    reference "This module serves as the manifest file reference.";
+  }
+
+  identity manifest-commands {
+    description
+      "base identity for defining manifest-commands.";
+  }
+
+  identity download-file {
+    base manifest-commands;
+    description
+      "download-file (transfer from OWB-C to Device)";
+  }
+
+  identity upload-file {
+    base manifest-commands;
+    description
+      "upload-file (transfer from Device to OWB-C)";
+  }
+
+  identity delete-file {
+    base manifest-commands;
+    description
+      "delete-file from device";
+  }
+
+  identity sw-manifest-commands {
+    base manifest-commands;
+    description
+      "base identity for defining manifest-commands specific to sw-manifest.";
+  }
+
+  identity sw-stage {
+    base sw-manifest-commands;
+    description
+      "sw-stage sw-manifest-command";
+  }
+
+  identity sw-activate {
+    base sw-manifest-commands;
+    description
+      "sw-activate sw-manifest-command";
+  }
+
+  identity db-backup-manifest-commands {
+    base manifest-commands;
+    description
+      "base identity for defining manifest-commands specific to db-backup-manifest.";
+  }
+
+  identity db-backup {
+    base db-backup-manifest-commands;
+    description
+      "db-backup db-backup-manifest-command";
+  }
+
+  identity db-restore-manifest-commands {
+    base manifest-commands;
+    description
+      "base identity for defining manifest-commands specific to db-restore-manifest.";
+  }
+
+  identity db-restore {
+    base db-restore-manifest-commands;
+    description
+      "db-restore db-restore-manifest-command";
+  }
+
+  identity db-activate {
+    base db-restore-manifest-commands;
+    description
+      "db-activate db-restore-manifest-command";
+  }
+
+  grouping base-manifest {
+    description
+      "base set of variables in all manifest files";
+    leaf vendor {
+      type string;
+      mandatory true;
+      description
+        "This field should match the /org-openroadm-device/info/vendor.
+         It is assumed that the vendor value does not change during the
+         processing of the manifest file.
+         
+         The controller agent would use the vendor and model to find the
+         manifest for an Open ROADM NE. The controller agent would also
+         use the vendor and model to validate that this is a valid manifest
+         for the Open ROADM NE.
+        ";
+    }
+    leaf model {
+      type string;
+      mandatory true;
+      description
+        "This field should match the /org-openroadm-device/info/model.
+         It is assumed that the model value does not change during the
+         processing of the manifest file.
+         
+         The controller agent would use the vendor and model to find the
+         manifest for an Open ROADM NE. The controller agent would also
+         use the vendor and model to validate that this is a valid manifest
+         for the Open ROADM NE.
+        ";
+    }
+    leaf sw-version {
+      type string;
+      description
+        "This field should match the
+             /org-openroadm-device/info/softwareVersion.
+         This is the value in the info tree AFTER an upgrade.
+        ";
+    }
+    leaf global-async-timeout {
+      type uint16;
+      default "900";
+      description
+        "global-async-timeout - time in seconds to wait for command processing to
+         complete.
+         
+         Upon timeout, the controller may either:
+           - assume success;
+           - assume failure;
+           - poll the device to determine success/failure of the operation
+         
+         This global-async-timeout applies to any asynchronous command.
+        ";
+    }
+    leaf global-sync-timeout {
+      type uint16;
+      description
+        "global-sync-timeout - time in seconds to wait for the rpc response for
+         synchronous commands.
+         
+         This global-sync-timeout applies to any synchronous command.
+         
+         Upon timeout, the controller may either:
+           - assume success;
+           - assume failure;
+           - poll the device to determine success/failure of the operation
+         
+         No default is modeled; if not provided, defaults to the global 
+         timeout supported by the controller for rpc responses.
+        ";
+    }
+  }
+
+  grouping timeout-command {
+    description
+      "timeout-command is to be used by any manifest command supporting a timeout";
+    leaf timeout {
+      type uint16;
+      description
+        "See command for additional details.
+         if command is async,
+           - overrides the global-async-timeout;
+           - defaults to the global-async-timeout if not provided.
+         if command is sync,
+           - overrides the global-sync-timeout;
+           - defaults to the global-sync-timeout if not provided.
+        ";
+    }
+  }
+
+  grouping is-async-command {
+    description
+      "is-async-command is to be supported by all manifest commands even if only
+       supported as sync or async. In such cases, a must statement should be 
+       included to limit support to either sync or async.";
+    leaf is-async {
+      type boolean;
+      default "true";
+      description
+        "command can be supported as either an async or sync command by a vendor.
+         When supported as a sync command, the OWB-C will determine the success/failure
+         of the command based on the RPC response instead of waiting for transient
+         notifications from the device.";
+    }
+  }
+
+  grouping transfer-command {
+    description
+      "transfer-command defines the common set of variables used by download-file
+       and upload-file";
+    leaf remote-filename {
+      type string;
+      mandatory true;
+      description
+        "See command for detailed description.";
+    }
+    leaf local-file-path {
+      type string;
+      mandatory true;
+      description
+        "See command for detailed description.";
+    }
+    uses timeout-command;
+    uses is-async-command;
+  }
+
+  grouping file-command {
+    description
+      "file-command is used by all manifest files needing a filename";
+    leaf filename {
+      type string;
+      description
+        "filename is mandatory for delete-file; optional otherwise.
+         See command for detailed description.";
+    }
+  }
+
+  grouping command-reboot {
+    description
+      "command-reboot is used by manifest commands which result in a 
+       device restart.";
+    leaf auto-reboot {
+      type uint16;
+      mandatory true;
+      description
+        "See command for detailed description.";
+    }
+  }
+
+  grouping download-file-command {
+    description
+      "down-file-command";
+    container download-file {
+      when "../command = 'download-file'";
+      description
+        "Transfer a file from the SFTP server to the device.
+         format: download-file remote-filename local-file-path [timeout]
+         where
+           remote-filename is the filename of the file to transfer on the SFTP
+           server. The filename can include a relative path that represents the
+           subdirectory structure of the vendor's software directory. This file
+           (and optional path) must exist in the software release directory on
+           the SFTP server.
+           
+           local-file-path is the local path and filename to transfer the file on
+           the device.
+           
+           timeout - see timeout-command grouping for basic details;
+                     if command is async,
+                       - Receipt of an in-progress (version 2)
+                         transfer-notification resets the timeout.
+           
+         Maps to the transfer rpc with
+            action = download
+            local-file-path = local-file-path
+            remote-file-path =
+               sftp://user:password@host[:port]/path/remote-filename
+           
+            The remote-file-path attribute on the transfer command would be
+            constructed by the software download agent by appending the sftp URL
+            (which includes username, password, host, port, and path to the
+            software release directory) with the remote_filename.
+           
+         In the context of the transfer, remote is the SFTP server (e.g., located
+         on the software download agent) and local is on the Open ROADM device.
+           
+         Expected notifications: transfer-notification
+        ";
+      uses transfer-command;
+    }
+  }
+
+  grouping upload-file-command {
+    description
+      "upload-file-command";
+    container upload-file {
+      when "../command = 'upload-file'";
+      description
+        "Transfer a file from the device to the SFTP server.
+         format: upload-file remote-filename local-file-path [timeout]
+         where
+           remote-filename is the filename of the file to receive the upload
+           on the SFTP server. The filename can include a relative path that
+           represents the subdirectory structure of the vendor's software
+           directory.
+           
+           local-file-path is the local path and filename of the file on
+           the device to be uploaded to the SFTP server. This file must exist on
+           the device.
+           
+           timeout - see timeout-command grouping for basic details;
+                     if command is async,
+                       - Receipt of an in-progress (version 2)
+                         transfer-notification resets the timeout.
+           
+         Maps to the transfer rpc with
+            action = upload
+            local-file-path = local-file-path
+            remote-file-path =
+               sftp://user:password@host[:port]/path/remote-filename
+           
+            The remote-file-path attribute on the transfer command would be
+            constructed by the software download agent by appending the sftp URL
+            (which includes username, password, host, port, and path to the
+            software release directory) with the remote_filename.
+           
+         In the context of the transfer, remote is the SFTP server (e.g., located
+         on the software download agent) and local is on the Open ROADM device.
+           
+         Expected notifications: transfer-notification
+        ";
+      uses transfer-command;
+    }
+  }
+
+  grouping delete-file-command {
+    description
+      "delete-file-command";
+    container delete-file {
+      when "../command = 'delete-file'";
+      must "is-async != 'false'" {
+        error-message "delete-file is only supported as sync command";
+      }
+      description
+        "Delete a file from the device's file system.
+         format: delete-file filename [timeout]
+         where
+           filename is the filename to be deleted from the device. The filename
+           may include path information.
+           
+           timeout - overrides the global-sync-timeout; defaults to the
+                     global-sync-timeout if not provided.
+           
+         Maps to the delete-file rpc:
+            delete-file filename
+        ";
+      uses file-command {
+        refine "filename" {
+          mandatory true;
+        }
+      }
+      uses timeout-command;
+      uses is-async-command;
+    }
+  }
+
+  grouping sw-stage-command {
+    description
+      "sw-stage-command";
+    container sw-stage {
+      when "../command = 'sw-stage'";
+      description
+        "Stage a file in the device.  The details of what a device does during
+         the staging operation is vendor specific.  However, the vendor may
+         initiate additional file transfers from the SFTP server during the
+         staging operation.  It is expected that the files will only be
+         transferred from the software release directory.
+           
+         format: sw-stage [filename] [timeout]
+         where
+           filename is the filename of the file to stage. If filename is not
+           provided, the software download application will send the sw-stage
+           command without a filename.
+           
+           timeout - overrides the global-async-timeout; defaults to the
+                     global-async-timeout if not provided.
+           
+           
+         Maps to the sw-stage rpc:
+            sw-stage [filename]
+           
+         Expected notifications: sw-stage-notification
+        ";
+      uses file-command;
+      uses timeout-command;
+      uses is-async-command;
+    }
+  }
+
+  grouping sw-activate-command {
+    description
+      "sw-activate-command";
+    container sw-activate {
+      when "../command = 'sw-activate'";
+      must "is-async != 'true'" {
+        error-message "sw-activate is only supported as async command";
+      }
+      description
+        "Activate a software load in a device.  The details of what a device does
+         during the activation phase is vendor specific.  The device initiates
+         an automatic reboot as part of the activation.
+           
+         format:  sw-activate version [validation-timer] [timeout] auto-reboot
+         where:
+           version: The version of software that is being activated. (The current
+           YANG model indicates that version is optional; however, version should
+           be a mandatory attribute of the sw-activate command in the manifest
+           file).
+           
+           validation-timer: Validation timer setting for the software activation.
+           Format is expected to be in the form HH-MM-SS per the YANG model. The
+           software download application expects this format in order to treat
+           00-00-00 and no validation timer as the same use case.
+           
+           timeout - overrides the global-async-timeout; defaults to the
+           global-async-timeout if not provided. This timer begins as soon as the
+           sw-activate processing begins. timeout must be greater than the
+           auto-reboot time.
+           
+           auto-reboot: time (in seconds) to wait to for the device to reboot.
+           This is the device restart time (e.g. the length of time from device
+           comm loss until the device is ready for login). This timer begins when
+           the controller detects the comm-loss from the device. If login is not
+           successful when this timer expires, the sw-activate is failed.
+           
+           NOTE: if controller swdl application is not doing the login directly,
+           the controller may need to augment the auto-reboot timer to account for
+           the login time.
+           
+         Maps to the sw-activate rpc:
+           sw-activate version [validationTimer]
+           
+         Expected notifications: sw-activate-notification
+           When no validation timer (or validation-timer = 00-00-00), two
+           notifications will be expected: one for activate, the other for 
+           commit. Otherwise, only the activate notification is expected.
+           
+           NOTE: the sw-activate-notifications (for activate) may be received
+           before or after the reboot; it is assumed the sw-activate-notification
+           (for commit) always occurs after the reboot. Any polling due to missed
+           sw-activate-notifications (activate and/or commit) should not be done
+           until after the reboot login; processing of sw-activate does not
+           complete until after receipt of the notifications and the reboot login.
+        ";
+      leaf version {
+        type string;
+        mandatory true;
+        description
+          "Although version is optional in the sw-activate rpc, it is 
+           mandatory in the manifest file command.";
+      }
+      leaf validation-timer {
+        type string;
+        description
+          "hh-mm-ss";
+      }
+      uses timeout-command;
+      uses command-reboot;
+      uses is-async-command;
+    }
+  }
+
+  grouping db-backup-command {
+    description
+      "db-backup-command";
+    container db-backup {
+      when "../command = 'db-backup'";
+      description
+        "Perform a database backup on the device.
+           
+         format: db-backup [filename] [timeout]
+         where
+           filename is the filename of the backup file to be generated on the
+           device. If filename is not provided, the database backup application
+           will send the db-backup command without a filename. It's possible the
+           filename will not be statically provided in the manifest file, but
+           provided by the database backup application.
+           
+           timeout - see timeout-command grouping for basic details;
+           
+         Maps to the db-backup rpc:
+           db-backup [filename]
+           
+         Expected notifications: db-backup-notification
+        ";
+      uses file-command;
+      uses timeout-command;
+      uses is-async-command;
+    }
+  }
+
+  grouping db-restore-command {
+    description
+      "db-restore-command";
+    container db-restore {
+      when "../command = 'db-restore'";
+      description
+        "Perform a database restore on the device.
+         
+         format: db-restore [filename] [node-id-check] [timeout]
+         where
+           filename is the filename of the file to be restored on the
+           device. If filename is not provided, the database restore application
+           will send the db-restore command without a filename. It's possible the
+           filename will not be statically provided in the manifest file, but
+           provided by the database restore application.
+           
+           node-id-check is a boolean indicating whether sysNameCheck is required.
+           
+           timeout - see timeout-command grouping for basic details;
+           
+         Maps to the db-restore rpc:
+           db-restore [filename] [nodeIDCheck]
+           
+         Expected notifications: db-restore-notification
+        ";
+      uses file-command;
+      leaf node-id-check {
+        type string;
+        default "true";
+        description
+          "Defined as an string here so that manifest file can parameterize
+           the value for user input. __NODE-ID-CHECK is used for that purpose. Other valid
+           values are true or false. Maps to a boolean value in the rpc invocation.";
+      }
+      uses timeout-command;
+      uses is-async-command;
+    }
+  }
+
+  grouping db-activate-command {
+    description
+      "db-activate-command";
+    container db-activate {
+      when "../command = 'db-activate'";
+      must "is-async != 'true'" {
+        error-message "db-activate is only supported as async command";
+      }
+      description
+        "Activate a database on a device.  The details of what a device does
+         during the activation phase is vendor specific.  The device initiates
+         an automatic reboot as part of the activation.
+           
+         format:  db-activate [rollback-timer] [timeout] auto-reboot 
+         where:
+           rollback-timer: Rollback timer setting for the database activation.
+           Format is expected to be in the form HH-MM-SS per the YANG model. The
+           database activation application expects this format in order to treat
+           00-00-00 and no validation timer as the same use case.
+           
+           timeout - overrides the global-async-timeout; defaults to the
+           global-async-timeout if not provided. This timer begins as soon as the
+           db-activate processing begins. timeout must be greater than the
+           auto-reboot time.
+           
+           auto-reboot: time (in seconds) to wait to for the device to reboot.
+           This is the device restart time (e.g. the length of time from device
+           comm loss until the device is ready for login). This timer begins when
+           the controller detects the comm-loss from the device. If login is not
+           successful when this timer expires, the db-activate is failed.
+           
+           NOTE: if controller database application is not doing the login
+           directly, the controller may need to augment the auto-reboot timer to
+           account for the login time.
+           
+         Maps to the db-activate rpc:
+           db-activate [rollBackTimer]
+           
+         Expected notifications: db-activate-notification
+           When no rollback timer (or rollback-timer = 00-00-00), two
+           notifications will be expected: one for activate, the other for 
+           commit. Otherwise, only the activate notification is expected.
+           
+           NOTE: the db-activate-notifications (for activate) may be received
+           before or after the reboot; it is assumed the db-activate-notification
+           (for commit) always occurs after the reboot. Any polling due to missed
+           db-activate-notifications (activate and/or commit) should not be done
+           until after the reboot login; processing of db-activate does not
+           complete until after receipt of the notifications and the reboot login.
+        ";
+      leaf rollback-timer {
+        type string;
+        description
+          "hh-mm-ss";
+      }
+      uses timeout-command;
+      uses command-reboot;
+      uses is-async-command;
+    }
+  }
+
+  container sw-manifest {
+    presence "The sw-manifest instructions for swdl operations have been defined.";
+    description
+      "The manifest file provides instructions to a software download
+       application to download and install a new software load into a vendor’s
+       equipment.
+       
+       Software download files
+           All vendor files for a software release should be stored in a
+       separate directory. A unique directory would be used for each vendor,
+       model and software release combination. This directory and all files in
+       that directory will be accessible by the SFTP server.
+           The software directory can be flat or hierarchical with
+       subdirectories. The manifest file should be in the root directory of the
+       software directory.
+           A software directory must contain files for one and only one
+       software release. 
+       
+       Manifest file name
+           Each software release directory shall contain a manifest file for
+       that release. The filename for the manifest file shall be sw-manifest.json.
+      ";
+    uses base-manifest {
+      refine "sw-version" {
+        mandatory true;
+      }
+    }
+    list instruction-set {
+      key "index";
+      description
+        "The instruction set for a list of sw-versions that can be upgraded to 
+         the sw-version specified at the top of the manifest file.";
+      leaf index {
+        type uint8;
+        description
+          "The index for this instruction set.";
+      }
+      leaf-list from-sw-version {
+        type string;
+        description
+          "The optional list of sw-versions that can be upgraded to the
+           sw-version specified at the top of the sw-manifest file.
+           
+           If not specified, this instruction set is used to upgrade from
+           any sw-version to the sw-version specified at the top of the
+           sw-manifest file.
+                               
+           If multiple instruction sets are provided, from-sw-version
+           should always be defined.";
+      }
+      leaf is-commit-sw-activate-async {
+        type boolean;
+        default "true";
+        description
+          "Is cancel-validation-timer (accept = true) supported as an
+           async or sync command on the device? If supported as sync, the rpc response
+           is used to determine success/failure instead of waiting for transient notifications
+           of the result.
+           NOTE: cancel-validation-timer (accept = false) requires a reboot so is
+           always considered async";
+      }
+      leaf cancel-validation-timer-async-timeout {
+        type uint16;
+        description
+          "timeout value to use for cancel-validation-timer when supported as
+           an async command. If not specified, the global-async-timeout is used.";
+      }
+      leaf cancel-validation-timer-sync-timeout {
+        type uint16;
+        description
+          "timeout value to use for cancel-validation-timer (accept = true) when
+           supported as a sync command. If not specified, the global-sync-timeout
+           is used.";
+      }
+      container sw-manifest-commands {
+        description
+          "The ordered list of commands to be processed. Since some yang
+           implementations do not support ordered-by user, the list is also
+           indexed by command-order. The commands should be processed
+           in the order of command-order.
+           
+           Processing moves to the next command when:
+           1. command is synchronous and rpc returns a successful result.
+           2. command is asynchronous, the rpc returns a successful result,
+           and
+           2.1 expected successful notification(s) have been received; or
+           2.2 timeout occurs.
+           \t\t    
+           Processing of the manifest file is aborted when:
+           1. command is synchronous and rpc returns a failed result.
+           2. command is asynchronous, and:
+           2.1 the rpc returns a failed result; or
+           2.2 a failed notification is received; or
+           2.3 timeout occurs.
+           \t\t     
+           NOTE: behavior for timeouts (synchronous or asynchronous) may depend upon
+           controller implementation per command. It may be considered either:
+           - as a successful result
+           - as a failed result
+           - as a success or failure based on polling the device
+          ";
+        list sw-manifest-command {
+          key "command-order";
+          ordered-by user;
+          description
+            "The list of commands to be processed.";
+          leaf command-order {
+            type uint8;
+            description
+              "The order in which commands should be processed.";
+          }
+          leaf command {
+            type identityref {
+              base sw-manifest-commands;
+            }
+            mandatory true;
+            description
+              "The command to be processed.";
+          }
+          uses download-file-command;
+          uses delete-file-command;
+          uses sw-stage-command;
+          uses sw-activate-command;
+        }
+      }
+    }
+  }
+  container db-backup-manifest {
+    presence "The db-backup-manifest template for db-backup operations has been defined.";
+    description
+      "The manifest file provides instructions to a database operations
+       application to backup the database on a device.
+       
+       Since the files used for these operations are likely user selected,
+       these manifest files are more likely used by the controller as a
+       template to control the overall flow of a backup operation and provide
+       a means of providing customized timeout values.
+       
+       The following strings will be recognized as parameters to be replaced
+       by the user selected values: __LOCAL-FILE-PATH, __REMOTE-FILENAME.
+       
+       Manifest file name
+           Each vendor/model combination can have a separate manifest file
+       defined for backup. These shall be named db-backup-manifest.json.
+      ";
+    uses base-manifest;
+    container db-backup-manifest-commands {
+      description
+        "The ordered list of commands to be processed. Since some yang
+         implementations do not support ordered-by user, the list is also
+         indexed by command-order. The commands should be processed
+         in the order of command-order.
+         
+         Processing moves to the next command when:
+            1. command is synchronous and rpc returns a successful result.
+            2. command is asynchronous, the rpc returns a successful result,
+               and
+               2.1 expected successful notification(s) have been received; or
+               2.2 timeout occurs.
+                           
+         Processing of the manifest file is aborted when:
+            1. command is synchronous and rpc returns a failed result.
+            2. command is asynchronous, and:
+               2.1 the rpc returns a failed result; or
+               2.2 a failed notification is received; or
+               2.3 timeout occurs.
+         
+         NOTE: behavior for timeouts (synchronous or asynchronous) may depend upon
+         controller implementation per command. It may be considered either:
+             - as a successful result
+             - as a failed result
+             - as a success or failure based on polling the device
+        ";
+      list db-backup-manifest-command {
+        key "command-order";
+        ordered-by user;
+        description
+          "The list of commands to be processed.";
+        leaf command-order {
+          type uint8;
+          description
+            "The order in which commands should be processed.";
+        }
+        leaf command {
+          type identityref {
+            base db-backup-manifest-commands;
+          }
+          mandatory true;
+          description
+            "The command to be processed.";
+        }
+        uses upload-file-command;
+        uses delete-file-command;
+        uses db-backup-command;
+      }
+    }
+  }
+  container db-restore-manifest {
+    presence "The db-restore-manifest template for db-restore operations has been defined.";
+    description
+      "The manifest file provides instructions to a database operations
+       application to restore the database on a device.
+       
+       Since the files used for these operations are likely user selected,
+       these manifest files are more likely used by the controller as a
+       template to control the overall flow of a restore operation and provide
+       a means of providing customized timeout and auto-reboot values.
+       
+       The following strings will be recognized as parameters to be replaced
+       by the user selected values: __LOCAL-FILE-PATH, __REMOTE-FILENAME,
+       __NODE-ID-CHECK.
+       
+       Manifest file name
+           Each vendor/model combination can have a separate manifest file
+       defined for restore. These shall be named db-restore-manifest.json.
+      ";
+    uses base-manifest;
+    leaf is-commit-db-activate-async {
+      type boolean;
+      default "true";
+      description
+        "Is cancel-rollback-timer (accept = true) supported as an
+         async or sync command on the device? If supported as sync, the rpc response
+         is used to determine success/failure instead of waiting for transient notifications
+         of the result.
+         NOTE: cancel-rollback-timer (accept = false) requires a reboot so is
+         always considered async";
+    }
+    leaf cancel-rollback-timer-async-timeout {
+      type uint16;
+      description
+        "timeout value to use for cancel-rollback-timer when supported as
+         an async command. If not specified, the global-async-timeout is used.";
+    }
+    leaf cancel-rollback-timer-sync-timeout {
+      type uint16;
+      description
+        "timeout value to use for cancel-rollback-timer (accept = true) when
+         supported as a sync command. If not specified, the global-sync-timeout
+         is used.";
+    }
+    leaf database-init-sync-timeout {
+      type uint16;
+      description
+        "timeout value to use for database-init command. If not specified,
+         the global-sync-timeout is used.";
+    }
+    container db-restore-manifest-commands {
+      description
+        "The ordered list of commands to be processed. Since some yang
+         implementations do not support ordered-by user, the list is also
+         indexed by command-order. The commands should be processed
+         in the order of command-order.
+         
+         Processing moves to the next command when:
+            1. command is synchronous and rpc returns a successful result.
+            2. command is asynchronous, the rpc returns a successful result,
+               and
+               2.1 expected successful notification(s) have been received; or
+               2.2 timeout occurs.
+                           
+         Processing of the manifest file is aborted when:
+            1. command is synchronous and rpc returns a failed result.
+            2. command is asynchronous, and:
+               2.1 the rpc returns a failed result; or
+               2.2 a failed notification is received; or
+               2.3 timeout occurs.
+         
+         NOTE: behavior for timeouts (synchronous or asynchronous) may depend upon
+         controller implementation per command. It may be considered either:
+             - as a successful result
+             - as a failed result
+             - as a success or failure based on polling the device
+        ";
+      list db-restore-manifest-command {
+        key "command-order";
+        ordered-by user;
+        description
+          "The list of commands to be processed.";
+        leaf command-order {
+          type uint8;
+          description
+            "The order in which commands should be processed.";
+        }
+        leaf command {
+          type identityref {
+            base db-restore-manifest-commands;
+          }
+          mandatory true;
+          description
+            "The command to be processed.";
+        }
+        uses download-file-command;
+        uses delete-file-command;
+        uses db-restore-command;
+        uses db-activate-command;
+      }
+    }
+  }
+}
index 26a6879c62b2f1b51e50c00b4dc3def56fce1fde..1708e778b13dfaf8317a309d1d533bb4a5658d4e 100644 (file)
@@ -8,39 +8,39 @@ module org-openroadm-otn-common-types {
     "OpenROADM.org";
   description
     "YANG definitions for common otn related type definitions.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
+     
      Also contains code components extracted from IETF Interfaces.  These code components
      are copyrighted and licensed as follows:
-
+     
      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
      All rights reserved.
-
+     
      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
      publication of this document. Please review these documents carefully, as they
diff --git a/ordmodels/common/src/main/yang/org-openroadm-otn-common-types@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-otn-common-types@2017-12-15.yang
new file mode 100644 (file)
index 0000000..62f2b93
--- /dev/null
@@ -0,0 +1,246 @@
+module org-openroadm-otn-common-types {
+  namespace "http://org/openroadm/otn-common-types";
+  prefix org-openroadm-otn-common-types;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for common otn related type definitions.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+
+  identity otu-rate-identity {
+    description
+      "A unique rate identification of the OTU.";
+  }
+
+  identity OTU4 {
+    base otu-rate-identity;
+    description
+      "Identity for an OTU4";
+  }
+
+  identity OTU3 {
+    base otu-rate-identity;
+    description
+      "Identity for an OTU3";
+  }
+
+  identity OTU2 {
+    base otu-rate-identity;
+    description
+      "Identity for an OTU2";
+  }
+
+  identity OTU2e {
+    base otu-rate-identity;
+    description
+      "Identity for an OTU2e";
+  }
+
+  identity OTU1 {
+    base otu-rate-identity;
+    description
+      "Identity for an OTU1";
+  }
+
+  identity OTU0 {
+    base otu-rate-identity;
+    description
+      "Identity for an OTU0";
+  }
+
+  identity OTUflex {
+    base otu-rate-identity;
+    description
+      "Identity for an OTUflex";
+  }
+
+  identity odu-rate-identity {
+    description
+      "A unique rate identification of the ODU.";
+  }
+
+  identity ODU4 {
+    base odu-rate-identity;
+    description
+      "Identity for an ODU4";
+  }
+
+  identity ODU3 {
+    base odu-rate-identity;
+    description
+      "Identity for an ODU3";
+  }
+
+  identity ODU2 {
+    base odu-rate-identity;
+    description
+      "Identity for an ODU2";
+  }
+
+  identity ODU2e {
+    base odu-rate-identity;
+    description
+      "Identity for an ODU2e";
+  }
+
+  identity ODU1 {
+    base odu-rate-identity;
+    description
+      "Identity for an ODU1";
+  }
+
+  identity ODU0 {
+    base odu-rate-identity;
+    description
+      "Identity for an ODU0";
+  }
+
+  identity ODUflex-cbr {
+    base odu-rate-identity;
+    description
+      "Identity for an ODUflex-cbr";
+  }
+
+  identity ODUflex-gfp {
+    base odu-rate-identity;
+    description
+      "Identity for an ODUflex-gfp";
+  }
+
+  identity odtu-type-identity {
+    description
+      "A unique identification for the MSI odtu type.";
+  }
+
+  identity ODTU4.ts-Allocated {
+    base odtu-type-identity;
+    description
+      "OPU4 MSI - ODTU4.ts, OPU4 MSI TS is occupied/allocated.
+       Applies to all ODTU4.x mappings";
+  }
+
+  identity ODTU01 {
+    base odtu-type-identity;
+    description
+      "ODTU01 MSI type";
+  }
+
+  identity ODTU12 {
+    base odtu-type-identity;
+    description
+      "ODTU12 MSI type";
+  }
+
+  identity ODTU13 {
+    base odtu-type-identity;
+    description
+      "ODTU13 MSI type";
+  }
+
+  identity ODTU23 {
+    base odtu-type-identity;
+    description
+      "ODTU23 MSI type";
+  }
+
+  identity ODTU2.ts {
+    base odtu-type-identity;
+    description
+      "ODTU2.ts MSI type";
+  }
+
+  identity ODTU3.ts {
+    base odtu-type-identity;
+    description
+      "ODTU3.ts MSI type";
+  }
+
+  identity unallocated {
+    base odtu-type-identity;
+    description
+      "Unallocated MSI type";
+  }
+
+  identity odu-function-identity {
+    description
+      "A unique identification of the ODUk interface function.";
+  }
+
+  identity ODU-TTP {
+    base odu-function-identity;
+    description
+      "ODU TTP facility facing trail termination";
+  }
+
+  identity ODU-CTP {
+    base odu-function-identity;
+    description
+      "ODU CTP connection termination";
+  }
+
+  identity ODU-TTP-CTP {
+    base odu-function-identity;
+    description
+      "ODU CTP mapper level connection termination with trail termination and client adaptation";
+  }
+
+  typedef payload-type-def {
+    type string {
+      length "2";
+      pattern "[0-9a-fA-F]*";
+    }
+    description
+      "Common type definition for odu payload-type";
+  }
+}
index 3a7036204ccea733757b05d5b57944d0a101cc8a..9d93aa3969e608defc3fb8c51813af8636626395 100644 (file)
@@ -4,7 +4,7 @@ module org-openroadm-pm-types {
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
-   revision-date 2016-10-14;
+       revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -12,31 +12,31 @@ module org-openroadm-pm-types {
     "OpenROADM.org";
   description
     "YANG definitions of performance management types.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-pm-types@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-pm-types@2017-12-15.yang
new file mode 100644 (file)
index 0000000..a7230b1
--- /dev/null
@@ -0,0 +1,483 @@
+module org-openroadm-pm-types {
+  namespace "http://org/openroadm/pm-types";
+  prefix org-openroadm-pm-types;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of performance management types.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef pm-granularity {
+    type enumeration {
+      enum "notApplicable" {
+        value 1;
+        description
+          "This is for total statistic counters on devices that support
+              them.";
+      }
+      enum "15min" {
+        value 2;
+      }
+      enum "24Hour" {
+        value 3;
+      }
+    }
+    description
+      "Granularity of PM bin";
+  }
+
+  typedef pm-data-type {
+    type union {
+      type uint64;
+      type int64;
+      type decimal64 {
+        fraction-digits 2;
+      }
+      type decimal64 {
+        fraction-digits 17;
+      }
+    }
+  }
+
+  typedef validity {
+    type enumeration {
+      enum "complete" {
+        value 1;
+      }
+      enum "partial" {
+        value 2;
+      }
+      enum "suspect" {
+        value 3;
+      }
+    }
+    description
+      "Validity of data";
+  }
+
+  typedef pm-names-enum {
+    type enumeration {
+      enum "vendorExtension" {
+        value 1;
+        description
+          "vendor extension";
+      }
+      enum "bitErrorRate" {
+        value 2;
+        description
+          "Bit error rate (BER)";
+      }
+      enum "opticalPowerOutput" {
+        value 3;
+        description
+          "Optical Power Output (OPOUT-OTS, OPOUT-OMS, OPT-OCH). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
+      }
+      enum "opticalReturnLoss" {
+        value 4;
+        description
+          "Optical Return Loss (ORL-OTS) - at MW port(s) B";
+      }
+      enum "opticalPowerInput" {
+        value 5;
+        description
+          "Optical Power Input (OPIN-OTS, OPIN-OMS, OPR-OCH). Total optical power";
+      }
+      enum "codeViolations" {
+        value 8;
+        description
+          "Code Violations (CV)";
+      }
+      enum "erroredSeconds" {
+        value 9;
+        description
+          "Errored Seconds (ES)";
+      }
+      enum "severelyErroredSeconds" {
+        value 10;
+        description
+          "Severely Errored Seconds (SES)";
+      }
+      enum "unavailableSeconds" {
+        value 11;
+        description
+          "Unavailable Seconds (UAS)";
+      }
+      enum "inFrames" {
+        value 12;
+        description
+          "In frames (INFRAMES-E)";
+      }
+      enum "inFramesErrored" {
+        value 13;
+        description
+          "In frames errored (INFRAMESERR-E)";
+      }
+      enum "outFrames" {
+        value 14;
+        description
+          "Out frames (OUTFRAMES-E)";
+      }
+      enum "erroredSecondsEthernet" {
+        value 15;
+        description
+          "Errored Seconds Ethernet (ES-E)";
+      }
+      enum "severelyErroredSecondsEthernet" {
+        value 16;
+        description
+          "Severly Errored Seconds, Ethernet (SES-E)";
+      }
+      enum "unavailableSecondsEthernet" {
+        value 17;
+        description
+          "Unavailable Seconds, Ethernet (UAS-E)";
+      }
+      enum "erroredBlockCount" {
+        value 18;
+        description
+          "Errored block count";
+      }
+      enum "delay" {
+        value 19;
+        description
+          "Number of frames between a DMValue toggle event and the received DMp signal value toggle event";
+      }
+      enum "defectSeconds" {
+        value 20;
+        description
+          "Defect Seconds (DS)";
+      }
+      enum "backwardIncomingAlignmentError" {
+        value 21;
+        description
+          "Backward Incoming Alignment Error (BIAE)";
+      }
+      enum "incomingAlignmentError" {
+        value 22;
+        description
+          "Incoming Alignment Error (IAE)";
+      }
+      enum "opticalPowerOutputMin" {
+        value 23;
+        description
+          "Minimum Optical Power Output (OPOUT-OTS). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
+      }
+      enum "opticalPowerOutputMax" {
+        value 24;
+        description
+          "Maximum Optical Power Output (OPOUT-OTS). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
+      }
+      enum "opticalPowerOutputAvg" {
+        value 25;
+        description
+          "Average Optical Power Output (OPOUT-OTS). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
+      }
+      enum "opticalPowerInputMin" {
+        value 26;
+        description
+          "Minimum Optical Power Input (OPIN-OTS). Total optical power";
+      }
+      enum "opticalPowerInputMax" {
+        value 27;
+        description
+          "Maximum Optical Power Input (OPIN-OTS). Total optical power";
+      }
+      enum "opticalPowerInputAvg" {
+        value 28;
+        description
+          "Average Optical Power Input (OPIN-OTS). Total optical power";
+      }
+      enum "opticalPowerOutputOSC" {
+        value 29;
+        description
+          "OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
+      }
+      enum "opticalPowerOutputOSCMin" {
+        value 30;
+        description
+          "Minimum OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
+      }
+      enum "opticalPowerOutputOSCMax" {
+        value 31;
+        description
+          "Maximum OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
+      }
+      enum "opticalPowerOutputOSCAvg" {
+        value 32;
+        description
+          "Average OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
+      }
+      enum "opticalPowerInputOSC" {
+        value 33;
+        description
+          "OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
+      }
+      enum "opticalPowerInputOSCMin" {
+        value 34;
+        description
+          "Minimum OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
+      }
+      enum "opticalPowerInputOSCMax" {
+        value 35;
+        description
+          "Maximum OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
+      }
+      enum "opticalPowerInputOSCAvg" {
+        value 36;
+        description
+          "Average OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
+      }
+      enum "preFECCorrectedErrors" {
+        value 37;
+        description
+          "pFEC corrected Errors";
+      }
+      enum "totalOpticalPowerInput" {
+        value 38;
+        description
+          "Total Optical Power Input.";
+      }
+      enum "totalOpticalPowerInputMin" {
+        value 39;
+        description
+          "Minumun Total Optical Power Input.";
+      }
+      enum "totalOpticalPowerInputMax" {
+        value 40;
+        description
+          "Maximum Total Optical Power Input.";
+      }
+      enum "totalOpticalPowerInputAvg" {
+        value 41;
+        description
+          "Average Total Optical Power Input.";
+      }
+      enum "FECCorrectableBlocks" {
+        value 42;
+        description
+          "FEC Correctable Blocks.";
+      }
+      enum "FECUncorrectableBlocks" {
+        value 43;
+        description
+          "FEC Uncorrectable Blocks.";
+      }
+      enum "BIPErrorCounter" {
+        value 56;
+        description
+          "BIP Error Counter";
+      }
+      enum "protectionSwitchingCount" {
+        value 57;
+        description
+          "Protection Switching Count (PSC)";
+      }
+      enum "protectionSwitchingDuration" {
+        value 58;
+        description
+          "Protection Switching Duration in seconds (PSD)";
+      }
+      enum "erroredBlockCountTCM1-up" {
+        value 59;
+        description
+          "errored Blocks Count on TCM1 up direction.";
+      }
+      enum "erroredBlockCountTCM2-up" {
+        value 60;
+        description
+          "errored Blocks Count on TCM2 up direction.";
+      }
+      enum "erroredBlockCountTCM3-up" {
+        value 61;
+        description
+          "errored Blocks Count on TCM3 up direction.";
+      }
+      enum "erroredBlockCountTCM4-up" {
+        value 62;
+        description
+          "errored Blocks Count on TCM4 up direction.";
+      }
+      enum "erroredBlockCountTCM5-up" {
+        value 63;
+        description
+          "errored Blocks Count on TCM5 up direction.";
+      }
+      enum "erroredBlockCountTCM6-up" {
+        value 64;
+        description
+          "errored Blocks Count on TCM6 up direction.";
+      }
+      enum "delayTCM1-up" {
+        value 65;
+        description
+          "Delay on TCM1 up direction.";
+      }
+      enum "delayTCM2-up" {
+        value 66;
+        description
+          "Delay on TCM2 up direction.";
+      }
+      enum "delayTCM3-up" {
+        value 67;
+        description
+          "Delay on TCM3 up direction.";
+      }
+      enum "delayTCM4-up" {
+        value 68;
+        description
+          "Delay on TCM4 up direction.";
+      }
+      enum "delayTCM5-up" {
+        value 69;
+        description
+          "Delay on TCM5 up direction.";
+      }
+      enum "delayTCM6-up" {
+        value 70;
+        description
+          "Delay on TCM6 up direction.";
+      }
+      enum "erroredBlockCountTCM1-down" {
+        value 71;
+        description
+          "errored Blocks Count on TCM1 down direction.";
+      }
+      enum "erroredBlockCountTCM2-down" {
+        value 72;
+        description
+          "errored Blocks Count on TCM2 down direction.";
+      }
+      enum "erroredBlockCountTCM3-down" {
+        value 73;
+        description
+          "errored Blocks Count on TCM3 down direction.";
+      }
+      enum "erroredBlockCountTCM4-down" {
+        value 74;
+        description
+          "errored Blocks Count on TCM4 down direction.";
+      }
+      enum "erroredBlockCountTCM5-down" {
+        value 75;
+        description
+          "errored Blocks Count on TCM5 down direction.";
+      }
+      enum "erroredBlockCountTCM6-down" {
+        value 76;
+        description
+          "errored Blocks Count on TCM6 down direction.";
+      }
+      enum "delayTCM1-down" {
+        value 77;
+        description
+          "Delay on TCM1 down direction.";
+      }
+      enum "delayTCM2-down" {
+        value 78;
+        description
+          "Delay on TCM2 down direction.";
+      }
+      enum "delayTCM3-down" {
+        value 79;
+        description
+          "Delay on TCM3 down direction.";
+      }
+      enum "delayTCM4-down" {
+        value 80;
+        description
+          "Delay on TCM4 down direction.";
+      }
+      enum "delayTCM5-down" {
+        value 81;
+        description
+          "Delay on TCM5 down direction.";
+      }
+      enum "delayTCM6-down" {
+        value 82;
+        description
+          "Delay on TCM6 down direction.";
+      }
+    }
+  }
+
+  grouping pm-measurement {
+    description
+      "Set of parameters related to a PM Measurement";
+    leaf pmParameterValue {
+      type pm-data-type;
+      config false;
+      mandatory true;
+    }
+    leaf pmParameterUnit {
+      type string;
+      mandatory false;
+      description
+        "Unit PM parameter has been measured - frames, packets, u, etc";
+    }
+    leaf validity {
+      type validity;
+      mandatory false;
+    }
+  }
+
+  grouping pm-names {
+    description
+      "Name of PM parameter. Consisists of a set list of parameters,
+       plus an extension field to support addition parameters.";
+    leaf type {
+      type pm-names-enum;
+      mandatory true;
+    }
+    leaf extension {
+      type string;
+      description
+        "name of parameter, when enum value set to vendorExtension because
+         name not found in pm-names-enum";
+    }
+  }
+}
index 8a75c58a26fae46a639920f4ecd1e231477b74cd..8bb9a307a4b000569b6a1a83b8f79345c943fb3e 100644 (file)
@@ -7,12 +7,15 @@ module org-openroadm-pm {
   }
   import org-openroadm-resource {
     prefix org-openroadm-resource;
+    revision-date 2016-10-14;
   }
   import org-openroadm-layerRate {
     prefix org-openroadm-layerRate;
+    revision-date 2016-10-14;
   }
   import org-openroadm-pm-types {
     prefix org-openroadm-pm-types;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -20,31 +23,31 @@ module org-openroadm-pm {
     "OpenROADM.org";
   description
     "YANG definitions of performance management.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-pm@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-pm@2017-12-15.yang
new file mode 100644 (file)
index 0000000..b14bb7a
--- /dev/null
@@ -0,0 +1,295 @@
+module org-openroadm-pm {
+  namespace "http://org/openroadm/pm";
+  prefix org-openroadm-pm;
+
+  import ietf-yang-types {
+    prefix yang;
+    revision-date 2013-07-15;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-resource {
+    prefix org-openroadm-resource;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-resource-types {
+    prefix org-openroadm-resource-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-pm-types {
+    prefix org-openroadm-pm-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of performance management.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping current-pm-group {
+    description
+      "PM Data with current values - both realtime (granularity=notApplicable)
+       and binned (granularity=15 minute, 24h))";
+    leaf pm-resource-instance {
+      type instance-identifier;
+      config false;
+      mandatory true;
+      description
+        "Retrieves all PM associate with the resource instance";
+    }
+    leaf pm-resource-type {
+      type org-openroadm-resource-types:resource-type-enum;
+      config false;
+      mandatory true;
+      description
+        "The supported pm-resource-type associated with the given resource instance.";
+    }
+    leaf pm-resource-type-extension {
+      type string;
+      config false;
+      description
+        "The resource type extension when the type is not defined in the resource-type-enum.";
+    }
+    leaf retrieval-time {
+      type yang:date-and-time;
+      config false;
+      mandatory true;
+      description
+        "Represents the time when the data is being read, not the bin start or end time.";
+    }
+    list current-pm {
+      key "type extension location direction";
+      config false;
+      uses current-pm-val-group;
+    }
+  }
+
+  grouping current-pm-val-group {
+    uses org-openroadm-pm-types:pm-names;
+    leaf location {
+      type org-openroadm-common-types:location;
+    }
+    leaf direction {
+      type org-openroadm-common-types:direction;
+    }
+    list measurement {
+      key "granularity";
+      leaf granularity {
+        type org-openroadm-pm-types:pm-granularity;
+      }
+      uses org-openroadm-pm-types:pm-measurement;
+    }
+  }
+
+  grouping historical-pm-group {
+    description
+      "PM Data with historical values - binned (granularity=15 minute, 24h))";
+    leaf pm-resource-instance {
+      type instance-identifier;
+      config false;
+      mandatory true;
+      description
+        "Retrieves all PM associate with the resource instance";
+    }
+    leaf pm-resource-type {
+      type org-openroadm-resource-types:resource-type-enum;
+      config false;
+      mandatory true;
+    }
+    leaf pm-resource-type-extension {
+      type string;
+      config false;
+      description
+        "The resource type extension when the type is not defined in the resource-type-enum.";
+    }
+    list historical-pm {
+      key "type extension location direction";
+      uses historical-pm-val-group;
+    }
+  }
+
+  grouping historical-pm-val-group {
+    description
+      "PM Data with historical values";
+    uses org-openroadm-pm-types:pm-names;
+    leaf location {
+      type org-openroadm-common-types:location;
+    }
+    leaf direction {
+      type org-openroadm-common-types:direction;
+    }
+    list measurement {
+      key "granularity bin-number";
+      leaf granularity {
+        type org-openroadm-pm-types:pm-granularity;
+        mandatory true;
+      }
+      leaf bin-number {
+        type uint16 {
+          range "1..max";
+        }
+        config false;
+        mandatory true;
+      }
+      uses org-openroadm-pm-types:pm-measurement;
+      leaf completion-time {
+        type yang:date-and-time;
+        config false;
+        mandatory true;
+        description
+          "The time at the end of the period; For example if bin starts at 
+           01:15:00 and ends at 01:29:59, the completion-time is 01:29:59";
+      }
+    }
+  }
+
+  grouping collect-history-pm-group {
+    leaf pm-filename {
+      type string {
+        length "10..255";
+      }
+      description
+        "The file name to write the historical PM data. 
+         The controller should be able to use this name to retrieve the file via ftp/sftp.
+         The file name should be unique for each RPC request since a new RPC request 
+         could be initiated while the file transfer of the previous file is still in progress.
+         
+         The file content should be written in xml format based on the historical-pm-list 
+         yang definition and the file should be gzip compressed.";
+    }
+    uses org-openroadm-common-types:rpc-response-status;
+  }
+
+  rpc clear-pm {
+    description
+      "Command to initialize PM data";
+    input {
+      uses org-openroadm-resource:resource;
+      leaf pm-type {
+        type enumeration {
+          enum "current" {
+            value 1;
+          }
+          enum "all" {
+            value 2;
+          }
+        }
+        default "current";
+      }
+      leaf granularity {
+        type org-openroadm-pm-types:pm-granularity;
+        default "15min";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc collect-historical-pm-file {
+    description
+      "Command to query historical PM data.
+       The device should be able to process an rpc request for 15min data 
+       and a separate request for 24hour data in parallel.";
+    input {
+      leaf from-bin-number {
+        type uint16 {
+          range "1..max";
+        }
+        default "1";
+        description
+          "The start bin-number of the range";
+      }
+      leaf to-bin-number {
+        type uint16 {
+          range "1..max";
+        }
+        default "1";
+        description
+          "The end bin-number of the range";
+      }
+      leaf granularity {
+        type org-openroadm-pm-types:pm-granularity;
+        default "15min";
+        description
+          "The granularity of the retrieve, default to 15 minitues PM";
+      }
+    }
+    output {
+      uses collect-history-pm-group;
+    }
+  }
+  notification historical-pm-collect-result {
+    description
+      "This Notification is sent when the pm collection is succesful or failed.";
+    uses collect-history-pm-group;
+  }
+  container current-pm-list {
+    config false;
+    description
+      "List of current PMs.";
+    list current-pm-entry {
+      key "pm-resource-type pm-resource-type-extension pm-resource-instance";
+      uses current-pm-group;
+    }
+  }
+  container historical-pm-list {
+    config false;
+    description
+      "List of historical PM";
+    list historical-pm-entry {
+      key "pm-resource-type pm-resource-type-extension pm-resource-instance";
+      uses historical-pm-group;
+    }
+  }
+}
index fdae1d890ae27d9e8439f6d2830ab24caa27fc6a..dc128869fb1c305a45d41fb2a96cd9bd3c6b92da 100644 (file)
@@ -4,7 +4,7 @@ module org-openroadm-port-types {
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
-    revision-date 2017-09-29;
+    revision-date 2016-10-14;
   }
 
   organization
@@ -13,31 +13,31 @@ module org-openroadm-port-types {
     "OpenROADM.org";
   description
     "YANG definitions for port types.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2017-09-29 {
@@ -77,7 +77,7 @@ module org-openroadm-port-types {
   identity if-OCH {
     base supported-if-capability;
   }
-
+  
   identity if-1GE {
     base supported-if-capability;
   }
diff --git a/ordmodels/common/src/main/yang/org-openroadm-port-types@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-port-types@2017-12-15.yang
new file mode 100644 (file)
index 0000000..d7338af
--- /dev/null
@@ -0,0 +1,221 @@
+module org-openroadm-port-types {
+  namespace "http://org/openroadm/port/types";
+  prefix org-openroadm-port-types;
+
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for port types.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  identity supported-if-capability {
+    description
+      "Base identity from which specific supported interfaces are derived";
+  }
+
+  identity if-100GE {
+    base supported-if-capability;
+  }
+
+  identity if-OMS {
+    base supported-if-capability;
+  }
+
+  identity if-OTS {
+    base supported-if-capability;
+  }
+
+  identity if-OCH {
+    base supported-if-capability;
+  }
+
+  identity if-1GE {
+    base supported-if-capability;
+  }
+
+  identity if-10GE {
+    base supported-if-capability;
+  }
+
+  identity if-40GE {
+    base supported-if-capability;
+  }
+
+  identity if-OCH-OTU1-ODU1 {
+    base supported-if-capability;
+  }
+
+  identity if-OCH-OTU2-ODU2 {
+    base supported-if-capability;
+  }
+
+  identity if-OCH-OTU2E-ODU2E {
+    base supported-if-capability;
+  }
+
+  identity if-OCH-OTU3-ODU3 {
+    base supported-if-capability;
+  }
+
+  identity if-OCH-OTU4-ODU4 {
+    base supported-if-capability;
+  }
+
+  identity if-OTU4-ODU4 {
+    base supported-if-capability;
+  }
+
+  identity if-OTU1-ODU1 {
+    base supported-if-capability;
+  }
+
+  identity if-OTU2-ODU2 {
+    base supported-if-capability;
+  }
+
+  identity if-OTU2e-ODU2e {
+    base supported-if-capability;
+  }
+
+  identity if-OTU3-ODU3 {
+    base supported-if-capability;
+  }
+
+  identity if-1GE-ODU0 {
+    base supported-if-capability;
+  }
+
+  identity if-10GE-ODU2 {
+    base supported-if-capability;
+  }
+
+  identity if-10GE-ODU2e {
+    base supported-if-capability;
+  }
+
+  identity if-40GE-ODU3 {
+    base supported-if-capability;
+  }
+
+  identity if-100GE-ODU4 {
+    base supported-if-capability;
+  }
+
+  identity supported-xpdr-capability {
+    description
+      "Base identity from which specific supported xponder are derived";
+  }
+
+  identity Transponder {
+    base supported-xpdr-capability;
+  }
+
+  identity Regen {
+    base supported-xpdr-capability;
+  }
+
+  typedef port-wavelength-types {
+    type enumeration {
+      enum "wavelength" {
+        value 1;
+        description
+          "Port on a transponder or ROADM SRG add drop";
+      }
+      enum "multi-wavelength" {
+        value 2;
+        description
+          "External port connecting to other roadm.";
+      }
+    }
+    description
+      "Port types.";
+  }
+
+  grouping common-port {
+    leaf port-power-capability-min-rx {
+      type org-openroadm-common-types:power-dBm;
+      config false;
+      description
+        "Based on port capabilities, the minimum power in the system spec for this port to
+         provide optimum function in rx direction";
+    }
+    leaf port-power-capability-min-tx {
+      type org-openroadm-common-types:power-dBm;
+      config false;
+      description
+        "Based on port capabilities, the minimum power in the system spec for this port to
+         provide optimum function in tx direction.";
+    }
+    leaf port-power-capability-max-rx {
+      type org-openroadm-common-types:power-dBm;
+      config false;
+      description
+        "Based on port capabilities, the maximum power in the system spec for this port to
+         provide optimum function in rx direction.";
+    }
+    leaf port-power-capability-max-tx {
+      type org-openroadm-common-types:power-dBm;
+      config false;
+      description
+        "Based on port capabilities, the maximum power in the system spec for this port to
+         provide optimum function in tx direction.";
+    }
+  }
+
+  grouping roadm-port {
+    uses common-port;
+  }
+}
index eaa0d2a47709853a0b871748b540f5d9713a57e7..e1757b254fcdbb8b3442cc975c5ef993916fc0dd 100644 (file)
@@ -11,31 +11,31 @@ module org-openroadm-probable-cause {
     "OpenROADM.org";
   description
     "YANG definitions of Probable Causes.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-probable-cause@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-probable-cause@2017-12-15.yang
new file mode 100644 (file)
index 0000000..36822a0
--- /dev/null
@@ -0,0 +1,763 @@
+module org-openroadm-probable-cause {
+  namespace "http://org/openroadm/probableCause";
+  prefix org-openroadm-probable-cause;
+
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of Probable Causes.
+     
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef probable-cause-enum {
+    type enumeration {
+      enum "vendorExtension" {
+        value 1;
+        description
+          "vendorExtension";
+      }
+      enum "openConnectionIndication" {
+        value 2;
+        description
+          "Open connection indication (OCI)";
+        reference "G.798";
+      }
+      enum "alarmIndicationSignal" {
+        value 3;
+        description
+          "Alarm indication signal";
+        reference "G.798";
+      }
+      enum "lossOfSignal" {
+        value 4;
+        description
+          "Loss of Signal";
+      }
+      enum "opticalLineFail" {
+        value 5;
+        description
+          "Optical Line Fail";
+      }
+      enum "opticalPowerDegraded" {
+        value 6;
+        description
+          "Optical Line Fail";
+      }
+      enum "automaticLaserShutdown" {
+        value 7;
+        description
+          "Optical Line Fail";
+      }
+      enum "serverSignalFail" {
+        value 8;
+        description
+          "Server Signal Fail (SSF)";
+        reference "G.798";
+      }
+      enum "lockedDefect" {
+        value 10;
+        description
+          "Locked defect (LCK)";
+        reference "G.798";
+      }
+      enum "trailTraceIdentifierMismatch" {
+        value 11;
+        description
+          "Trail trace Identifier Mismatch (TIM)";
+        reference "G.798";
+      }
+      enum "degradedDefect" {
+        value 12;
+        description
+          "Degraded defect (DEG)";
+        reference "G.798";
+      }
+      enum "backwardsDefectIndication" {
+        value 13;
+        description
+          "Backward Defect Indication (BDI)";
+        reference "G.798";
+      }
+      enum "otsSpanlossPowerOutOfSpecificationHigh" {
+        value 14;
+      }
+      enum "automaticShutoffDisabled" {
+        value 15;
+      }
+      enum "portLossOfLight" {
+        value 17;
+      }
+      enum "reflectionTooHigh" {
+        value 18;
+      }
+      enum "payloadMissingIndication" {
+        value 22;
+        description
+          "Will be applicable to ROADM when OSC signaling supported in future (G.709 2016-06 Figure 15-1A, 1B)";
+      }
+      enum "forwardDefectIndication" {
+        value 23;
+        description
+          "Will be applicable to ROADM when OSC signaling supported in future (G.709 2016-06 Figure 15-1A, 1B)";
+      }
+      enum "oscPowerOutOfSpecificationHigh" {
+        value 24;
+      }
+      enum "oscPowerOutOfSpecificationLow" {
+        value 25;
+      }
+      enum "powerOutOfSpecificationHigh" {
+        value 26;
+      }
+      enum "lossOfSynchronization" {
+        value 27;
+      }
+      enum "linkDown" {
+        value 28;
+      }
+      enum "equipmentFault" {
+        value 29;
+      }
+      enum "equipmentRemoved" {
+        value 30;
+      }
+      enum "equipmentMismatch" {
+        value 31;
+      }
+      enum "equipmentWarmup" {
+        value 32;
+      }
+      enum "equipmentLedOn" {
+        value 33;
+      }
+      enum "equipmentInterConnectFailure" {
+        value 34;
+      }
+      enum "equipmentMiscabledConnection" {
+        value 35;
+      }
+      enum "softwareVersionMismatch" {
+        value 36;
+      }
+      enum "softwareStageInProgress" {
+        value 37;
+      }
+      enum "databaseCorruption" {
+        value 38;
+      }
+      enum "databaseVersionMismatch" {
+        value 44;
+      }
+      enum "firmwareVersionMismatch" {
+        value 46;
+      }
+      enum "incompatibleFirmware" {
+        value 49;
+      }
+      enum "firmwareDownloadOrActivationFailure" {
+        value 50;
+      }
+      enum "firmwareInitInProgress" {
+        value 51;
+      }
+      enum "softwareReset" {
+        value 52;
+      }
+      enum "fanCoolingFail" {
+        value 53;
+      }
+      enum "administrativeDown" {
+        value 54;
+      }
+      enum "lampTest" {
+        value 55;
+      }
+      enum "powerProblemA" {
+        value 56;
+      }
+      enum "powerProblemB" {
+        value 57;
+      }
+      enum "shelfProvisioningMode" {
+        value 58;
+      }
+      enum "sysNameChanged" {
+        value 59;
+      }
+      enum "sysNtpNotSynchronized" {
+        value 60;
+      }
+      enum "lossOfFrame" {
+        value 63;
+      }
+      enum "lossOfMultiframe" {
+        value 64;
+      }
+      enum "backwardIncomingAlignmentError" {
+        value 65;
+      }
+      enum "incomingAlignmentError" {
+        value 66;
+      }
+      enum "payloadMismatch" {
+        value 67;
+      }
+      enum "clientSignalFailDefect" {
+        value 68;
+      }
+      enum "highBER" {
+        value 123;
+      }
+      enum "localFault" {
+        value 124;
+      }
+      enum "remoteFault" {
+        value 125;
+      }
+      enum "lossOfAlignment" {
+        value 126;
+      }
+      enum "lossOfFECAlignment" {
+        value 127;
+      }
+      enum "facilityLoopbackActive" {
+        value 128;
+      }
+      enum "facilityLoopback2Active" {
+        value 129;
+      }
+      enum "terminalLoopbackActive" {
+        value 130;
+      }
+      enum "facilityTestsignalActive" {
+        value 131;
+      }
+      enum "terminalTestsignalActive" {
+        value 132;
+      }
+      enum "certificateNotInstalled" {
+        value 134;
+      }
+      enum "lockoutOfProtection" {
+        value 135;
+      }
+      enum "forcedSwitchAwayFromWorking" {
+        value 136;
+      }
+      enum "forcedSwitchAwayFromProtect" {
+        value 137;
+      }
+      enum "automaticSwitchAwayFromWorkingDueToSF" {
+        value 138;
+      }
+      enum "automaticSwitchAwayFromProtectDueToSF" {
+        value 139;
+      }
+      enum "automaticSwitchDueToWTR" {
+        value 140;
+      }
+      enum "manualSwitchAwayFromWork" {
+        value 141;
+      }
+      enum "manualSwitchAwayFromProtect" {
+        value 142;
+      }
+      enum "automaticPowerReduction" {
+        value 143;
+      }
+      enum "lossOfSignalOSC" {
+        value 144;
+      }
+      enum "softwareValidateInProgress" {
+        value 145;
+      }
+      enum "databaseRollbackTimerInProgress" {
+        value 146;
+      }
+      enum "otdrScanInProgress" {
+        value 147;
+      }
+      enum "lldpFail" {
+        value 148;
+      }
+      enum "omsPowerOutOfSpecificationHigh" {
+        value 149;
+      }
+      enum "omsPowerOutOfSpecificationLow" {
+        value 150;
+      }
+      enum "automaticSwitchAwayFromWorkingDueToSD" {
+        value 151;
+      }
+      enum "automaticSwitchAwayFromProtectDueToSD" {
+        value 152;
+      }
+      enum "backwardIncomingAlignmentErrorTCM1-up" {
+        value 153;
+      }
+      enum "backwardIncomingAlignmentErrorTCM2-up" {
+        value 154;
+      }
+      enum "backwardIncomingAlignmentErrorTCM3-up" {
+        value 155;
+      }
+      enum "backwardIncomingAlignmentErrorTCM4-up" {
+        value 156;
+      }
+      enum "backwardIncomingAlignmentErrorTCM5-up" {
+        value 157;
+      }
+      enum "backwardIncomingAlignmentErrorTCM6-up" {
+        value 158;
+      }
+      enum "incomingAlignmentErrorTCM1-up" {
+        value 159;
+      }
+      enum "incomingAlignmentErrorTCM2-up" {
+        value 160;
+      }
+      enum "incomingAlignmentErrorTCM3-up" {
+        value 161;
+      }
+      enum "incomingAlignmentErrorTCM4-up" {
+        value 162;
+      }
+      enum "incomingAlignmentErrorTCM5-up" {
+        value 163;
+      }
+      enum "incomingAlignmentErrorTCM6-up" {
+        value 164;
+      }
+      enum "backwardsDefectIndicationTCM1-up" {
+        value 165;
+      }
+      enum "backwardsDefectIndicationTCM2-up" {
+        value 166;
+      }
+      enum "backwardsDefectIndicationTCM3-up" {
+        value 167;
+      }
+      enum "backwardsDefectIndicationTCM4-up" {
+        value 168;
+      }
+      enum "backwardsDefectIndicationTCM5-up" {
+        value 169;
+      }
+      enum "backwardsDefectIndicationTCM6-up" {
+        value 170;
+      }
+      enum "degradedDefectTCM1-up" {
+        value 171;
+      }
+      enum "degradedDefectTCM2-up" {
+        value 172;
+      }
+      enum "degradedDefectTCM3-up" {
+        value 173;
+      }
+      enum "degradedDefectTCM4-up" {
+        value 174;
+      }
+      enum "degradedDefectTCM5-up" {
+        value 175;
+      }
+      enum "degradedDefectTCM6-up" {
+        value 176;
+      }
+      enum "trailTraceIdentifierMisMatchTCM1-up" {
+        value 177;
+      }
+      enum "trailTraceIdentifierMisMatchTCM2-up" {
+        value 178;
+      }
+      enum "trailTraceIdentifierMisMatchTCM3-up" {
+        value 179;
+      }
+      enum "trailTraceIdentifierMisMatchTCM4-up" {
+        value 180;
+      }
+      enum "trailTraceIdentifierMisMatchTCM5-up" {
+        value 181;
+      }
+      enum "trailTraceIdentifierMisMatchTCM6-up" {
+        value 182;
+      }
+      enum "alarmIndicationSignalTCM1-up" {
+        value 183;
+      }
+      enum "alarmIndicationSignalTCM2-up" {
+        value 184;
+      }
+      enum "alarmIndicationSignalTCM3-up" {
+        value 185;
+      }
+      enum "alarmIndicationSignalTCM4-up" {
+        value 186;
+      }
+      enum "alarmIndicationSignalTCM5-up" {
+        value 187;
+      }
+      enum "alarmIndicationSignalTCM6-up" {
+        value 188;
+      }
+      enum "openConnectionIndicationTCM1-up" {
+        value 189;
+      }
+      enum "openConnectionIndicationTCM2-up" {
+        value 190;
+      }
+      enum "openConnectionIndicationTCM3-up" {
+        value 191;
+      }
+      enum "openConnectionIndicationTCM4-up" {
+        value 192;
+      }
+      enum "openConnectionIndicationTCM5-up" {
+        value 193;
+      }
+      enum "openConnectionIndicationTCM6-up" {
+        value 194;
+      }
+      enum "lockedDefectTCM1-up" {
+        value 195;
+      }
+      enum "lockedDefectTCM2-up" {
+        value 196;
+      }
+      enum "lockedDefectTCM3-up" {
+        value 197;
+      }
+      enum "lockedDefectTCM4-up" {
+        value 198;
+      }
+      enum "lockedDefectTCM5-up" {
+        value 199;
+      }
+      enum "lockedDefectTCM6-up" {
+        value 200;
+      }
+      enum "lossofTandemConnectionTCM1-up" {
+        value 201;
+      }
+      enum "lossofTandemConnectionTCM2-up" {
+        value 202;
+      }
+      enum "lossofTandemConnectionTCM3-up" {
+        value 203;
+      }
+      enum "lossofTandemConnectionTCM4-up" {
+        value 204;
+      }
+      enum "lossofTandemConnectionTCM5-up" {
+        value 205;
+      }
+      enum "lossofTandemConnectionTCM6-up" {
+        value 206;
+      }
+      enum "backwardIncomingAlignmentErrorTCM1-down" {
+        value 207;
+      }
+      enum "backwardIncomingAlignmentErrorTCM2-down" {
+        value 208;
+      }
+      enum "backwardIncomingAlignmentErrorTCM3-down" {
+        value 209;
+      }
+      enum "backwardIncomingAlignmentErrorTCM4-down" {
+        value 210;
+      }
+      enum "backwardIncomingAlignmentErrorTCM5-down" {
+        value 211;
+      }
+      enum "backwardIncomingAlignmentErrorTCM6-down" {
+        value 212;
+      }
+      enum "incomingAlignmentErrorTCM1-down" {
+        value 213;
+      }
+      enum "incomingAlignmentErrorTCM2-down" {
+        value 214;
+      }
+      enum "incomingAlignmentErrorTCM3-down" {
+        value 215;
+      }
+      enum "incomingAlignmentErrorTCM4-down" {
+        value 216;
+      }
+      enum "incomingAlignmentErrorTCM5-down" {
+        value 217;
+      }
+      enum "incomingAlignmentErrorTCM6-down" {
+        value 218;
+      }
+      enum "backwardsDefectIndicationTCM1-down" {
+        value 219;
+      }
+      enum "backwardsDefectIndicationTCM2-down" {
+        value 220;
+      }
+      enum "backwardsDefectIndicationTCM3-down" {
+        value 221;
+      }
+      enum "backwardsDefectIndicationTCM4-down" {
+        value 222;
+      }
+      enum "backwardsDefectIndicationTCM5-down" {
+        value 223;
+      }
+      enum "backwardsDefectIndicationTCM6-down" {
+        value 224;
+      }
+      enum "degradedDefectTCM1-down" {
+        value 225;
+      }
+      enum "degradedDefectTCM2-down" {
+        value 226;
+      }
+      enum "degradedDefectTCM3-down" {
+        value 227;
+      }
+      enum "degradedDefectTCM4-down" {
+        value 228;
+      }
+      enum "degradedDefectTCM5-down" {
+        value 229;
+      }
+      enum "degradedDefectTCM6-down" {
+        value 230;
+      }
+      enum "trailTraceIdentifierMisMatchTCM1-down" {
+        value 231;
+      }
+      enum "trailTraceIdentifierMisMatchTCM2-down" {
+        value 232;
+      }
+      enum "trailTraceIdentifierMisMatchTCM3-down" {
+        value 233;
+      }
+      enum "trailTraceIdentifierMisMatchTCM4-down" {
+        value 234;
+      }
+      enum "trailTraceIdentifierMisMatchTCM5-down" {
+        value 235;
+      }
+      enum "trailTraceIdentifierMisMatchTCM6-down" {
+        value 236;
+      }
+      enum "alarmIndicationSignalTCM1-down" {
+        value 237;
+      }
+      enum "alarmIndicationSignalTCM2-down" {
+        value 238;
+      }
+      enum "alarmIndicationSignalTCM3-down" {
+        value 239;
+      }
+      enum "alarmIndicationSignalTCM4-down" {
+        value 240;
+      }
+      enum "alarmIndicationSignalTCM5-down" {
+        value 241;
+      }
+      enum "alarmIndicationSignalTCM6-down" {
+        value 242;
+      }
+      enum "openConnectionIndicationTCM1-down" {
+        value 243;
+      }
+      enum "openConnectionIndicationTCM2-down" {
+        value 244;
+      }
+      enum "openConnectionIndicationTCM3-down" {
+        value 245;
+      }
+      enum "openConnectionIndicationTCM4-down" {
+        value 246;
+      }
+      enum "openConnectionIndicationTCM5-down" {
+        value 247;
+      }
+      enum "openConnectionIndicationTCM6-down" {
+        value 248;
+      }
+      enum "lockedDefectTCM1-down" {
+        value 249;
+      }
+      enum "lockedDefectTCM2-down" {
+        value 250;
+      }
+      enum "lockedDefectTCM3-down" {
+        value 251;
+      }
+      enum "lockedDefectTCM4-down" {
+        value 252;
+      }
+      enum "lockedDefectTCM5-down" {
+        value 253;
+      }
+      enum "lockedDefectTCM6-down" {
+        value 254;
+      }
+      enum "lossofTandemConnectionTCM1-down" {
+        value 255;
+      }
+      enum "lossofTandemConnectionTCM2-down" {
+        value 256;
+      }
+      enum "lossofTandemConnectionTCM3-down" {
+        value 257;
+      }
+      enum "lossofTandemConnectionTCM4-down" {
+        value 258;
+      }
+      enum "lossofTandemConnectionTCM5-down" {
+        value 259;
+      }
+      enum "lossofTandemConnectionTCM6-down" {
+        value 260;
+      }
+      enum "multiplexStructureIdentifierMismatch" {
+        value 261;
+        description
+          "G798 : 6.2.9 (dMSIM)";
+      }
+      enum "lossOfOmfIndication" {
+        value 262;
+        description
+          "G798 : 14.3.10.2 Figure 14-73 (dLOOMFI)";
+      }
+      enum "lossOfFrameAndLossOfMultiframe" {
+        value 263;
+        description
+          "G798 : 6.2.5.3 (dLOFLOM)";
+      }
+      enum "lossOfDatabaseRedundancy" {
+        value 264;
+        description
+          "loss of database redundancy";
+      }
+      enum "databaseLocked" {
+        value 265;
+        description
+          "Database locked";
+      }
+      enum "createTechInfoInProgress" {
+        value 266;
+        description
+          "create-tech-info in progress";
+      }
+      enum "circuitPackActivateFailed" {
+        value 267;
+        description
+          "circuit-pack activation failed";
+      }
+      enum "softwareSubsystemFailed" {
+        value 268;
+        description
+          "Software subsystem failed";
+      }
+      enum "diskFull" {
+        value 269;
+        description
+          "Disk full";
+      }
+    }
+  }
+
+  grouping probable-cause {
+    leaf cause {
+      type probable-cause-enum;
+      mandatory true;
+    }
+    leaf extension {
+      type string;
+      mandatory false;
+    }
+    leaf direction {
+      type org-openroadm-common-types:direction;
+      mandatory true;
+      description
+        "Direction indication of the alarm.";
+    }
+    leaf location {
+      type org-openroadm-common-types:location;
+      mandatory true;
+      description
+        "location indication of the alarm.";
+    }
+    leaf type {
+      type enumeration {
+        enum "communication" {
+          value 1;
+        }
+        enum "qualityOfService" {
+          value 2;
+        }
+        enum "processingError" {
+          value 3;
+        }
+        enum "equipment" {
+          value 4;
+        }
+        enum "environmental" {
+          value 5;
+        }
+      }
+      mandatory false;
+      description
+        "Type of alarm. Based on X.733 event Type.";
+    }
+  }
+}
index bb6a80a925d822bf369d532590a89bda2fbdf44b..e1031aa8b8357a7ecc8bd53b0542a28f3ce1c12e 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-resource-types {
     "OpenROADM.org";
   description
     "YANG definitions of common resource types.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
@@ -125,7 +125,7 @@ module org-openroadm-resource-types {
       "Device identifier. Unique within the Controller.";
     leaf node-id {
       description
-        "Node Id is a globally unique identifier for a device.
+        "Node Id is a globally unique identifier for a device. 
          Same as leafref value in model, if applicable.";
       type string;
     }
@@ -145,7 +145,7 @@ module org-openroadm-resource-types {
     uses circuit-pack-name;
     leaf port-name {
       description
-        "Port identifier. Unique within the context of a circuit-pack.
+        "Port identifier. Unique within the context of a circuit-pack. 
          Same as leafref value in model, if applicable.";
       type string;
     }
@@ -154,7 +154,7 @@ module org-openroadm-resource-types {
   grouping physical-link-name {
     leaf physical-link-name {
       description
-        "Physical Link identifier. Unique within the context of a device.
+        "Physical Link identifier. Unique within the context of a device. 
          Same as leafref value in model, if applicable.";
       type string;
       mandatory true;
@@ -164,7 +164,7 @@ module org-openroadm-resource-types {
   grouping internal-link-name {
     leaf internal-link-name {
       description
-        "Internal Link identifier. Unique within the context of a device.
+        "Internal Link identifier. Unique within the context of a device. 
          Same as leafref value in model, if applicable.";
       type string;
       mandatory true;
@@ -174,7 +174,7 @@ module org-openroadm-resource-types {
   grouping connection-number {
     leaf connection-number {
       description
-        "Connection identifier. Unique within the context of a device.
+        "Connection identifier. Unique within the context of a device. 
          Same as leafref value in model, if applicable.";
       type string;
     }
@@ -183,7 +183,7 @@ module org-openroadm-resource-types {
   grouping degree-number {
     leaf degree-number {
       description
-        "Degree identifier. Unique within the context of a device.
+        "Degree identifier. Unique within the context of a device. 
          Same as leafref value in model, if applicable.";
       type uint16;
     }
@@ -192,7 +192,7 @@ module org-openroadm-resource-types {
   grouping srg-number {
     leaf srg-number {
       description
-        "Shared Risk Group identifier. Unique within the context of a device.
+        "Shared Risk Group identifier. Unique within the context of a device. 
          Same as leafref value in model, if applicable.";
       type uint16;
     }
@@ -201,7 +201,7 @@ module org-openroadm-resource-types {
   grouping shelf-name {
     leaf shelf-name {
       description
-        "Shelf-id identifier. Unique within the context of a device.
+        "Shelf-id identifier. Unique within the context of a device.  
          Same as leafref value in model, if applicable.";
       type string;
       mandatory true;
@@ -211,7 +211,7 @@ module org-openroadm-resource-types {
   grouping service-name {
     leaf service-name {
       description
-        "Service identifier. Unique within the context of a network.
+        "Service identifier. Unique within the context of a network.  
          Same as leafref value in model, if applicable.";
       type string;
       mandatory true;
diff --git a/ordmodels/common/src/main/yang/org-openroadm-resource-types@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-resource-types@2017-12-15.yang
new file mode 100644 (file)
index 0000000..fe6d6a9
--- /dev/null
@@ -0,0 +1,358 @@
+module org-openroadm-resource-types {
+  namespace "http://org/openroadm/resource/types";
+  prefix org-openroadm-resource-types;
+
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of common resource types.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef resource-type-enum {
+    type enumeration {
+      enum "other" {
+        value 1;
+        description
+          "Resource of type not found in list.";
+      }
+      enum "device" {
+        value 2;
+        description
+          "device - ROAMD, Xponder, etc";
+      }
+      enum "degree" {
+        value 3;
+        description
+          "degree";
+      }
+      enum "shared-risk-group" {
+        value 4;
+        description
+          "shared-risk-group";
+      }
+      enum "connection" {
+        value 5;
+        description
+          "connection - this is used by roadm-connection and odu-connection
+           since they are mutually exclusive in the model";
+      }
+      enum "connection-map" {
+        value 6;
+        description
+          "connection-map";
+      }
+      enum "port" {
+        value 7;
+        description
+          "port";
+      }
+      enum "circuit-pack" {
+        value 8;
+        description
+          "circuit pack";
+      }
+      enum "internal-link" {
+        value 9;
+        description
+          "internal-link";
+      }
+      enum "physical-link" {
+        value 10;
+        description
+          "physical-link";
+      }
+      enum "interface" {
+        value 11;
+        description
+          "interface";
+      }
+      enum "shelf" {
+        value 12;
+        description
+          "shelf";
+      }
+      enum "service" {
+        value 13;
+        description
+          "service";
+      }
+      enum "odu-sncp-pg" {
+        value 14;
+        description
+          "odu-sncp-pg";
+      }
+      enum "line-amplifier" {
+        value 15;
+        description
+          "line-amplifier";
+      }
+      enum "xponder" {
+        value 16;
+        description
+          "xponder";
+      }
+      enum "versioned-service" {
+        value 17;
+        description
+          "versioned-service";
+      }
+      enum "temp-service" {
+        value 18;
+        description
+          "temp-service";
+      }
+    }
+  }
+
+  typedef resource-notification-type {
+    type enumeration {
+      enum "resourceCreation" {
+        value 1;
+        description
+          "A new instance of a resource has been created.";
+      }
+      enum "resourceModification" {
+        value 2;
+        description
+          "An exhisting instance of a resource has been modified. This shall be triggered by changes in configuration, state, status etc.
+           It shall not be triggered by changes in performance measurements, power and temperature readings or any other data that is highlyvolatile. ";
+      }
+      enum "resourceDeletion" {
+        value 3;
+        description
+          "An exhisting instance of a resource has been removed.";
+      }
+    }
+    description
+      "Type of notification about a resource";
+  }
+
+  grouping resource-type {
+    leaf type {
+      type resource-type-enum;
+      mandatory true;
+    }
+    leaf extension {
+      type string;
+      mandatory false;
+    }
+  }
+
+  grouping device-id {
+    description
+      "Device identifier. Unique within the Controller.";
+    leaf node-id {
+      type org-openroadm-common-types:node-id-type;
+      description
+        "Node Id is a globally unique identifier for a device. 
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping circuit-pack-name {
+    leaf circuit-pack-name {
+      type string;
+      mandatory true;
+      description
+        "Circuit-Pack identifier. Unique within the context of a device.
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping port-name {
+    uses circuit-pack-name;
+    leaf port-name {
+      type string;
+      description
+        "Port identifier. Unique within the context of a circuit-pack. 
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping physical-link-name {
+    leaf physical-link-name {
+      type string;
+      mandatory true;
+      description
+        "Physical Link identifier. Unique within the context of a device. 
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping internal-link-name {
+    leaf internal-link-name {
+      type string;
+      mandatory true;
+      description
+        "Internal Link identifier. Unique within the context of a device. 
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping connection-name {
+    leaf connection-name {
+      type string;
+      description
+        "Connection name. Unique within the context of a device. 
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping degree-number {
+    leaf degree-number {
+      type uint16;
+      description
+        "Degree identifier. Unique within the context of a device. 
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping srg-number {
+    leaf srg-number {
+      type uint16;
+      description
+        "Shared Risk Group identifier. Unique within the context of a device. 
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping shelf-name {
+    leaf shelf-name {
+      type string;
+      mandatory true;
+      description
+        "Shelf-id identifier. Unique within the context of a device.  
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping service-name {
+    leaf service-name {
+      type string;
+      mandatory true;
+      description
+        "Service identifier. Unique within the context of a network.  
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping versioned-service-name {
+    leaf versioned-service-name {
+      type string;
+      mandatory true;
+      description
+        "Service identifier. Unique within the context of a network.  
+         Same as leafref value in model, if applicable.";
+    }
+    leaf version-number {
+      type uint64;
+      mandatory true;
+      description
+        "version-number of the service";
+    }
+  }
+
+  grouping temp-service-name {
+    leaf common-id {
+      type string;
+      mandatory true;
+      description
+        "Service identifier. Unique within the context of a network.  
+         Same as leafref value in model, if applicable.";
+    }
+  }
+
+  grouping interface-name {
+    leaf interface-name {
+      type string;
+      mandatory true;
+      description
+        "Interface identifier.";
+    }
+  }
+
+  grouping other-resource-id {
+    leaf other-resource-id {
+      type string;
+      mandatory true;
+      description
+        "resource-id for other.";
+    }
+  }
+
+  grouping odu-sncp-pg-name {
+    leaf odu-sncp-pg-name {
+      type string;
+      mandatory true;
+      description
+        "name of the odu-snc-pg";
+    }
+  }
+
+  grouping amp-number {
+    leaf amp-number {
+      type uint8;
+      mandatory true;
+      description
+        "number of the line-amplifier";
+    }
+  }
+
+  grouping xpdr-number {
+    leaf xpdr-number {
+      type uint16;
+      mandatory true;
+      description
+        "number of the xponder";
+    }
+  }
+}
index 25cb9f182f66b15c6672067e25e9ee927a47f30a..4251a4881e0458ca0e99006186e9cb11ad377abb 100644 (file)
@@ -4,6 +4,7 @@ module org-openroadm-resource {
 
   import org-openroadm-resource-types {
     prefix org-openroadm-resource-types;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -11,31 +12,31 @@ module org-openroadm-resource {
     "OpenROADM.org";
   description
     "YANG definitions of resources.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-resource@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-resource@2017-12-15.yang
new file mode 100644 (file)
index 0000000..1d203b2
--- /dev/null
@@ -0,0 +1,152 @@
+module org-openroadm-resource {
+  namespace "http://org/openroadm/resource";
+  prefix org-openroadm-resource;
+
+  import org-openroadm-resource-types {
+    prefix org-openroadm-resource-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of resources.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping resource {
+    description
+      "This resource identifier is intended to provide a generic identifer
+       for any resource that can be used without specific knowledge of
+       the resource.";
+    container device {
+      description
+        "Device of the resource, used only when the system using this
+         model report on more than one device. ";
+      uses org-openroadm-resource-types:device-id;
+    }
+    container resource {
+      choice resource {
+        case circuit-pack {
+          uses org-openroadm-resource-types:circuit-pack-name;
+        }
+        case port {
+          container port {
+            uses org-openroadm-resource-types:port-name;
+          }
+        }
+        case connection {
+          uses org-openroadm-resource-types:connection-name {
+            refine "connection-name" {
+              mandatory true;
+            }
+          }
+        }
+        case physical-link {
+          uses org-openroadm-resource-types:physical-link-name;
+        }
+        case internal-link {
+          uses org-openroadm-resource-types:internal-link-name;
+        }
+        case shelf {
+          uses org-openroadm-resource-types:shelf-name;
+        }
+        case srg {
+          uses org-openroadm-resource-types:srg-number {
+            refine "srg-number" {
+              mandatory true;
+            }
+          }
+        }
+        case degree {
+          uses org-openroadm-resource-types:degree-number {
+            refine "degree-number" {
+              mandatory true;
+            }
+          }
+        }
+        case service {
+          uses org-openroadm-resource-types:service-name;
+        }
+        case interface {
+          uses org-openroadm-resource-types:interface-name;
+        }
+        case odu-sncp-pg {
+          uses org-openroadm-resource-types:odu-sncp-pg-name;
+        }
+        case other {
+          uses org-openroadm-resource-types:other-resource-id;
+        }
+        case device {
+          uses org-openroadm-resource-types:device-id {
+            refine "node-id" {
+              mandatory true;
+            }
+          }
+        }
+        case line-amplifier {
+          uses org-openroadm-resource-types:amp-number;
+        }
+        case xponder {
+          uses org-openroadm-resource-types:xpdr-number;
+        }
+        case versioned-service {
+          uses org-openroadm-resource-types:versioned-service-name;
+        }
+        case temp-service {
+          uses org-openroadm-resource-types:temp-service-name;
+        }
+      }
+    }
+    container resourceType {
+      uses org-openroadm-resource-types:resource-type;
+    }
+  }
+}
diff --git a/ordmodels/common/src/main/yang/org-openroadm-switching-pool-types@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-switching-pool-types@2017-12-15.yang
new file mode 100644 (file)
index 0000000..fc6cd08
--- /dev/null
@@ -0,0 +1,55 @@
+module org-openroadm-switching-pool-types {
+  namespace "http://org/openroadm/switching-pool-types";
+  prefix org-openroadm-switching-pool-types;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of common types.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+
+  typedef switching-pool-types {
+    type enumeration {
+      enum "non-blocking" {
+        value 1;
+        description
+          "Single non-blocking element";
+      }
+      enum "blocking" {
+        value 2;
+        description
+          "Multiple connected non-blocking lists";
+      }
+    }
+  }
+}
index 632fc18891b3b21244e5c93334c47572782189ba..c0a8353402d4e1addbe13f2c08f55e5ced161232 100644 (file)
@@ -7,7 +7,7 @@ module org-openroadm-tca {
   }
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
-   revision-date 2016-10-14;
+       revision-date 2016-10-14;
   }
   import org-openroadm-pm-types {
     prefix org-openroadm-pm-types;
@@ -24,31 +24,31 @@ module org-openroadm-tca {
     "OpenROADM.org";
   description
     "YANG definitions of Threshold Crossing Alert types.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-tca@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-tca@2017-12-15.yang
new file mode 100644 (file)
index 0000000..6b1c40b
--- /dev/null
@@ -0,0 +1,152 @@
+module org-openroadm-tca {
+  namespace "http://org/openroadm/tca";
+  prefix org-openroadm-tca;
+
+  import ietf-yang-types {
+    prefix yang;
+    revision-date 2013-07-15;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-pm-types {
+    prefix org-openroadm-pm-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-resource {
+    prefix org-openroadm-resource;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of Threshold Crossing Alert types.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-08-28 {
+    description
+      "Version 2.0.2 - added back the missing pmParameterName container";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping tca {
+    leaf id {
+      type string;
+      mandatory true;
+    }
+    container resource {
+      uses org-openroadm-resource:resource;
+    }
+    container pmParameterName {
+      uses org-openroadm-pm-types:pm-names;
+    }
+    leaf granularity {
+      type org-openroadm-pm-types:pm-granularity;
+      mandatory true;
+    }
+    leaf location {
+      type org-openroadm-common-types:location;
+      mandatory true;
+    }
+    leaf direction {
+      type org-openroadm-common-types:direction;
+      mandatory true;
+    }
+  }
+
+  grouping potential-tca {
+    uses tca;
+    leaf lowThresholdValue {
+      type org-openroadm-pm-types:pm-data-type;
+    }
+    leaf highThresholdValue {
+      type org-openroadm-pm-types:pm-data-type;
+    }
+  }
+
+  notification tca-notification {
+    uses tca;
+    leaf thresholdValue {
+      type org-openroadm-pm-types:pm-data-type;
+      mandatory true;
+    }
+    leaf thresholdType {
+      type enumeration {
+        enum "high" {
+          value 1;
+        }
+        enum "low" {
+          value 2;
+        }
+      }
+      mandatory true;
+      description
+        "Threshold Crossed";
+    }
+    leaf pmParameterValue {
+      type org-openroadm-pm-types:pm-data-type;
+      mandatory true;
+    }
+    leaf raiseTime {
+      type yang:date-and-time;
+      mandatory true;
+    }
+  }
+  container potential-tca-list {
+    description
+      "This is the set of threshold crossing alerts monitored on the device. Alerts are
+       enabled/disabled by adding/deleting the high/low threshold values from the list.";
+    list tca {
+      key "id";
+      uses potential-tca;
+    }
+  }
+}
index fb5fa6d9ee1738b17341be55b091bfe05a38ba0e..4bf5edbb296875c183c4619d56cd075c4721cf08 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-user-mgmt {
     "OpenROADM.org";
   description
     "YANG definitions of user managements.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
diff --git a/ordmodels/common/src/main/yang/org-openroadm-user-mgmt@2017-12-15.yang b/ordmodels/common/src/main/yang/org-openroadm-user-mgmt@2017-12-15.yang
new file mode 100644 (file)
index 0000000..7e3227d
--- /dev/null
@@ -0,0 +1,153 @@
+module org-openroadm-user-mgmt {
+  namespace "http://org/openroadm/user-mgmt";
+  prefix org-openroadm-user-mgmt;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of user managements.
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+      AT&T Intellectual Property.  All other rights reserved.
+      
+      Redistribution and use in source and binary forms, with or without modification, 
+      are permitted provided that the following conditions are met:
+      
+      * Redistributions of source code must retain the above copyright notice, this 
+        list of conditions and the following disclaimer.
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
+        other materials provided with the distribution.
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
+        without specific prior written permission.
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+      POSSIBILITY OF SUCH DAMAGE";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef username-type {
+    type string {
+      length "3..32";
+      pattern "[a-z][a-z0-9]{2,31}" {
+        error-message
+          "A username must begin with a lowercase letter, The remainder 
+           of the string may contain lowercase letters, or numbers 0 through 9.";
+      }
+    }
+    description
+      "The user name string identifying this entry.";
+  }
+
+  typedef password-type {
+    type string {
+      length "8..128";
+      pattern "[a-zA-Z0-9!$%\\^()\\[\\]_\\-~{}.+]*" {
+        error-message "Password content does not meet the requirements";
+      }
+    }
+    description
+      "The password for this entry. This shouldn't be in clear text 
+       The Password must contain at least 2 characters from 
+       each of the following groups: 
+       a) Lower case alphabetic (a-z) 
+       b) Upper case alphabetic (A-Z) 
+       c) Numeric 0-9 
+       d) Special characters Allowed !$%^()[]_-~{}.+ 
+       Password must not contain Username.";
+  }
+
+  grouping user-profile {
+    list user {
+      key "name";
+      description
+        "The list of local users configured on this device.";
+      leaf name {
+        type username-type;
+        description
+          "The user name string identifying this entry.";
+      }
+      leaf password {
+        type password-type;
+        description
+          "The password for this entry.";
+      }
+      leaf group {
+        type enumeration {
+          enum "sudo";
+        }
+        description
+          "The group to which the user is associated to.";
+      }
+    }
+  }
+
+  rpc chg-password {
+    input {
+      leaf currentPassword {
+        type password-type;
+        mandatory true;
+        description
+          "provide the current password";
+      }
+      leaf newPassword {
+        type password-type;
+        mandatory true;
+        description
+          "provide a new password";
+      }
+      leaf newPasswordConfirm {
+        type password-type;
+        mandatory true;
+        description
+          "re-enter the new password ";
+      }
+    }
+    output {
+      leaf status {
+        type enumeration {
+          enum "Successful" {
+            value 1;
+          }
+          enum "Failed" {
+            value 2;
+          }
+        }
+        mandatory true;
+        description
+          "Successful or Failed";
+      }
+      leaf status-message {
+        type string;
+        description
+          "Gives a more detailed reason for success / failure";
+      }
+    }
+  }
+}
diff --git a/ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev171215/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java b/ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev171215/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java
new file mode 100644 (file)
index 0000000..175e9a1
--- /dev/null
@@ -0,0 +1,23 @@
+package org.opendaylight.yang.gen.v1.http.org.openroadm.syslog.rev171215.syslog.selector.log.selector.selector.facility.log.facility;
+import java.lang.String;
+import java.lang.UnsupportedOperationException;
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+public class LogFacilityFacilityBuilder {
+    private LogFacilityFacilityBuilder() {
+        //Exists only to defeat instantiation.
+    }
+
+    public static LogFacility.Facility getDefaultInstance(String defaultValue) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+}
index 991e1cb599f190fe3ef8f428b473eec0237eae99..2c6405fcf383c0c2e0f579db32f012d227773e44 100644 (file)
@@ -4,38 +4,39 @@ module org-openroadm-database {
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
-  }
+    revision-date 2016-10-14;
+  }        
 
   organization "Open ROADM MSA";
   contact
     "OpenROADM.org";
   description
     "This module contains definitions for System Management.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
@@ -56,7 +57,7 @@ module org-openroadm-database {
       }
     }
     output {
-      uses org-openroadm-common-types:rpc-response-status;
+      uses org-openroadm-common-types:rpc-response-status;         
     }
   }
   rpc db-restore {
@@ -78,7 +79,7 @@ module org-openroadm-database {
       }
     }
     output {
-      uses org-openroadm-common-types:rpc-response-status;
+      uses org-openroadm-common-types:rpc-response-status;         
     }
   }
   rpc db-activate {
@@ -92,7 +93,7 @@ module org-openroadm-database {
       }
     }
     output {
-      uses org-openroadm-common-types:rpc-response-status;
+      uses org-openroadm-common-types:rpc-response-status;         
     }
   }
   rpc cancel-rollback-timer {
@@ -106,14 +107,14 @@ module org-openroadm-database {
       }
     }
     output {
-      uses org-openroadm-common-types:rpc-response-status;
+      uses org-openroadm-common-types:rpc-response-status;         
     }
   }
   rpc database-init {
     description
       "Initialize the database to default DB";
     output {
-      uses org-openroadm-common-types:rpc-response-status;
-    } //output
-  }
+      uses org-openroadm-common-types:rpc-response-status;         
+    } //output       
+  } 
 }
diff --git a/ordmodels/device/src/main/yang/org-openroadm-database@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-database@2017-12-15.yang
new file mode 100644 (file)
index 0000000..0acff90
--- /dev/null
@@ -0,0 +1,155 @@
+module org-openroadm-database {
+  namespace "http://org/openroadm/database";
+  prefix org-openroadm-database;
+
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "This module contains definitions for System Management.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  rpc db-backup {
+    description
+      "copy  running DB to user provided file to a given path";
+    input {
+      leaf filename {
+        type string {
+          length "10..255";
+        }
+        description
+          "Path and file name is used with back-up.(xxx.DBS)";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc db-restore {
+    description
+      "Restore database ";
+    input {
+      leaf filename {
+        type string {
+          length "10..255";
+        }
+        description
+          "PATH/file name use file name.(xxx.DBS)";
+      }
+      leaf nodeIDCheck {
+        type boolean;
+        default "true";
+        description
+          "Flag to indicate if sysNameCheck is required";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc db-activate {
+    description
+      "activate the database";
+    input {
+      leaf rollBackTimer {
+        type string;
+        description
+          "rollbackTimer ";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc cancel-rollback-timer {
+    description
+      "Cancel roll back timer which user provisioned as part of activate command";
+    input {
+      leaf accept {
+        type boolean;
+        description
+          " TRUE means rollback timer is cancelled and new load is accepted";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc database-init {
+    description
+      "Initialize the database to default DB";
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  notification db-backup-notification {
+    description
+      "notification for db-backup operation events.";
+    uses org-openroadm-common-types:rpc-response-status;
+  }
+  notification db-restore-notification {
+    description
+      "notification for db-restore operation events.";
+    uses org-openroadm-common-types:rpc-response-status;
+  }
+  notification db-activate-notification {
+    description
+      "notification for database activation events.";
+    leaf db-active-notification-type {
+      type org-openroadm-common-types:activate-notification-type;
+    }
+    uses org-openroadm-common-types:rpc-response-status;
+  }
+}
index 26c3673ef0a2e666cba60d16d7c5ee1b34d70790..43e61760834be0b44f2c378eed29cbc5ca284891 100644 (file)
@@ -4,42 +4,44 @@ module org-openroadm-de-operations {
 
   import org-openroadm-resource {
     prefix org-openroadm-resource;
+    revision-date 2016-10-14;
   }
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
-  }
+    revision-date 2016-10-14;
+  }     
 
   organization "Open ROADM MSA";
   contact
     "OpenROADM.org";
   description
     "YANG definitions of operations.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
@@ -65,7 +67,7 @@ module org-openroadm-de-operations {
       }
     }
     output {
-      uses org-openroadm-common-types:rpc-response-status;
+      uses org-openroadm-common-types:rpc-response-status;      
     }
   }
   notification restart-notification {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-de-operations@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-de-operations@2017-12-15.yang
new file mode 100644 (file)
index 0000000..5009649
--- /dev/null
@@ -0,0 +1,95 @@
+module org-openroadm-de-operations {
+  namespace "http://org/openroadm/de/operations";
+  prefix org-openroadm-de-operations;
+
+  import org-openroadm-resource {
+    prefix org-openroadm-resource;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of operations.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  rpc restart {
+    description
+      "Restart a resource with warm/cold option. If no resource is provided or only the device name is provided, then the device itself will be restarted.
+       Note that resources on the device will not be restartable";
+    input {
+      uses org-openroadm-resource:resource;
+      leaf option {
+        type enumeration {
+          enum "warm" {
+            value 1;
+          }
+          enum "cold" {
+            value 2;
+          }
+        }
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  notification restart-notification {
+    description
+      "This Notification is sent when a resource on a device has completed a restart. This is sent as a result of restarts triggered via the
+       restart RPC and other means.  The resource identified is the from the RPC request or the equivalment if the restart was triggered another way.";
+    uses org-openroadm-resource:resource;
+  }
+}
index eb2d9a2c30b887f6e1ffc62e5e08303f0266254d..100de8dbab8349c695473ba8b3d5eb5ad3bb75a4 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-device-resource-types {
     "OpenROADM.org";
   description
     "YANG definitions of resource types.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
index 6b84ee1a7e29c0a9addc4556f9d173456ec3e717..f271dc8ec6849cb514a7f9e7a1d96f392f453906 100644 (file)
@@ -10,34 +10,50 @@ module org-openroadm-device {
   }
   import ietf-netconf {
     prefix ietf-nc;
-  }
+  }     
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
     revision-date 2016-10-14;
+
   }
   import org-openroadm-resource-types {
     prefix org-openroadm-resource-types;
+    revision-date 2016-10-14;
+
   }
   import org-openroadm-wavelength-map {
     prefix org-openroadm-wavelength-map;
+    revision-date 2016-10-14;
+
   }
   import org-openroadm-physical-types {
     prefix org-openroadm-physical-types;
+    revision-date 2016-10-14;
+
   }
   import org-openroadm-user-mgmt {
     prefix org-openroadm-user-mgmt;
+    revision-date 2016-10-14;
+
   }
   import org-openroadm-port-types {
     prefix org-openroadm-port-types;
+    revision-date 2017-09-29;
+
   }
   import org-openroadm-interfaces {
     prefix org-openroadm-interfaces;
+    revision-date 2016-10-14;
+
   }
   import org-openroadm-swdl {
     prefix org-openroadm-swdl;
+    revision-date 2016-10-14;
+
   }
   import org-openroadm-equipment-states-types {
     prefix org-openroadm-equipment-states-types;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -45,45 +61,45 @@ module org-openroadm-device {
     "OpenROADM.org";
   description
     "YANG definitions of ROADM device
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
 
-     Also contains code components extracted from IETF netconf.  These code components
+     Also contains code components extracted from IETF netconf.  These code components 
      are copyrighted and licensed as follows:
-
-     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
-     All rights reserved.
-
-     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
-     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
-     publication of this document. Please review these documents carefully, as they
-     describe your rights and restrictions with respect to this document. Code Components
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
      extracted from this document must include Simplified BSD License text as described in
-     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
      described in the Simplified BSD License.";
 
   revision 2017-02-06 {
@@ -181,14 +197,14 @@ module org-openroadm-device {
     leaf result-file {
       type string;
     }
-  }
-
-  rpc set-current-datetime {
+  }                      
+  rpc set-current-datetime {     
     description
       "Set the info/current-datetime leaf to the specified value.";
-    input {
+    input {     
      leaf current-datetime {
-        type ietf-yang-types:date-and-time;
+        type ietf-yang-types:date-and-time; 
         mandatory true;
         description
           "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS";
@@ -198,7 +214,7 @@ module org-openroadm-device {
     output {
       uses org-openroadm-common-types:rpc-response-status;
     }
-  }
+  }                   
 
   grouping device-common {
     leaf node-id {
@@ -210,7 +226,7 @@ module org-openroadm-device {
     leaf node-number {
       type uint32;
       description
-        "Number assigned to a ROADM node at a
+        "Number assigned to a ROADM node at a 
          given office";
     }
     leaf node-type {
@@ -292,11 +308,11 @@ module org-openroadm-device {
         "Template information used in the deployment.";
     }
     leaf current-datetime {
-      type ietf-yang-types:date-and-time;
+      type ietf-yang-types:date-and-time; 
       config false;
       description
         "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS.mm+ ";
-    }
+    }        
     container geoLocation {
       description
         "GPS location";
@@ -307,7 +323,7 @@ module org-openroadm-device {
         }
         description
           "[From wikipedia] Latitude is an angle (defined below)
-           which ranges from 0° at the Equator to 90° (North or
+           which ranges from 0° at the Equator to 90° (North or                
            South) at the poles";
       }
       leaf longitude {
@@ -316,7 +332,7 @@ module org-openroadm-device {
           range "-180 .. 180";
         }
         description
-          "[From wikipedia] The longitude is measured as the
+          "[From wikipedia] The longitude is measured as the 
            angle east or west from the Prime Meridian, ranging
            from 0° at the Prime Meridian to +180° eastward and
            âˆ’180° westward.";
@@ -328,7 +344,7 @@ module org-openroadm-device {
     description
       "slots information. To be populated by NE during retrieval.";
     leaf slot-name {
-      type string;
+      type string; 
       description
         "The name of this slot.";
     }
@@ -343,14 +359,14 @@ module org-openroadm-device {
       }
       description
         "The supported circuit-pack. It will be empty if no provision on this slot.";
-    }
-  }
+    }                
+  }         
   grouping shelves {
     list shelves {
       key "shelf-name";
       uses shelf;
     }
-  }
+  }                            
   grouping shelf {
     leaf shelf-name {
       description
@@ -389,14 +405,14 @@ module org-openroadm-device {
       description
         "due date for the shelf.";
     }
-    list slots {
+    list slots {         
       description
           "List of slots on this shelf. To be populated by NE during retrieval.";
       key "slot-name";
       config false;
       uses slot-info;
-    }
-  }
+    }                       
+  }                                    
 
   grouping circuit-packs {
     list circuit-packs {
@@ -465,7 +481,7 @@ module org-openroadm-device {
       type ietf-yang-types:date-and-time;
       description
         "due date for this circuit-pack.";
-    }
+    }     
     container parent-circuit-pack {
       description
         "In the case of circuit packs that contain other equipment (modules or pluggables), this captures the hierarchy of that equipment.  It is a vendor specific design decision if the ports for single-port pluggables are modeled as children of the parent circuit-pack, or as children of the pluggable circuit-pack contained in the parent circuit-pack.  For modules with multiple ports, it is recommended that ports be children of the module and not the carrier, to help in fault correlation and isolation in the case of a module failure.";
@@ -474,7 +490,7 @@ module org-openroadm-device {
         type string;
         description
           "Slot name on parent-circuit-pack.";
-      }
+      }            
     }
     list cp-slots {
       description
@@ -482,7 +498,7 @@ module org-openroadm-device {
       key "slot-name";
       config false;
       uses slot-info;
-    }
+    }                       
     list ports {
       key "port-name";
       description
@@ -504,10 +520,10 @@ module org-openroadm-device {
           type uint32;
           default "30";
           units "m";
-        }
+        }                    
         leaf port-direction {
           type org-openroadm-common-types:direction;
-        }
+        }    
       }
     }
   }
@@ -609,7 +625,7 @@ module org-openroadm-device {
 
   grouping external-links {
     description
-      "YANG definitions for external links..
+      "YANG definitions for external links.. 
        - physical links between ROADMs and between the ROADMs and XPonders, which can be added and removed maually.";
     list external-link {
       key "external-link-name";
@@ -1156,18 +1172,18 @@ module org-openroadm-device {
          }
        } // choice server-or-user
      } // container changed-by-parms
-  }
+  }                                    
   notification change-notification {
     description
       "The Notification that a resource has been added, modified or removed.
        This notification can be triggered by changes in configuration and operational data.
-       It shall contain the changed field pointed by the xpath.
-       Typically it is not intended for frequently changing volatile data e.g. PM, power levels";
+       It shall contain the changed field pointed by the xpath. 
+       Typically it is not intended for frequently changing volatile data e.g. PM, power levels";                                        
 
     leaf change-time {
       description "The time the change occurs.";
       type ietf-yang-types:date-and-time;
-    }
+    }               
     uses changed-by-parms;
 
     leaf datastore {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-device@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-device@2017-12-15.yang
new file mode 100644 (file)
index 0000000..8d69e8f
--- /dev/null
@@ -0,0 +1,1842 @@
+module org-openroadm-device {
+  namespace "http://org/openroadm/device";
+  prefix org-openroadm-device;
+
+  import ietf-yang-types {
+    prefix ietf-yang-types;
+    revision-date 2013-07-15;
+  }
+  import ietf-inet-types {
+    prefix ietf-inet-types;
+    revision-date 2013-07-15;
+  }
+  import ietf-netconf {
+    prefix ietf-nc;
+    revision-date 2011-06-01;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-resource-types {
+    prefix org-openroadm-resource-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-physical-types {
+    prefix org-openroadm-physical-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-user-mgmt {
+    prefix org-openroadm-user-mgmt;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-port-types {
+    prefix org-openroadm-port-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix org-openroadm-interfaces;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-swdl {
+    prefix org-openroadm-swdl;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-equipment-states-types {
+    prefix org-openroadm-equipment-states-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-switching-pool-types {
+    prefix org-openroadm-switching-pool-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of ROADM device
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF netconf.  These code components 
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2017-02-06 {
+    description
+      "Version 1.2.1 - removed pattern for current-datetime in info tree and rpc";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping create-tech-info-group {
+    leaf shelf-id {
+      type leafref {
+        path "/org-openroadm-device/shelves/shelf-name";
+      }
+      description
+        "shelf ID";
+    }
+    leaf log-file-name {
+      type string;
+      description
+        "The log file name a vendor can specify for a given log collection operation";
+    }
+  }
+
+  grouping device-common {
+    leaf node-id {
+      type org-openroadm-common-types:node-id-type;
+      default "openroadm";
+      description
+        "Globally unique identifier for a device.";
+    }
+    leaf node-number {
+      type uint32;
+      description
+        "Number assigned to a ROADM node at a 
+         given office";
+    }
+    leaf node-type {
+      type org-openroadm-common-types:node-types;
+      config true;
+      mandatory true;
+      description
+        "Identifier for node-type e.g Roadm, xponder.
+         Once the node-type is configured, it should not be modified.";
+    }
+    leaf clli {
+      type string;
+      description
+        "Common Language Location Identifier.";
+    }
+    uses org-openroadm-physical-types:node-info;
+    leaf ipAddress {
+      type ietf-inet-types:ip-address;
+      description
+        "IP Address of device";
+    }
+    leaf prefix-length {
+      type uint8 {
+        range "0..128";
+      }
+      description
+        "The length of the subnet prefix";
+    }
+    leaf defaultGateway {
+      type ietf-inet-types:ip-address;
+      description
+        "Default Gateway";
+    }
+    leaf source {
+      type enumeration {
+        enum "static" {
+          value 1;
+        }
+        enum "dhcp" {
+          value 2;
+        }
+      }
+      config false;
+    }
+    leaf current-ipAddress {
+      type ietf-inet-types:ip-address;
+      config false;
+      description
+        "Current IP Address of device";
+    }
+    leaf current-prefix-length {
+      type uint8 {
+        range "0..128";
+      }
+      config false;
+      description
+        "The current length of the subnet prefix";
+    }
+    leaf current-defaultGateway {
+      type ietf-inet-types:ip-address;
+      config false;
+      description
+        "Current Default Gateway";
+    }
+    leaf macAddress {
+      type ietf-yang-types:mac-address;
+      config false;
+      description
+        "MAC Address of device";
+    }
+    leaf softwareVersion {
+      type string;
+      config false;
+      description
+        "Software version";
+    }
+    leaf openroadm-version {
+      type string;
+      config false;
+      description
+        "openroadm version used on the device";
+    }
+    leaf template {
+      type string;
+      description
+        "Template information used in the deployment.";
+    }
+    leaf current-datetime {
+      type ietf-yang-types:date-and-time;
+      config false;
+      description
+        "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS.mm+ ";
+    }
+    container geoLocation {
+      description
+        "GPS location";
+      leaf latitude {
+        type decimal64 {
+          fraction-digits 16;
+          range "-90 .. 90";
+        }
+        description
+          "[From wikipedia] Latitude is an angle (defined below)
+           which ranges from 0 at the Equator to 90 (North or
+           South) at the poles";
+      }
+      leaf longitude {
+        type decimal64 {
+          fraction-digits 16;
+          range "-180 .. 180";
+        }
+        description
+          "[From wikipedia] The longitude is measured as the
+           angle east or west from the Prime Meridian, ranging
+           from 0 at the Prime Meridian to +180 eastward and
+           -180 westward.";
+      }
+    }
+  }
+
+  grouping slot-info {
+    description
+      "slots information. To be populated by NE during retrieval.";
+    leaf slot-name {
+      type string;
+      description
+        "The name of this slot.";
+    }
+    leaf label {
+      type string;
+      description
+        "Faceplate label";
+    }
+    leaf provisioned-circuit-pack {
+      type leafref {
+        path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+      }
+      description
+        "The supported circuit-pack. It will be empty if holder status is empty-not-prov, or installed-not-prov";
+    }
+    leaf slot-status {
+      type enumeration {
+        enum "empty-not-prov" {
+          value 1;
+          description
+            "Slot is empty and not provisioned";
+        }
+        enum "empty-prov-match" {
+          value 2;
+          description
+            "Slot is empty and expected type is provisioned";
+        }
+        enum "empty-prov-mismatch" {
+          value 3;
+          description
+            "Slot is empty and an unsupported type is provisioned";
+        }
+        enum "installed-not-prov" {
+          value 4;
+          description
+            "Slot is occupied but not provisioned";
+        }
+        enum "installed-prov-match" {
+          value 5;
+          description
+            "Slot is occupied with matching provisioned type";
+        }
+        enum "installed-prov-mismatch" {
+          value 6;
+          description
+            "Slot is occupied with mismatched provisioned type";
+        }
+      }
+    }
+  }
+
+  grouping shelves {
+    list shelves {
+      key "shelf-name";
+      uses shelf;
+    }
+  }
+
+  grouping shelf {
+    leaf shelf-name {
+      type string;
+      description
+        "Unique identifier for this shelf within a device";
+    }
+    leaf shelf-type {
+      type string;
+      mandatory true;
+      description
+        "The shelf type: describe the shelf with a unique string.";
+    }
+    leaf rack {
+      type string;
+      description
+        "Reflect the shelf physical location data including floor, aisle, bay values.";
+    }
+    leaf shelf-position {
+      type string;
+      description
+        "Reflect the shelf vertical position within an equipment bay.";
+    }
+    leaf administrative-state {
+      type org-openroadm-equipment-states-types:admin-states;
+      description
+        "Admin State of the shelf";
+    }
+    uses org-openroadm-physical-types:common-info;
+    leaf equipment-state {
+      type org-openroadm-equipment-states-types:states;
+      description
+        "equipment state for the shelf, used to track the lifecycle state.";
+    }
+    leaf due-date {
+      type ietf-yang-types:date-and-time;
+      description
+        "due date for the shelf.";
+    }
+    list slots {
+      key "slot-name";
+      config false;
+      description
+        "List of slots on this shelf. To be populated by NE during retrieval.";
+      uses slot-info;
+    }
+  }
+
+  grouping circuit-packs {
+    list circuit-packs {
+      key "circuit-pack-name";
+      description
+        "List of circuit packs. This includes common equipment, like fans, power supplies, etc.";
+      leaf circuit-pack-type {
+        type string;
+        mandatory true;
+        description
+          "Type of circuit-pack";
+      }
+      leaf circuit-pack-product-code {
+        type string;
+        description
+          "Product Code for the circuit-pack";
+      }
+      uses circuit-pack;
+    }
+  }
+
+  grouping circuit-pack-features {
+    leaf software-load-version {
+      type string;
+      config false;
+      description
+        "Software version running on the circuit pack.";
+    }
+    list circuit-pack-features {
+      config false;
+      container feature {
+        description
+          "List of features supported by the installed load and indications on whether the features have been applied or not.";
+        leaf description {
+          type string;
+          description
+            "Feature description.";
+        }
+        leaf activated {
+          type boolean;
+          description
+            "Indicator if the feature has been activated.";
+        }
+      }
+    }
+    list circuit-pack-components {
+      config false;
+      container component {
+        description
+          "Optional list of components on the circuit-pack and the load information applicable to those components.  If a load is not up to date and will upgrade when a cold restart occurs, the version that will be applied should also be listed.  If there is no misalignment, this does not need to be reported.";
+        leaf name {
+          type string;
+          description
+            "Name of a component on the circuit-pack that can have a load applied to it.";
+        }
+        leaf current-version {
+          type string;
+          description
+            "Name of the load version currently running on the component.";
+        }
+        leaf version-to-apply {
+          type string;
+          description
+            "Name of the load version for the component that will be applied when cold restart occurs on the circuit-pack.";
+        }
+      }
+    }
+  }
+
+  grouping circuit-pack {
+    leaf circuit-pack-name {
+      type string;
+      description
+        "Unique identifier for this circuit-pack within a device";
+    }
+    leaf administrative-state {
+      type org-openroadm-equipment-states-types:admin-states;
+      description
+        "Administrative state of circuit-pack";
+    }
+    uses org-openroadm-physical-types:common-info;
+    container circuit-pack-category {
+      config false;
+      description
+        "General type of circuit-pack";
+      uses org-openroadm-common-types:equipment-type;
+    }
+    leaf equipment-state {
+      type org-openroadm-equipment-states-types:states;
+      description
+        "Equipment state, which complements operational state.";
+    }
+    leaf circuit-pack-mode {
+      type string;
+      default "NORMAL";
+      description
+        "Circuit-pack mode allowed. e.g. NORMAL or REGEN";
+    }
+    leaf shelf {
+      type leafref {
+        path "/org-openroadm-device/shelves/shelf-name";
+      }
+      mandatory true;
+    }
+    leaf slot {
+      type string;
+      mandatory true;
+    }
+    leaf subSlot {
+      type string;
+      mandatory false;
+    }
+    leaf is-pluggable-optics {
+      type boolean;
+      description
+        "True is circuitpack is pluggable optics";
+    }
+    leaf due-date {
+      type ietf-yang-types:date-and-time;
+      description
+        "due date for this circuit-pack.";
+    }
+    container parent-circuit-pack {
+      description
+        "In the case of circuit packs that contain other equipment (modules or pluggables), this captures the hierarchy of that equipment.  It is a vendor specific design decision if the ports for single-port pluggables are modeled as children of the parent circuit-pack, or as children of the pluggable circuit-pack contained in the parent circuit-pack.  For modules with multiple ports, it is recommended that ports be children of the module and not the carrier, to help in fault correlation and isolation in the case of a module failure.";
+      uses circuit-pack-name;
+      leaf cp-slot-name {
+        type string;
+        description
+          "Slot name on parent-circuit-pack.";
+      }
+    }
+    list cp-slots {
+      key "slot-name";
+      config false;
+      description
+        "List of circuit-pack slots on this circuit-pack. To be populated by NE during retrieval.";
+      uses slot-info;
+      leaf slot-type {
+        type enumeration {
+          enum "pluggable-optics-holder" {
+            value 1;
+            description
+              "slot accepts dedicated pluggable port circuit-pack";
+          }
+          enum "other" {
+            value 2;
+            description
+              "slot accepts parent circuit-pack";
+          }
+        }
+      }
+    }
+    uses circuit-pack-features;
+    list ports {
+      key "port-name";
+      description
+        "List of ports on this circuit-pack. Note that pluggables are considered independent circuit-packs.  All ports that are physically present on a pluggable, need to be modeled as a port against that pluggable circuit-pack, and not against the parent circuit-pack.";
+      uses port;
+      container roadm-port {
+        when "../port-qual='roadm-external'";
+        uses org-openroadm-port-types:roadm-port;
+      }
+      container transponder-port {
+        when "../port-qual='xpdr-network' or ../port-qual='xpdr-client' or ../port-qual='switch-network' or ../port-qual='switch-client'";
+        uses org-openroadm-port-types:common-port;
+      }
+      container otdr-port {
+        when "../port-qual='otdr'";
+        description
+          "Settings for otdr port.";
+        leaf launch-cable-length {
+          type uint32;
+          units "m";
+          default "30";
+        }
+        leaf port-direction {
+          type org-openroadm-common-types:direction;
+        }
+      }
+      container ila-port {
+        when "../port-qual='ila-external'";
+        uses org-openroadm-port-types:common-port;
+      }
+    }
+  }
+
+  grouping odu-connection {
+    description
+      "Grouping used to define odu-connections.";
+    leaf connection-name {
+      type string;
+      description
+        "roadm-connection and odu-connection share the same resource-type and resource definition (e.g. connection)";
+    }
+    leaf direction {
+      type enumeration {
+        enum "unidirectional" {
+          value 1;
+        }
+        enum "bidirectional" {
+          value 2;
+        }
+      }
+      default "bidirectional";
+      description
+        "Directionality of connection. If bidirectional, both directions are created.";
+    }
+    container source {
+      leaf src-if {
+        type leafref {
+          path "/org-openroadm-device/interface/name";
+        }
+        mandatory true;
+      }
+    }
+    container destination {
+      leaf dst-if {
+        type leafref {
+          path "/org-openroadm-device/interface/name";
+        }
+        mandatory true;
+      }
+    }
+  }
+
+  grouping connection {
+    description
+      "Grouping used to define connections.";
+    leaf connection-name {
+      type string;
+    }
+    leaf opticalControlMode {
+      type org-openroadm-common-types:optical-control-mode;
+      default "off";
+      description
+        "Whether connection is currently in power or gain/loss mode";
+      reference "openroadm.org: Open ROADM MSA Specification.";
+    }
+    leaf target-output-power {
+      type org-openroadm-common-types:power-dBm;
+      description
+        "The output target power for this connection. When set, the ROADM will work to ensure that current-output-power reaches this level.";
+    }
+    container source {
+      leaf src-if {
+        type leafref {
+          path "/org-openroadm-device/interface/name";
+        }
+        mandatory true;
+      }
+    }
+    container destination {
+      leaf dst-if {
+        type leafref {
+          path "/org-openroadm-device/interface/name";
+        }
+        mandatory true;
+      }
+    }
+  }
+
+  grouping degree {
+    leaf degree-number {
+      type uint16;
+      must "not( current() > /org-openroadm-device/info/max-degrees) and current() > 0" {
+        error-message "Degree not supported by device ";
+        description
+          "Validating if the degree is supported by device";
+      }
+    }
+    leaf max-wavelengths {
+      type uint16;
+      config false;
+      mandatory true;
+      description
+        "maximum number of wavelengths";
+    }
+    list circuit-packs {
+      key "index";
+      description
+        "list for Cards associated with a degree";
+      leaf index {
+        type uint32;
+      }
+      uses circuit-pack-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+      }
+    }
+    list connection-ports {
+      key "index";
+      description
+        "Port associated with degree: One if bi-directional; two if uni-directional";
+      leaf index {
+        type uint32;
+      }
+      uses port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+    }
+    container otdr-port {
+      description
+        "otdr port associated with degree.";
+      uses port-name;
+    }
+    uses mc-capabilities-g;
+  }
+
+  grouping amplifier {
+    leaf amp-number {
+      type uint8 {
+        range "1..128";
+      }
+      description
+        "Unique identifier/number for the amplifier entry which corresponds to a logical amplifier";
+    }
+    leaf amp-type {
+      type org-openroadm-common-types:amplifier-types;
+      config false;
+      mandatory true;
+      description
+        "Amplifier type";
+    }
+    leaf control-mode {
+      type org-openroadm-common-types:line-amplifier-control-mode;
+      default "off";
+      description
+        "Whether the line amplifier is currently in off or gainLoss mode. control-mode can only be set to gainLoss when target-gain, target-tilt and egress-average-channel-power are set and the OMS interfaces are provisioned. The amplifier will be turned off when the control-mode is set to off";
+    }
+    leaf amp-gain-range {
+      type org-openroadm-common-types:amplifier-gain-range;
+      default "gain-range-1";
+      config false;
+      description
+        "Amplifier gain-range (gain-range 1 to 4 for switched gain amplifiers)
+         gain-range-1 (default value) for standard amplifiers";
+    }
+    leaf target-gain {
+      type org-openroadm-common-types:ratio-dB;
+      config true;
+      description
+        "Target overall Amplifier Signal gain, excluding ASE, including VOA attenuation.
+         Defined as optional for ODL support, but shall be considered as mandatory and provided
+         by the controller when the control-mode is set to gainLoss for amplifier setting";
+    }
+    leaf target-tilt {
+      type org-openroadm-common-types:ratio-dB;
+      config true;
+      description
+        "Target tilt configured in case of smart EDFA.
+         Tilt value provided as specified in Open-ROADM-MSA-specifications spreadsheet
+         Defined as optional for ODL support, but shall be considered as mandatory and provided
+         by the controller when the control-mode is set to gainLoss for amplifier setting";
+    }
+    leaf egress-average-channel-power {
+      type org-openroadm-common-types:power-dBm;
+      config true;
+      description
+        "Based upon the total max power across the 4.8 THz passband.
+         Defined as optional for ODL support, but shall be considered as mandatory and provided
+         by the controller when the control-mode is set to gainLoss for amplifier setting";
+    }
+    leaf out-voa-att {
+      type org-openroadm-common-types:ratio-dB;
+      config false;
+      description
+        "Used to provide the value output VOA attenuation, optional";
+    }
+    leaf partner-amp {
+      type leafref {
+        path "../amp-number";
+      }
+      config false;
+      description
+        "amp-number of amp module that is functionally associated to the amplifier  
+         in the opposite direction";
+    }
+    leaf ila-direction-label {
+      type string;
+      description
+        "Amplifier direction. Each operators may have its own naming convention.
+         Shall be consistent with tx-instance-port-direction-label and rx-instance-port-direction-label.";
+    }
+  }
+
+  grouping external-links {
+    description
+      "YANG definitions for external links.. 
+       - physical links between ROADMs and between the ROADMs and XPonders, which can be added and removed manually.";
+    list external-link {
+      key "external-link-name";
+      uses external-link;
+    }
+  }
+
+  grouping external-link {
+    leaf external-link-name {
+      type string;
+    }
+    container source {
+      uses org-openroadm-resource-types:device-id {
+        refine "node-id" {
+          mandatory true;
+        }
+      }
+      uses org-openroadm-resource-types:port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+    }
+    container destination {
+      uses org-openroadm-resource-types:device-id {
+        refine "node-id" {
+          mandatory true;
+        }
+      }
+      uses org-openroadm-resource-types:port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+    }
+  }
+
+  grouping internal-links {
+    list internal-link {
+      key "internal-link-name";
+      config false;
+      uses internal-link;
+    }
+  }
+
+  grouping internal-link {
+    leaf internal-link-name {
+      type string;
+    }
+    container source {
+      uses port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+    }
+    container destination {
+      uses port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+    }
+  }
+
+  grouping physical-links {
+    description
+      "YANG definitions for physical links.
+       - physical links (fiber, cables,etc.) between ports within a node. ";
+    list physical-link {
+      key "physical-link-name";
+      uses physical-link;
+    }
+  }
+
+  grouping physical-link {
+    leaf physical-link-name {
+      type string;
+    }
+    container source {
+      uses port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+    }
+    container destination {
+      uses port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+    }
+  }
+
+  grouping srg {
+    leaf max-add-drop-ports {
+      type uint16;
+      config false;
+      mandatory true;
+      description
+        "The max number of ports available for a given srg";
+    }
+    leaf current-provisioned-add-drop-ports {
+      type uint16;
+      config false;
+      mandatory true;
+      description
+        "The number of ports currently provisioned for a given srg.";
+    }
+    leaf srg-number {
+      type uint16;
+      must "not(current()>/org-openroadm-device/info/max-srgs) and current()>0" {
+        error-message "invalid SRG";
+        description
+          "Validating if the srg is supported by add/drop group";
+      }
+    }
+    leaf wavelength-duplication {
+      type org-openroadm-common-types:wavelength-duplication-type;
+      config false;
+      mandatory true;
+      description
+        "Whether the SRG can handle duplicate wavelengths and if so to what extent.";
+    }
+    list circuit-packs {
+      key "index";
+      description
+        "list for Cards associated with an add/drop group and srg";
+      leaf index {
+        type uint32;
+      }
+      uses circuit-pack-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+      }
+    }
+    uses mc-capabilities-g;
+  }
+
+  grouping xponder {
+    leaf xpdr-number {
+      type uint16;
+      must "current() > 0" {
+        error-message "Xponder not supported by device ";
+        description
+          "Validating if the Xponder is supported by device";
+      }
+    }
+    leaf xpdr-type {
+      type org-openroadm-common-types:xpdr-node-types;
+      mandatory true;
+      description
+        "Identifier for xponder-type e.g Transponder, Muxponder";
+    }
+    leaf recolor {
+      type boolean;
+      config false;
+      description
+        "Indication if recolor is supported";
+    }
+    list xpdr-port {
+      key "index";
+      description
+        "Network Ports with in a Xponder";
+      leaf index {
+        type uint32;
+      }
+      uses port-name {
+        refine "circuit-pack-name" {
+          mandatory true;
+        }
+        refine "port-name" {
+          mandatory true;
+        }
+      }
+      leaf eqpt-srg-id {
+        type uint32;
+        description
+          "Shared Risk Group identifier. All ports in a circuit-pack will have same srg-id";
+      }
+    }
+  }
+
+  grouping degree-number {
+    leaf degree-number {
+      type leafref {
+        path "/org-openroadm-device/degree/degree-number";
+      }
+      description
+        "Degree identifier. Unique within the context of a device.";
+    }
+  }
+
+  grouping circuit-pack-name {
+    leaf circuit-pack-name {
+      type leafref {
+        path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+      }
+      description
+        "Circuit-Pack identifier. Unique within the context of a device.";
+    }
+  }
+
+  grouping port-name {
+    uses circuit-pack-name;
+    leaf port-name {
+      type leafref {
+        path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
+      }
+      description
+        "Port identifier. Unique within the context of a circuit-pack.";
+    }
+  }
+
+  grouping srg-number {
+    leaf srg-number {
+      type leafref {
+        path "/org-openroadm-device/shared-risk-group/srg-number";
+      }
+      description
+        "Shared Risk Group identifier. Unique within the context of a device.";
+    }
+  }
+
+  grouping supporting-port-name {
+    leaf supporting-circuit-pack-name {
+      type leafref {
+        path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+      }
+      description
+        "Identifier of the supporting circuit-pack.";
+    }
+    leaf supporting-port {
+      type leafref {
+        path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../supporting-circuit-pack-name]/ports/port-name";
+      }
+      description
+        "Identifier of the supporting port.";
+    }
+  }
+
+  grouping interface-name {
+    leaf interface-name {
+      type leafref {
+        path "/org-openroadm-device/interface/name";
+      }
+      config false;
+      description
+        "Name of an interface. Unique within the context of a device.";
+    }
+  }
+
+  grouping interfaces-grp {
+    description
+      "OpenROADM Interface configuration parameters.";
+    list interface {
+      key "name";
+      description
+        "The list of configured interfaces on the device.";
+      leaf name {
+        type string;
+        description
+          "The name of the interface.";
+      }
+      leaf description {
+        type string;
+        description
+          "A textual description of the interface.";
+      }
+      leaf type {
+        type identityref {
+          base org-openroadm-interfaces:interface-type;
+        }
+        mandatory true;
+        description
+          "The type of the interface.";
+      }
+      leaf administrative-state {
+        type org-openroadm-equipment-states-types:admin-states;
+      }
+      leaf operational-state {
+        type org-openroadm-common-types:state;
+        config false;
+      }
+      leaf circuit-id {
+        type string {
+          length "0..45";
+        }
+        description
+          "circuit identifier/user label,
+           can be used in alarm correlation and/or connection management ";
+      }
+      leaf supporting-interface {
+        type leafref {
+          path "/org-openroadm-device/interface/name";
+        }
+      }
+      uses supporting-port-name;
+    }
+  }
+
+  grouping protection-groups {
+    description
+      "OpenROADM facility protection configuration parameters.";
+    container protection-grps {
+      description
+        "The list of configured protection groups on the device.";
+    }
+  }
+
+  grouping port {
+    description
+      "Grouping of attributes related to a port object.";
+    leaf port-name {
+      type string;
+      mandatory true;
+      description
+        "Identifier for a port, unique within a circuit pack";
+    }
+    leaf port-type {
+      type string;
+      description
+        "Type of the pluggable or fixed port.";
+    }
+    leaf port-qual {
+      type org-openroadm-common-types:port-qual;
+    }
+    leaf port-wavelength-type {
+      type org-openroadm-port-types:port-wavelength-types;
+      config false;
+      description
+        "Type of port - single, multiple-wavelength, etc.";
+    }
+    leaf port-direction {
+      type org-openroadm-common-types:direction;
+      config false;
+      mandatory true;
+      description
+        "Whether port is uni (tx/rx) or bi-directional and";
+    }
+    leaf label {
+      type string;
+      config false;
+      description
+        "Faceplate label";
+    }
+    leaf circuit-id {
+      type string {
+        length "0..45";
+      }
+      description
+        "circuit identifier/user label,
+         can be used in alarm correlation and/or connection management ";
+    }
+    leaf administrative-state {
+      type org-openroadm-equipment-states-types:admin-states;
+      default "outOfService";
+      description
+        "Administrative state of port. The value of this field independent of the state of its contained and containing resources.  Setting this a port to administratively down will impact both its operational state, as well the operational state of its contained resources.  If this port is an endpoint to a connection, internal-link, physical-link, etc, then administratively disabling this port will impact the operational state of those items unless they are using some form of port-protection schema.";
+    }
+    leaf operational-state {
+      type org-openroadm-common-types:state;
+      config false;
+      mandatory true;
+      description
+        "Operational state of a port";
+    }
+    leaf-list supported-interface-capability {
+      type identityref {
+        base org-openroadm-port-types:supported-if-capability;
+      }
+      config false;
+      description
+        "Interface types supported on this port";
+    }
+    leaf logical-connection-point {
+      type string;
+      description
+        "delete or replace with list logical-ports or connections?";
+    }
+    container partner-port {
+      config false;
+      description
+        "For ports which are not identified as having a direction of bidirectional, this field is used to identify the port which corresponds to the reverse direction. A port pair should include a port for each direction (tx, rx) and report their mate as partner-port.";
+      uses port-name;
+    }
+    container parent-port {
+      config false;
+      description
+        "In the case of port hierarchy, this is the parent port, which is also modeled as port within this circuit-pack. This is used in the case of a port that supports a parallel connector that contains subports.  The parent-port of the subport will be the port that contains this subport.  This can be used to help isolate faults when a single fault on a parallel connector introduces symptomatic failures on the contained subports.";
+      uses port-name;
+    }
+    list interfaces {
+      config false;
+      description
+        "List of the interfaces this port supports.  This is a list of names of instances in the flat instance list";
+      uses interface-name;
+    }
+  }
+
+  grouping org-openroadm-device-container {
+    container org-openroadm-device {
+      container info {
+        uses device-common;
+        leaf max-degrees {
+          type uint16;
+          config false;
+          description
+            "Max. number of degrees supported by device";
+        }
+        leaf max-srgs {
+          type uint16;
+          config false;
+          description
+            "Max. number of SRGs in an add/drop group";
+        }
+        leaf max-num-bin-15min-historical-pm {
+          type uint16;
+          config false;
+          description
+            "Max. number of bin the NE support for 15min historical PM";
+        }
+        leaf max-num-bin-24hour-historical-pm {
+          type uint16;
+          config false;
+          description
+            "Max. number of bin the NE support for 24hour historical PM";
+        }
+      }
+      container users {
+        description
+          "Stores a list of users";
+        uses org-openroadm-user-mgmt:user-profile;
+      }
+      container pending-sw {
+        config false;
+        uses org-openroadm-swdl:sw-bank;
+      }
+      uses shelves;
+      uses circuit-packs;
+      uses interfaces-grp;
+      uses protection-groups;
+      container protocols {
+        description
+          "Contains the supported protocols";
+      }
+      uses internal-links;
+      uses physical-links;
+      uses external-links;
+      list degree {
+        when "/org-openroadm-device/info/node-type='rdm'";
+        key "degree-number";
+        uses degree;
+      }
+      list shared-risk-group {
+        when "/org-openroadm-device/info/node-type='rdm'";
+        key "srg-number";
+        uses srg;
+      }
+      list line-amplifier {
+        when "/org-openroadm-device/info/node-type='ila'";
+        key "amp-number";
+        description
+          "lists amplifiers in different directions";
+        uses amplifier;
+        list circuit-pack {
+          key "index";
+          description
+            "list for Cards associated with an amplifier";
+          leaf index {
+            type uint32;
+          }
+          uses circuit-pack-name {
+            refine "circuit-pack-name" {
+              mandatory true;
+            }
+          }
+        }
+        list line-port {
+          key "port-direction";
+          description
+            "Port associated with an amplifier which face the line (ila-external): traffic port.";
+          leaf port-direction {
+            type org-openroadm-common-types:direction;
+            config true;
+            mandatory true;
+            description
+              "partly allows identifying ports associated with logical amp :TX for egress, RX for ingress
+               TXRX in case of bidirectional port";
+          }
+          leaf tx-instance-port-direction-label {
+            type string;
+            config true;
+            description
+              "Complements ports identification. Used notably in case of bidirectional ports, 
+               and/or in multi-degree amplifier nodes. Allows associating one of the directions
+               specified in ila-direction-label. Shall be consistent with ila-direction-label";
+          }
+          leaf rx-instance-port-direction-label {
+            type string;
+            config true;
+            description
+              "Complements ports identification. Used notably in case of bidirectional ports, 
+               and/or in multi-degree amplifier nodes. Allows associating one of the directions
+               specified in ila-direction-label. Shall be consistent with ila-direction-label";
+          }
+          uses port-name {
+            refine "circuit-pack-name" {
+              mandatory true;
+            }
+            refine "port-name" {
+              mandatory true;
+            }
+          }
+        }
+        list osc-port {
+          key "port-direction";
+          description
+            "Ports associated with OSC";
+          leaf port-direction {
+            type org-openroadm-common-types:direction;
+            config true;
+            mandatory true;
+            description
+              "allows identifying ports associated with logical amp : 
+               TX for OSC circuit-pack IN RX for OSC circuit-pack OUT";
+          }
+          uses port-name {
+            refine "circuit-pack-name" {
+              mandatory true;
+            }
+            refine "port-name" {
+              mandatory true;
+            }
+          }
+        }
+        list otdr-port {
+          key "otdr-direction";
+          description
+            "otdr ports associated with an ILA";
+          leaf otdr-direction {
+            type string;
+            config true;
+            description
+              "allows identifying associated logical amp port in which OTDR is launched: 
+               corresponds to rx-instance-port-direction-label of corresponding amplifier line-port";
+          }
+          uses port-name {
+            refine "circuit-pack-name" {
+              mandatory true;
+            }
+            refine "port-name" {
+              mandatory true;
+            }
+          }
+        }
+      }
+      list xponder {
+        when "/org-openroadm-device/info/node-type='xpdr'";
+        key "xpdr-number";
+        uses xponder;
+      }
+      list roadm-connections {
+        when "/org-openroadm-device/info/node-type='rdm'";
+        key "connection-name";
+        uses connection;
+      }
+      list odu-connection {
+        when "/org-openroadm-device/info/node-type='xpdr'";
+        key "connection-name";
+        uses odu-connection;
+      }
+      list connection-map {
+        key "connection-map-number";
+        config false;
+        leaf connection-map-number {
+          type uint32;
+          description
+            "Unique identifier for this connection-map entry";
+        }
+        container source {
+          leaf circuit-pack-name {
+            type leafref {
+              path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+            }
+            mandatory true;
+          }
+          leaf port-name {
+            type leafref {
+              path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
+            }
+            mandatory true;
+            description
+              "Port identifier. Unique within the context of a circuit-pack.";
+          }
+        }
+        list destination {
+          key "circuit-pack-name port-name";
+          min-elements 1;
+          leaf circuit-pack-name {
+            type leafref {
+              path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+            }
+            mandatory true;
+          }
+          leaf port-name {
+            type leafref {
+              path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
+            }
+            mandatory true;
+            description
+              "Port identifier. Unique within the context of a circuit-pack.";
+          }
+        }
+      }
+      list odu-switching-pools {
+        when "/org-openroadm-device/info/node-type='xpdr'";
+        key "switching-pool-number";
+        config false;
+        leaf switching-pool-number {
+          type uint16;
+          description
+            "Unique identifier for this odu-switching-pool";
+        }
+        leaf switching-pool-type {
+          type org-openroadm-switching-pool-types:switching-pool-types;
+        }
+        list non-blocking-list {
+          key "nbl-number";
+          config false;
+          description
+            "List of ports in a non-blocking switch element";
+          leaf nbl-number {
+            type uint16;
+            description
+              "Identifier for this non-blocking-list. Unique within odu-switching-pool";
+          }
+          leaf interconnect-bandwidth-unit {
+            type uint32;
+            config false;
+            description
+              "Switch fabric interconnect bandwidth unit rate in bits per second. 
+               Represents granularity of switch fabric";
+          }
+          leaf interconnect-bandwidth {
+            type uint32;
+            config false;
+            description
+              "Total interconnect bandwidth for a non-blocking element expressed as 
+               number of inter-connect-bandwidth units";
+          }
+          list port-list {
+            key "circuit-pack-name port-name";
+            leaf circuit-pack-name {
+              type leafref {
+                path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+              }
+              config false;
+            }
+            leaf port-name {
+              type leafref {
+                path "/org-openroadm-device/circuit-packs/ports/port-name";
+              }
+              config false;
+              description
+                "Port name. Unique within device";
+            }
+          }
+          list pluggable-optics-holder-list {
+            key "circuit-pack-name slot-name";
+            leaf circuit-pack-name {
+              type leafref {
+                path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+              }
+              config false;
+              description
+                "Name of parent circuit-pack";
+            }
+            leaf slot-name {
+              type leafref {
+                path "/org-openroadm-device/circuit-packs/cp-slots/slot-name";
+              }
+              config false;
+              description
+                "Name of pluggable-optics-holder";
+            }
+          }
+        }
+      }
+    }
+  }
+
+  grouping mc-capabilities-g {
+    container mc-capabilities {
+      config false;
+      description
+        "Capabilities of the media channel on a degree or SRG.  This is used to validate mc-ttp provisioning on degrees and SRGs.";
+      leaf slot-width-granularity {
+        type org-openroadm-common-types:frequency-GHz;
+        default "50";
+        config false;
+        description
+          "Width of a slot measured in GHz.";
+      }
+      leaf center-freq-granularity {
+        type org-openroadm-common-types:frequency-GHz;
+        default "50";
+        config false;
+        description
+          "Granularity of allowed center frequencies.  The base frequency for this computation is 193.1 THz (G.694.1)";
+      }
+      leaf min-slots {
+        type uint32;
+        default "1";
+        config false;
+        description
+          "Minimum number of slots permitted to be joined together to form a media channel.  Must be less than or equal to the max-slots";
+      }
+      leaf max-slots {
+        type uint32;
+        default "1";
+        config false;
+        description
+          "Maximum number of slots permitted to be joined together to form a media channel.  Must be greater than or equal to the min-slots";
+      }
+    }
+  }
+
+  grouping common-session-parms {
+    description
+      "Common session parameters to identify a
+       management session.";
+    leaf username {
+      type org-openroadm-user-mgmt:username-type;
+      mandatory true;
+      description
+        "Name of the user for the session.";
+    }
+    leaf session-id {
+      type ietf-nc:session-id-or-zero-type;
+      mandatory true;
+      description
+        "Identifier of the session.
+         A NETCONF session MUST be identified by a non-zero value.
+         A non-NETCONF session MAY be identified by the value zero.";
+    }
+    leaf source-host {
+      type ietf-inet-types:ip-address;
+      description
+        "Address of the remote host for the session.";
+    }
+  }
+
+  grouping changed-by-parms {
+    description
+      "Common parameters to identify the source
+       of a change event, such as a configuration
+       or capability change.";
+    container changed-by {
+      description
+        "Indicates the source of the change.
+         If caused by internal action, then the
+         empty leaf 'server' will be present.
+         If caused by a management session, then
+         the name, remote host address, and session ID
+         of the session that made the change will be reported.";
+      choice server-or-user {
+        leaf server {
+          type empty;
+          description
+            "If present, the change was caused
+             by the server.";
+        }
+        case by-user {
+          uses common-session-parms;
+        }
+      }
+    }
+  }
+
+  rpc led-control {
+    description
+      "This command is used to allow user to find an entity on the NE,
+       The specified entity will have LED blinking.
+       The equipmentLedOn alarm will be raised and cleared for the indication";
+    input {
+      choice equipment-entity {
+        mandatory true;
+        case shelf {
+          leaf shelf-name {
+            type leafref {
+              path "/org-openroadm-device/shelves/shelf-name";
+            }
+            mandatory true;
+            description
+              "shelf-name for the operation";
+          }
+        }
+        case circuit-pack {
+          leaf circuit-pack-name {
+            type leafref {
+              path "/org-openroadm-device/circuit-packs/circuit-pack-name";
+            }
+            mandatory true;
+            description
+              "circuit-pack-name for the operation";
+          }
+        }
+      }
+      leaf enabled {
+        type boolean;
+        mandatory true;
+        description
+          "led-control enabled flag.
+           when enabled=true,  equipmentLedOn alarm will be raised
+           when enabled=false, equipmentLedOn alarm will be cleared";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc create-tech-info {
+    description
+      "Collects all log data for debugging and place it in a location accessible via ftp/sftp.
+       This model assumes ASYNC operation, i.e. the command will return after the device accepts the command,
+       A create-tech-info-notification will be send out later for the result of the operation.
+       The log-file is cleared at the start of every create-tech-info operation in order to ensure 
+       the up-to-date logs are collected. If a vendor does not support concurrent log collection, the second 
+       create-tech-info command will be rejected.";
+    input {
+      leaf shelf-id {
+        type leafref {
+          path "/org-openroadm-device/shelves/shelf-name";
+        }
+        description
+          "This optional field is used to specify the shelf for log collection. 
+           When this filed is not provided, it is expected to collect logs for the whole node.
+           Vendor should reject the command if the whole node log collection is not supported.";
+      }
+      leaf log-option {
+        type string;
+        description
+          "The log type a vendor can specify. Maybe used in future";
+      }
+    }
+    output {
+      uses create-tech-info-group;
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc get-connection-port-trail {
+    input {
+      leaf connection-name {
+        type string;
+        mandatory true;
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+      list ports {
+        uses org-openroadm-common-types:physical-location;
+        uses port-name {
+          refine "circuit-pack-name" {
+            mandatory true;
+          }
+          refine "port-name" {
+            mandatory true;
+          }
+        }
+      }
+    }
+  }
+  rpc disable-automatic-shutoff {
+    input {
+      choice degree-or-amp {
+        mandatory true;
+        description
+          "The choice describes the option to specify the entity for the disable-automatic-shutoff RPC. It can be degree-number for rdm and amp-number for ila";
+        case degree {
+          leaf degree-number {
+            type leafref {
+              path "/org-openroadm-device/degree/degree-number";
+            }
+            mandatory true;
+            description
+              "The degree-number defined in degree";
+          }
+        }
+        case amp {
+          leaf amp-number {
+            type leafref {
+              path "/org-openroadm-device/line-amplifier/amp-number";
+            }
+            mandatory true;
+            description
+              "The amp-number defined in line-amplifier";
+          }
+        }
+      }
+      leaf support-timer {
+        type uint16 {
+          range "1..600";
+        }
+        default "20";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc start-scan {
+    input {
+      choice degree-or-amp {
+        mandatory true;
+        description
+          "The choice describes the option to specify the entity for the start-scan RPC. It can be degree-number for rdm and amp-number for ila";
+        case degree {
+          leaf degree-number {
+            type leafref {
+              path "/org-openroadm-device/degree/degree-number";
+            }
+            mandatory true;
+            description
+              "The degree-number defined in degree";
+          }
+        }
+        case amp {
+          leaf amp-number {
+            type leafref {
+              path "/org-openroadm-device/line-amplifier/amp-number";
+            }
+            mandatory true;
+            description
+              "The amp-number defined in line-amplifier";
+          }
+        }
+      }
+      leaf port-direction {
+        type org-openroadm-common-types:direction;
+      }
+      leaf distance {
+        type uint32;
+      }
+      leaf resolution {
+        type uint32;
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc set-current-datetime {
+    description
+      "Set the info/current-datetime leaf to the specified value.";
+    input {
+      leaf current-datetime {
+        type ietf-yang-types:date-and-time;
+        mandatory true;
+        description
+          "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  notification create-tech-info-notification {
+    description
+      "This Notification is sent when the create-tech-info is complete or failed.";
+    uses create-tech-info-group;
+    uses org-openroadm-common-types:rpc-response-status;
+  }
+  notification otdr-scan-result {
+    leaf status {
+      type enumeration {
+        enum "Completed" {
+          value 1;
+        }
+        enum "Failed" {
+          value 2;
+        }
+      }
+      mandatory true;
+      description
+        "Completed or Failed for the scan's final status";
+    }
+    leaf result-file {
+      type string;
+    }
+  }
+  notification change-notification {
+    description
+      "The Notification that a resource has been added, modified or removed.
+       This notification can be triggered by changes in configuration and operational data.
+       It shall contain the changed field pointed by the xpath. 
+       Typically it is not intended for frequently changing volatile data e.g. PM, power levels";
+    leaf change-time {
+      type ietf-yang-types:date-and-time;
+      description
+        "The time the change occurs.";
+    }
+    uses changed-by-parms;
+    leaf datastore {
+      type enumeration {
+        enum "running" {
+          description
+            "The <running> datastore has changed.";
+        }
+        enum "startup" {
+          description
+            "The <startup> datastore has changed";
+        }
+      }
+      default "running";
+      description
+        "Indicates which configuration datastore has changed.";
+    }
+    list edit {
+      description
+        "An edit (change) record SHOULD be present for each distinct
+         edit operation that the server has detected on
+         the target datastore.  This list MAY be omitted
+         if the detailed edit operations are not known.
+         The server MAY report entries in this list for
+         changes not made by a NETCONF session.";
+      leaf target {
+        type instance-identifier;
+        description
+          "Top most node associated with the configuration or operational change.
+           A server SHOULD set this object to the node within
+           the datastore that is being altered.  A server MAY
+           set this object to one of the ancestors of the actual
+           node that was changed, or omit this object, if the
+           exact node is not known.";
+      }
+      leaf operation {
+        type ietf-nc:edit-operation-type;
+        description
+          "Type of edit operation performed.
+           A server MUST set this object to the NETCONF edit
+           operation performed on the target datastore.";
+      }
+    }
+  }
+  uses org-openroadm-device-container;
+}
index 869a2c9ccea18eebe9bcca611b302b951bdb4ca0..8e6ad10edd80a9ed1a17c3b8264d0992f2790d40 100644 (file)
@@ -4,9 +4,11 @@ module org-openroadm-ethernet-interfaces {
 
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
   import org-openroadm-interfaces {
     prefix openROADM-if;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -14,45 +16,45 @@ module org-openroadm-ethernet-interfaces {
     "OpenROADM.org";
   description
     "YANG definitions for device facility ethernet interfaces.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
-     Also contains code components extracted from IETF Interfaces.  These code components
+     
+     Also contains code components extracted from IETF Interfaces.  These code components 
      are copyrighted and licensed as follows:
-
-     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
-     All rights reserved.
-
-     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
-     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
-     publication of this document. Please review these documents carefully, as they
-     describe your rights and restrictions with respect to this document. Code Components
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
      extracted from this document must include Simplified BSD License text as described in
-     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
      described in the Simplified BSD License.";
 
   revision 2016-10-14 {
@@ -64,7 +66,7 @@ module org-openroadm-ethernet-interfaces {
     leaf speed {
       type uint32;
       description
-        "Set speed of the interface, unit mbps.
+        "Set speed of the interface, unit mbps. 
          This is for ETH facility. ";
     }
     leaf fec {
@@ -73,7 +75,7 @@ module org-openroadm-ethernet-interfaces {
         enum rsfec;
       }
       description "Forward Error Correction Choices. ";
-    }
+    }                                      
     leaf duplex {
       type enumeration {
         enum "half" {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-ethernet-interfaces@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-ethernet-interfaces@2017-12-15.yang
new file mode 100644 (file)
index 0000000..3b5040e
--- /dev/null
@@ -0,0 +1,161 @@
+module org-openroadm-ethernet-interfaces {
+  namespace "http://org/openroadm/ethernet-interfaces";
+  prefix org-openroadm-eth-interfaces;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix openROADM-if;
+    revision-date 2017-06-26;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility ethernet interfaces.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components 
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping eth-attributes {
+    leaf speed {
+      type uint32;
+      description
+        "Set speed of the interface, unit mbps. 
+         This is for ETH facility. ";
+    }
+    leaf fec {
+      type enumeration {
+        enum "off";
+        enum "rsfec";
+      }
+      description
+        "Forward Error Correction Choices. ";
+    }
+    leaf duplex {
+      type enumeration {
+        enum "half" {
+          value 0;
+          description
+            "half duplex";
+        }
+        enum "full" {
+          value 1;
+          description
+            "full duplex";
+        }
+      }
+      default "full";
+      description
+        "Set duplex selections.";
+    }
+    leaf mtu {
+      type uint32 {
+        range "1518..9000";
+      }
+      default "1522";
+      description
+        "Set Maximum Frame Size.";
+    }
+    leaf auto-negotiation {
+      type enumeration {
+        enum "enabled" {
+          value 1;
+          description
+            "Auto Negotiation enabled";
+        }
+        enum "disabled" {
+          value 0;
+          description
+            "Auto Negotiation disabled";
+        }
+      }
+      default "enabled";
+      description
+        "Set Auto Negotiation: Enabled/Disabled.";
+    }
+    leaf curr-speed {
+      type string;
+      config false;
+      description
+        "speed (UNKNOWN/AUTO/10/100/1000/10000) corresponding to the interface";
+    }
+    leaf curr-duplex {
+      type string;
+      config false;
+      description
+        "duplex (HALF/FULL) corresponding to the interface";
+    }
+  }
+
+  grouping ethernet-container {
+    container ethernet {
+      description
+        "Ethernet Interfaces";
+      uses eth-attributes;
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
+    when "org-openroadm-device:type = 'openROADM-if:ethernetCsmacd'";
+    uses ethernet-container;
+  }
+}
index 1e1c8ff1046ed1ca997f38a7659afed4b6c8f398..d1d38a3ad2003456f558241c3e0aa6c042d93682 100644 (file)
@@ -8,38 +8,39 @@ module org-openroadm-file-transfer {
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
-  }
+    revision-date 2016-10-14;
+  } 
 
   organization "Open ROADM MSA";
   contact
     "OpenROADM.org";
   description
     "YANG definitions for file management related rpcs.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
@@ -81,10 +82,10 @@ module org-openroadm-file-transfer {
         type inet:uri;
         mandatory true;
         description
-          "Remote file path.
+          "Remote file path. 
            A URI for the remote file path.
-
-           Format:sftp://user[:password]@host[:port]/path.
+           
+           Format:sftp://user[:password]@host[:port]/path. 
            Ex: sftp://test:verify@[2001:db8:0:1::10]:22/home/user/sample";
       }
     }
diff --git a/ordmodels/device/src/main/yang/org-openroadm-file-transfer@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-file-transfer@2017-12-15.yang
new file mode 100644 (file)
index 0000000..55514ab
--- /dev/null
@@ -0,0 +1,189 @@
+module org-openroadm-file-transfer {
+  namespace "http://org/openroadm/file-transfer";
+  prefix org-openroadm-file-txr;
+
+  import ietf-inet-types {
+    prefix inet;
+    revision-date 2013-07-15;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for file management related rpcs.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  rpc transfer {
+    description
+      "File transfer using FTP/SFTP";
+    input {
+      leaf action {
+        type enumeration {
+          enum "upload" {
+            description
+              "Specify the upload action. The NE (SFTP/FTP client) sends
+               the file identified by the local-file-path
+               to the remote-file-path.";
+          }
+          enum "download" {
+            description
+              "Specify the download action. The NE (SFTP/FTP client) retrieves
+               the file identified by the remote-file-path
+               to the local-file-path.";
+          }
+        }
+        mandatory true;
+        description
+          "Type of action - download/upload.";
+      }
+      leaf local-file-path {
+        type string;
+        mandatory true;
+        description
+          "Local file path.
+           Ex: /var/shared/example.txt";
+      }
+      leaf remote-file-path {
+        type inet:uri;
+        mandatory true;
+        description
+          "Remote file path. 
+           A URI for the remote file path.
+           
+           Format:sftp://user[:password]@host[:port]/path. 
+           Ex: sftp://test:verify@[2001:db8:0:1::10]:22/home/user/sample";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc show-file {
+    description
+      "Show one or more files in the specified directory.";
+    input {
+      leaf filename {
+        type string {
+          length "1..255";
+        }
+        default "*";
+        description
+          "Specify file(s) to be listed (* is allowed as wild-card). ";
+      }
+    }
+    output {
+      leaf status {
+        type enumeration {
+          enum "Successful" {
+            value 1;
+          }
+          enum "Failed" {
+            value 2;
+          }
+        }
+        mandatory true;
+        description
+          "Successful or Failed";
+      }
+      leaf-list status-message {
+        type string;
+        description
+          "Gives a more detailed reason for success / failure";
+      }
+    }
+  }
+  rpc delete-file {
+    description
+      "Delete one or more files in the specified directory.";
+    input {
+      leaf filename {
+        type string {
+          length "1..255";
+        }
+        mandatory true;
+        description
+          "Specify file(s) to be deleted (* is allowed as wild-card).";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  notification transfer-notification {
+    description
+      "notification for transfer operation events.";
+    leaf local-file-path {
+      type string;
+      description
+        "Local file path used in transfer RPC.";
+    }
+    uses org-openroadm-common-types:extended-rpc-response-status;
+    container progress {
+      when "current()/../status = 'In-progress'";
+      description
+        "progress status when response is in-progress";
+      leaf bytes-transferred {
+        type uint64;
+        description
+          "bytes transferred.";
+      }
+      leaf percentage-complete {
+        type uint8;
+        description
+          "percentage completed.";
+      }
+    }
+  }
+}
index 95225f3f9eaa46a6f1b2ebe3970fab5d6deadd62..51f23b190642414ba2b93f18eeb9ff496dec9431 100644 (file)
@@ -4,37 +4,38 @@ module org-openroadm-fwdl {
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
-  }
+    revision-date 2016-10-14;
+  }   
   organization "Open ROADM MSA";
   contact
     "OpenROADM.org";
   description
     "This module contains definitions for System Management.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-fwdl@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-fwdl@2017-12-15.yang
new file mode 100644 (file)
index 0000000..bd09d52
--- /dev/null
@@ -0,0 +1,74 @@
+module org-openroadm-fwdl {
+  namespace "http://org/openroadm/fwdl";
+  prefix org-openroadm-fwdl;
+
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "This module contains definitions for System Management.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  rpc fw-update {
+    description
+      "Fpga data update";
+    input {
+      leaf circuit-pack-name {
+        type string;
+        description
+          "Name of the circuit pack";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+}
diff --git a/ordmodels/device/src/main/yang/org-openroadm-interfaces2017-06-26.yang b/ordmodels/device/src/main/yang/org-openroadm-interfaces2017-06-26.yang
new file mode 100644 (file)
index 0000000..88001a6
--- /dev/null
@@ -0,0 +1,125 @@
+module org-openroadm-interfaces {
+  namespace "http://org/openroadm/interfaces";
+  prefix openROADM-if;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility interfaces. 
+     Reused ietf-interfaces and some interface-type defined in iana-if-type.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components 
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
+     described in the Simplified BSD License.";
+
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  identity interface-type {
+    description
+      "Base identity from which specific interface types are
+       derived.";
+  }
+
+  identity ethernetCsmacd {
+    base interface-type;
+    description
+      "For all Ethernet-like interfaces, regardless of speed,
+       as per RFC 3635.";
+    reference
+      "RFC 3635 - Definitions of Managed Objects for the
+                  Ethernet-like Interface Types";
+  }
+
+  identity ip {
+    base interface-type;
+    description
+      "IP (for APPN HPR in IP networks).";
+  }
+
+  identity mediaChannelTrailTerminationPoint {
+    base interface-type;
+    description
+      "Media Channel Trail Termination Point";
+  }
+
+  identity networkMediaChannelConnectionTerminationPoint {
+    base interface-type;
+    description
+      "Network Media Channel Connection Termination Point";
+  }
+
+  identity opticalChannel {
+    base interface-type;
+    description
+      "Optical Channel.";
+  }
+
+  identity opticalTransport {
+    base interface-type;
+    description
+      "Optical Transport.";
+  }
+
+  identity otnOdu {
+    base interface-type;
+    description
+      "OTN Optical Data Unit.";
+  }
+
+  identity otnOtu {
+    base interface-type;
+    description
+      "OTN Optical channel Transport Unit.";
+  }
+
+  identity openROADMOpticalMultiplex {
+    base interface-type;
+    description
+      "Optical Transport Multiplex type for openROADM";
+  }
+}
index acd74fe6c9828de9bf1adcbd19e827b8b0f18b07..347f9635b117b06932b7ecea3d43f842711f3664 100644 (file)
@@ -6,47 +6,47 @@ module org-openroadm-interfaces {
   contact
     "OpenROADM.org";
   description
-    "YANG definitions for device facility interfaces.
+    "YANG definitions for device facility interfaces. 
      Reused ietf-interfaces and some interface-type defined in iana-if-type.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
-     Also contains code components extracted from IETF Interfaces.  These code components
+     
+     Also contains code components extracted from IETF Interfaces.  These code components 
      are copyrighted and licensed as follows:
-
-     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
-     All rights reserved.
-
-     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
-     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
-     publication of this document. Please review these documents carefully, as they
-     describe your rights and restrictions with respect to this document. Code Components
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
      extracted from this document must include Simplified BSD License text as described in
-     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
      described in the Simplified BSD License.";
 
   revision 2016-10-14 {
index d7813304a939c7d5ca892021b2f8f22e7edb8f66..25f264ea56ee74b8001e621dd2214db7e0bdb84f 100644 (file)
@@ -7,12 +7,14 @@ module org-openroadm-lldp {
   }
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
   import iana-afn-safi {
     prefix ianaaf;
   }
   import org-openroadm-resource-types {
     prefix org-openroadm-resource-types;
+    revision-date 2016-10-14;
   }
   import ietf-yang-types {
     prefix yang;
@@ -23,38 +25,38 @@ module org-openroadm-lldp {
     "OpenROADM.org";
   description
     "YANG definitions for lldp protocol.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
     description
       "Version 1.2";
   }
-  grouping nbr-info-grp {
+  grouping nbr-info-grp { 
     description
       "Display LLDP Neighbour ";
 
@@ -169,13 +171,13 @@ module org-openroadm-lldp {
       }
       description
         "Chassis ID Subtype Enumeration";
-    }
+    }    
     leaf remoteChassisId {
       type string;
       description
         "remote neighbour Chassis Id";
-    }
-  }
+    }                                         
+  }           
 
   grouping lldp-container {
     container lldp {
@@ -257,9 +259,9 @@ module org-openroadm-lldp {
             type string;
             description
               "Ethernet interface name where LLDP runs";
-          }
+          }                               
           uses nbr-info-grp;
-        }
+        }                             
       }
     }
   }
@@ -280,17 +282,17 @@ module org-openroadm-lldp {
             remoteChassisId
             All of the above attributes are sent in event";
     leaf notification-type {
-      type org-openroadm-resource-types:resource-notification-type;
+      type org-openroadm-resource-types:resource-notification-type; 
     }
     leaf resource-type {
       type org-openroadm-resource-types:resource-type-enum;
-      description
-        "resource-type for this notification is interface";
+      description  
+        "resource-type for this notification is interface";  
     }
-    leaf resource {
+    leaf resource {         
       type string;
-      description
-        "resource interface-name";
+      description  
+        "resource interface-name";  
     }
     container nbr-info {
       uses nbr-info-grp;
@@ -298,5 +300,5 @@ module org-openroadm-lldp {
     leaf event-time {
       type yang:date-and-time;
     }
-  }
+  }                    
 }
diff --git a/ordmodels/device/src/main/yang/org-openroadm-lldp@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-lldp@2017-12-15.yang
new file mode 100644 (file)
index 0000000..ea7ba55
--- /dev/null
@@ -0,0 +1,324 @@
+module org-openroadm-lldp {
+  namespace "http://org/openroadm/lldp";
+  prefix org-openroadm-lldp;
+
+  import ietf-inet-types {
+    prefix inet;
+    revision-date 2013-07-15;
+  }
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import iana-afn-safi {
+    prefix ianaaf;
+    revision-date 2013-07-04;
+  }
+  import org-openroadm-resource-types {
+    prefix org-openroadm-resource-types;
+    revision-date 2017-12-15;
+  }
+  import ietf-yang-types {
+    prefix yang;
+    revision-date 2013-07-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for lldp protocol.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping nbr-info-grp {
+    description
+      "Display LLDP Neighbour ";
+    leaf remoteSysName {
+      type string;
+      description
+        "remote neighbour system name";
+    }
+    leaf remoteMgmtAddressSubType {
+      type ianaaf:address-family;
+      description
+        "remote neighbour Management Address Subtype Enumeration";
+    }
+    leaf remoteMgmtAddress {
+      type inet:ip-address;
+      description
+        "remote neighbour management address";
+    }
+    leaf remotePortIdSubType {
+      type enumeration {
+        enum "other" {
+          value 0;
+          description
+            "reserved";
+        }
+        enum "ifalias" {
+          value 1;
+          description
+            "Interface Alias (IfAlias - IETF RFC 2863) ";
+        }
+        enum "portcomponent" {
+          value 2;
+          description
+            "Port component (EntPhysicalAlias IETF RFC 4133)";
+        }
+        enum "macaddress" {
+          value 3;
+          description
+            "MAC address (IEEE Std 802) ";
+        }
+        enum "networkaddress" {
+          value 4;
+          description
+            "Network Address";
+        }
+        enum "ifname" {
+          value 5;
+          description
+            "Interface Name (ifName - IETF RFC 2863)";
+        }
+        enum "agentcircuitid" {
+          value 6;
+          description
+            "Agent Circuit Id (IETF RFC 3046)";
+        }
+        enum "local" {
+          value 7;
+          description
+            "Locally assigned";
+        }
+      }
+      description
+        "remote neighbour Port ID Subtype Enumeration";
+    }
+    leaf remotePortId {
+      type string;
+      description
+        "remote neighbour port Id";
+    }
+    leaf remoteChassisIdSubType {
+      type enumeration {
+        enum "reserved" {
+          value 0;
+          description
+            "reserved";
+        }
+        enum "chassiscomponent" {
+          value 1;
+          description
+            "Chassis component (EntPhysicalAlias IETF RFC 4133)";
+        }
+        enum "ifalias" {
+          value 2;
+          description
+            "Interface Alias (IfAlias - IETF RFC 2863) ";
+        }
+        enum "portcomponent" {
+          value 3;
+          description
+            "Port component (EntPhysicalAlias IETF RFC 4133)";
+        }
+        enum "macaddress" {
+          value 4;
+          description
+            "MAC address (IEEE Std 802) ";
+        }
+        enum "networkaddress" {
+          value 5;
+          description
+            "Network Address";
+        }
+        enum "ifname" {
+          value 6;
+          description
+            "Interface Name (ifName - IETF RFC 2863)";
+        }
+        enum "local" {
+          value 7;
+          description
+            "Locally assigned";
+        }
+      }
+      description
+        "Chassis ID Subtype Enumeration";
+    }
+    leaf remoteChassisId {
+      type string;
+      description
+        "remote neighbour Chassis Id";
+    }
+  }
+
+  grouping lldp-container {
+    container lldp {
+      description
+        "LLDP configurable and retrievable";
+      container global-config {
+        description
+          "LLDP global configurations";
+        leaf adminStatus {
+          type enumeration {
+            enum "disable" {
+              value 0;
+              description
+                "Disable the LLDP feature per NE";
+            }
+            enum "enable" {
+              value 1;
+              description
+                "Enable the LLDP feature per NE";
+            }
+          }
+          default "enable";
+          description
+            "LLDP feature Enable/Disable per NE";
+        }
+        leaf msgTxInterval {
+          type uint16 {
+            range "5..32768";
+          }
+          default "30";
+          description
+            "LLDP frame Retransmit Interval in seconds";
+        }
+        leaf msgTxHoldMultiplier {
+          type uint8 {
+            range "2..10";
+          }
+          default "4";
+          description
+            "TTL value for the TLVs transmitter over wire in seconds";
+        }
+      }
+      list port-config {
+        key "ifName";
+        description
+          "LLDP port configurations";
+        leaf ifName {
+          type leafref {
+            path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
+          }
+          description
+            "Ethernet interface name where LLDP runs";
+        }
+        leaf adminStatus {
+          type enumeration {
+            enum "disable" {
+              value 0;
+              description
+                "Disables the LLDP frames transmit and receive on specific interface";
+            }
+            enum "txandrx" {
+              value 1;
+              description
+                "Enable Transmit and Receive LLDP frames on specific interface";
+            }
+          }
+          default "txandrx";
+          description
+            "LLDP enable per port basis";
+        }
+      }
+      container nbr-list {
+        config false;
+        description
+          "LLDP Oper data - Neighbour List information";
+        list if-name {
+          key "ifName";
+          leaf ifName {
+            type string;
+            description
+              "Ethernet interface name where LLDP runs";
+          }
+          uses nbr-info-grp;
+        }
+      }
+    }
+  }
+
+  notification lldp-nbr-info-change {
+    description
+      "LLDP: Neighbor Information Changed
+       remoteSysName
+       remoteSysMgmtAddressSubType
+       remoteSysMgmtAddress
+       remotePortIdSubType
+       remotePortId
+       remoteChassisIdSubType
+       remoteChassisId
+       All of the above attributes are sent in event";
+    leaf notification-type {
+      type org-openroadm-resource-types:resource-notification-type;
+    }
+    leaf resource-type {
+      type org-openroadm-resource-types:resource-type-enum;
+      description
+        "resource-type for this notification is interface";
+    }
+    leaf resource {
+      type string;
+      description
+        "resource interface-name";
+    }
+    container nbr-info {
+      uses nbr-info-grp;
+    }
+    leaf event-time {
+      type yang:date-and-time;
+    }
+  }
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
+    when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='rdm' or /org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='ila'";
+    uses lldp-container;
+  }
+}
index 4f50786b27feba4325c47d9b43ad4e850c472e93..519d9378beb57253e51a0a1fb2db570643367a7d 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-maintenance-loopback {
     "OpenROADM.org";
   description
     "YANG definitions for maintenance loopback.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-maintenance-loopback@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-maintenance-loopback@2017-12-15.yang
new file mode 100644 (file)
index 0000000..da8f5cd
--- /dev/null
@@ -0,0 +1,80 @@
+module org-openroadm-maintenance-loopback {
+  namespace "http://org/openroadm/maintenance-loopback";
+  prefix org-openroadm-maint-loopback;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for maintenance loopback.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping maint-loopback {
+    container maint-loopback {
+      leaf enabled {
+        type boolean;
+        default "false";
+        description
+          "loopback operation enable flag";
+      }
+      leaf type {
+        when "../enabled = 'true'";
+        type enumeration {
+          enum "fac" {
+            value 0;
+            description
+              "pre-FEC Loopback in the facility direction";
+          }
+          enum "term" {
+            value 1;
+            description
+              "Loopback in the terminal direction";
+          }
+          enum "fac2" {
+            value 2;
+            description
+              "post-FEC Loopback in the facility direction";
+          }
+        }
+        default "fac";
+        description
+          "Set Loopback type (or direction).";
+      }
+    }
+  }
+}
index 67d980b075dc1495f0a29f9bc018056a7c798eac..b28cd6b2c421d5c7ccec8d9e9daeaa59a5482cc9 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-maintenance-testsignal {
     "OpenROADM.org";
   description
     "YANG definitions for maintenance testsignal.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-maintenance-testsignal@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-maintenance-testsignal@2017-12-15.yang
new file mode 100644 (file)
index 0000000..9816505
--- /dev/null
@@ -0,0 +1,139 @@
+module org-openroadm-maintenance-testsignal {
+  namespace "http://org/openroadm/maintenance-testsignal";
+  prefix org-openroadm-maint-testsignal;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for maintenance testsignal.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping maint-testsignal {
+    container maint-testsignal {
+      leaf enabled {
+        type boolean;
+        default "false";
+        description
+          "testsignal enabled flag";
+      }
+      leaf testPattern {
+        when "../enabled = 'true'";
+        type enumeration {
+          enum "PRBS" {
+            value 0;
+            description
+              "Unframed, inverted PN-31 pattern or PRBS31 pattern per IEEE 802.3 clause 50.3.8.2 (inverted PN-31at line rate)";
+          }
+          enum "PRBS31" {
+            value 1;
+            description
+              "PRBS31 with standard mapping per G.709";
+          }
+          enum "PRBS23" {
+            value 2;
+            description
+              "SONET/SDH Framed,inverted PN-23 pattern.";
+          }
+          enum "PRZEROS" {
+            value 3;
+            description
+              "pseudo-random with zeros data pattern per IEEE 802.3 clause 49.2.8";
+          }
+          enum "IDLE" {
+            value 4;
+            description
+              "Scrambled IDLE test-pattern per IEEE 802.3ba";
+          }
+        }
+        description
+          "Set test signal pattern";
+      }
+      leaf type {
+        when "../enabled = 'true'";
+        type enumeration {
+          enum "fac" {
+            value 0;
+            description
+              "test signal in the facility direction";
+          }
+          enum "term" {
+            value 1;
+            description
+              "test signal in the terminal direction";
+          }
+        }
+        default "fac";
+        description
+          "Set test signal type (or direction).";
+      }
+      leaf bitErrors {
+        when "../enabled = 'true' and ../type = 'fac'";
+        type uint32 {
+          range "0..4294967295";
+        }
+        config false;
+        description
+          "bit errors for test signal in facility direction.";
+      }
+      leaf bitErrorsTerminal {
+        when "../enabled = 'true' and ../type = 'term'";
+        type uint32 {
+          range "0..4294967295";
+        }
+        config false;
+        description
+          "bit errors for test signal in terminal direction.";
+      }
+      leaf syncSeconds {
+        when "../enabled = 'true' and ../type = 'fac'";
+        type string;
+        config false;
+        description
+          "number of seconds the received facility test signal is in sync.";
+      }
+      leaf syncSecondsTerminal {
+        when "../enabled = 'true' and ../type = 'term'";
+        type string;
+        config false;
+        description
+          "number of seconds the received terminal test signal is in sync.";
+      }
+    }
+  }
+}
diff --git a/ordmodels/device/src/main/yang/org-openroadm-media-channel-interfaces@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-media-channel-interfaces@2017-12-15.yang
new file mode 100644 (file)
index 0000000..2a46a1c
--- /dev/null
@@ -0,0 +1,123 @@
+module org-openroadm-media-channel-interfaces {
+  namespace "http://org/openroadm/media-channel-interfaces";
+  prefix org-openroadm-media-channel-interfaces;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix openROADM-if;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility och interfaces.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+
+  grouping mc-ttp-attributes {
+    description
+      "Media channel termination point. Models bandwidth allocation in physical media. Network media channels may be provisioned in the spectrum characterized by the frequency limits.";
+    leaf min-freq {
+      type org-openroadm-common-types:frequency-THz;
+      config true;
+      description
+        "Minimum Frequency in THz. Granularity is hardware dependent, based on pixel resolution. eg. ITU 12.5GHz frequency slots. Range covers C+L";
+    }
+    leaf max-freq {
+      type org-openroadm-common-types:frequency-THz;
+      config true;
+      description
+        "Maximum Frequency in THz. Granularity is hardware dependent, based on pixel resolution. eg. ITU 12.5GHz frequency slots. Range covers C+L";
+    }
+    leaf center-freq {
+      type org-openroadm-common-types:frequency-THz;
+      config false;
+      description
+        "Center Frequency in THz. Granularity is hardware dependent, based on center-freq-granularity.";
+    }
+    leaf slot-width {
+      type org-openroadm-common-types:frequency-GHz;
+      config false;
+      description
+        "Width of the slot.  Granularity is hardware dependent, based on slot-width-granularity";
+    }
+  }
+
+  grouping mc-ttp-container {
+    container mc-ttp {
+      description
+        "Media Channel Trail Termination Point (MC-TTP)";
+      uses mc-ttp-attributes;
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
+    when "org-openroadm-device:type = 'openROADM-if:mediaChannelTrailTerminationPoint'";
+    uses mc-ttp-container;
+  }
+}
diff --git a/ordmodels/device/src/main/yang/org-openroadm-network-media-channel-interfaces@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-network-media-channel-interfaces@2017-12-15.yang
new file mode 100644 (file)
index 0000000..31fec67
--- /dev/null
@@ -0,0 +1,111 @@
+module org-openroadm-network-media-channel-interfaces {
+  namespace "http://org/openroadm/network-media-channel-interfaces";
+  prefix org-openroadm-network-media-channel-interfaces;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix openROADM-if;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility och interfaces.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+
+  grouping nmc-ctp-attributes {
+    description
+      "Network Media Channel attributes";
+    leaf frequency {
+      type org-openroadm-common-types:frequency-THz;
+      config true;
+      description
+        "Center Frequency in THz.  This is not constrained by mc-capabilities.  It must fit (when combined with width) inside any containing media channel.";
+    }
+    leaf width {
+      type org-openroadm-common-types:frequency-GHz;
+      config true;
+      description
+        "Frequency width in GHz.  This is not constrained by mc-capabilities.  It must fit (when combined with frequency) inside any containing media channel.";
+    }
+  }
+
+  grouping nmc-ctp-container {
+    container nmc-ctp {
+      description
+        "Network Media Channel Connection Termination Point (NMC-CTP)";
+      uses nmc-ctp-attributes;
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
+    when "org-openroadm-device:type = 'openROADM-if:networkMediaChannelConnectionTerminationPoint'";
+    uses nmc-ctp-container;
+  }
+}
index 921ac438f39bd7d07548fbd4c5e0c494f42ddb42..1504cc0748aeb6917a7ce71975897775cf52152b 100644 (file)
@@ -4,53 +4,55 @@ module org-openroadm-optical-channel-interfaces {
 
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
   import org-openroadm-interfaces {
     prefix openROADM-if;
+    revision-date 2016-10-14;
   }
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
     revision-date 2016-10-14;
-  }
+  }   
 
   organization "Open ROADM MSA";
   contact
     "OpenROADM.org";
   description
     "YANG definitions for device facility och interfaces.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
+     
      Also contains code components extracted from IETF Interfaces.  These code components
      are copyrighted and licensed as follows:
-
+     
      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
      All rights reserved.
-
+     
      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
      publication of this document. Please review these documents carefully, as they
@@ -166,7 +168,7 @@ module org-openroadm-optical-channel-interfaces {
       type org-openroadm-common-types:power-dBm;
       description
         "The target transmit power for this channel. When set, the xponder will work to ensure that port-current-power reaches this level. Applicable only to channel on top of xpdr-network port";
-    }
+    }     
   }
 
   grouping och-container {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-optical-channel-interfaces@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-optical-channel-interfaces@2017-12-15.yang
new file mode 100644 (file)
index 0000000..d8929e0
--- /dev/null
@@ -0,0 +1,131 @@
+module org-openroadm-optical-channel-interfaces {
+  namespace "http://org/openroadm/optical-channel-interfaces";
+  prefix org-openroadm-optical-channel-interfaces;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix openROADM-if;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility och interfaces.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping och-attributes {
+    description
+      "Optical Channel attributes";
+    leaf rate {
+      type identityref {
+        base org-openroadm-common-types:och-rate-identity;
+      }
+      description
+        "rate";
+    }
+    leaf frequency {
+      type org-openroadm-common-types:frequency-THz;
+      config true;
+      description
+        "Center Frequency in THz.";
+    }
+    leaf width {
+      type org-openroadm-common-types:frequency-GHz;
+      config false;
+      description
+        "Frequency width in GHz.";
+    }
+    leaf modulation-format {
+      type org-openroadm-common-types:modulation-format;
+    }
+    leaf transmit-power {
+      type org-openroadm-common-types:power-dBm;
+      description
+        "The target transmit power for this channel. When set, the xponder will work to ensure that port-current-power reaches this level. Applicable only to channel on top of xpdr-network port";
+    }
+  }
+
+  grouping och-container {
+    container och {
+      description
+        "Optical Channel (OCh):
+         Models the optical channel interfaces for an Optical White Box.";
+      uses och-attributes;
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
+    when "org-openroadm-device:type = 'openROADM-if:opticalChannel'";
+    uses och-container;
+  }
+}
index 55032413e5212156efbb8737c2b8c3ee3bd626c9..cef360e8cf26be8e36c5af0430da6e01e9f71df4 100644 (file)
@@ -4,6 +4,7 @@ module org-openroadm-optical-multiplex-interfaces {
 
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
 
   organization "Open ROADM MSA";
@@ -12,39 +13,39 @@ module org-openroadm-optical-multiplex-interfaces {
   description
     "This module contains YANG definitions
      for the Optical multiplex Interfaces (OMS).
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
+     
      Also contains code components extracted from IETF Interfaces.  These code components
      are copyrighted and licensed as follows:
-
+     
      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
      All rights reserved.
-
+     
      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
      publication of this document. Please review these documents carefully, as they
index 75a909bab23767a87f62f5ba9565b190907cc279..d1b6f44096218da83130cbb040c39bed9607cc68 100644 (file)
@@ -4,14 +4,16 @@ module org-openroadm-optical-transport-interfaces {
 
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
   import org-openroadm-interfaces {
     prefix openROADM-if;
+    revision-date 2016-10-14;
   }
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
     revision-date 2016-10-14;
-  }
+  }       
 
   organization "Open ROADM MSA";
   contact
@@ -19,39 +21,39 @@ module org-openroadm-optical-transport-interfaces {
   description
     "This module contains YANG definitions
      for the Optical Transport Interfaces.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
+     
      Also contains code components extracted from IETF Interfaces.  These code components
      are copyrighted and licensed as follows:
-
+     
      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
      All rights reserved.
-
+     
      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
      publication of this document. Please review these documents carefully, as they
@@ -125,7 +127,7 @@ module org-openroadm-optical-transport-interfaces {
       description
         "Span loss on the transmitter side. Set by the controller and used by device to configure MSA compliant channel launch power";
       type org-openroadm-common-types:ratio-dB;
-    }
+    }                                   
   }
 
   grouping ots-container {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-optical-transport-interfaces@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-optical-transport-interfaces@2017-12-15.yang
new file mode 100644 (file)
index 0000000..1982e3c
--- /dev/null
@@ -0,0 +1,183 @@
+module org-openroadm-optical-transport-interfaces {
+  namespace "http://org/openroadm/optical-transport-interfaces";
+  prefix org-openroadm-optical-transport-interfaces;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix openROADM-if;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "This module contains YANG definitions
+     for the Optical Transport Interfaces.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping ots-attributes {
+    description
+      "Optical Transport Section (OTS) attributes";
+    leaf fiber-type {
+      type enumeration {
+        enum "smf" {
+          value 0;
+          description
+            "Single Mode Fiber";
+        }
+        enum "eleaf" {
+          value 1;
+          description
+            "ELEAF";
+        }
+        enum "oleaf" {
+          value 2;
+          description
+            "OLEAF";
+        }
+        enum "dsf" {
+          value 3;
+          description
+            "DSF";
+        }
+        enum "truewave" {
+          value 4;
+          description
+            "TRUEWAVE Reduced Slope";
+        }
+        enum "truewavec" {
+          value 5;
+          description
+            "TRUEWAVE Classic";
+        }
+        enum "nz-dsf" {
+          value 6;
+          description
+            "NZ-DSF";
+        }
+        enum "ull" {
+          value 7;
+          description
+            "Ultra Low Loss (ULL)";
+        }
+      }
+      default "smf";
+      description
+        "fiber type
+         Default    : SMF ";
+    }
+    leaf span-loss-receive {
+      type org-openroadm-common-types:ratio-dB;
+      description
+        "Span loss on the receiver side. Set by the controller and used by device to set AMP gain.";
+    }
+    leaf span-loss-transmit {
+      type org-openroadm-common-types:ratio-dB;
+      description
+        "Span loss on the transmitter side. Set by the controller and used by device to configure MSA compliant channel launch power";
+    }
+    leaf ingress-span-loss-aging-margin {
+      type org-openroadm-common-types:ratio-dB;
+      default "0";
+      config true;
+      description
+        "Span-loss margin used to set optical amplifier gain and output-voa.
+         Day one attenuation of the link, at initial commissioning may increase across wdm link life.
+         span-loss-aging-margin defines the maximum additional loss the wdm link may experience in addition
+         to initial loss without requiring a new design (new amplifier settings). ";
+    }
+    leaf eol-max-load-pIn {
+      type org-openroadm-common-types:power-dBm;
+      config true;
+      description
+        "End Of Life Total input power at maximum load used for amplifier control.
+         Calculated during the design, this value shall be used by the amplifier device
+         for the setting so that the reasonable margin is kept to reach this value
+         at the end of life of the wdm link, considering span-loss aging margins are reached ";
+    }
+  }
+
+  grouping ots-container {
+    container ots {
+      description
+        "Optical Transport Section (OTS):
+          Models the optical interfaces for an Optical White Box.
+          The network side is represented by the OTS/OMS.";
+      uses ots-attributes;
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
+    when "org-openroadm-device:type = 'openROADM-if:opticalTransport'";
+    uses ots-container;
+  }
+}
diff --git a/ordmodels/device/src/main/yang/org-openroadm-otn-common@2017-06-26.yang b/ordmodels/device/src/main/yang/org-openroadm-otn-common@2017-06-26.yang
new file mode 100644 (file)
index 0000000..3270a5e
--- /dev/null
@@ -0,0 +1,160 @@
+module org-openroadm-otn-common {
+  namespace "http://org/openroadm/otn-common";
+  prefix org-openroadm-otn-common;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for common OTN interface atrtributes and types. 
+         
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components 
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors. 
+     All rights reserved. 
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating 
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of 
+     publication of this document. Please review these documents carefully, as they 
+     describe your rights and restrictions with respect to this document. Code Components 
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as 
+     described in the Simplified BSD License.";
+
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+
+  grouping trail-trace {
+    leaf tx-sapi {
+      type string {
+        length "0 .. 15";
+      }
+      description
+        "The provisioned 15 character transmit trace SAPI. Implementations shall add the [0] field automatically per ITU-T G.709";
+    }
+    leaf tx-dapi {
+      type string {
+        length "0 .. 15";
+      }
+      description
+        "The provisioned 15 character transmit trace DAPI. Implementations shall add the [0] field automatically per ITU-T G.709";
+    }
+    leaf tx-operator {
+      type string {
+        length "0 .. 32";
+      }
+      description
+        "The provisioned 32 character Operator Specific field";
+    }
+    leaf accepted-sapi {
+      type string;
+      config false;
+      description
+        "The accepted SAPI recovered from the recieved multi-frame TTI field.
+         Received SAPI contains the receive data, minus the sapi[0] and any 0x00 padding at the end";
+    }
+    leaf accepted-dapi {
+      type string;
+      config false;
+      description
+        "The accepted DAPI recovered from the recieved multi-frame TTI field
+         Received DAPI contains the receive data, minus the dapi[0] and any 0x00 padding at the end";
+    }
+    leaf accepted-operator {
+      type string;
+      config false;
+      description
+        "The accepted Operator Specific field recovered from the recieved multi-frame TTI field";
+    }
+    leaf expected-sapi {
+      type string {
+        length "0 .. 15";
+      }
+      description
+        "The provisioned expected SAPI, to be compared with accepted TTI";
+    }
+    leaf expected-dapi {
+      type string {
+        length "0 .. 15";
+      }
+      description
+        "The provisioned expected DAPI, to be compared with accepted TTI";
+    }
+    leaf tim-act-enabled {
+      type boolean;
+      default "false";
+      description
+        "Enables TTI Mismatch consequent actions.";
+    }
+    leaf tim-detect-mode {
+      type enumeration {
+        enum "Disabled" {
+          description
+            "TTI is ignored";
+        }
+        enum "SAPI" {
+          description
+            "Expected SAPI is compared to the Accpeted TTI. Other TTI fields are ignored";
+        }
+        enum "DAPI" {
+          description
+            "Expected DAPI is compared to the Accpeted TTI. Other TTI fields are ignored";
+        }
+        enum "SAPI-and-DAPI" {
+          description
+            "Expected SAPI and Expected DAPI are compared to the Accpeted TTI. Operator specific TTI field is ignored";
+        }
+      }
+      default "Disabled";
+    }
+  }
+
+  grouping deg-threshold {
+    leaf degm-intervals {
+      type uint8 {
+        range "2 .. 10";
+      }
+      default "2";
+      description
+        "G.806 - Consecutive bad intervals required for declare dDEG";
+    }
+    leaf degthr-percentage {
+      type uint16 {
+        range "1 .. 10000";
+      }
+      default "100";
+      description
+        "Percentage of errored blocks required to declare an interval bad, in units of 0.01%";
+    }
+  }
+}
index 3b49effb1d4e52923fab76a98054bda4802f8afe..9635041944b3ad4450e8185a425df30ca5d71c47 100644 (file)
@@ -4,12 +4,15 @@ module org-openroadm-otn-odu-interfaces {
 
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
   import org-openroadm-interfaces {
     prefix openROADM-if;
+    revision-date 2016-10-14;
   }
   import org-openroadm-maintenance-testsignal {
     prefix org-openroadm-maint-testsignal;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -17,39 +20,39 @@ module org-openroadm-otn-odu-interfaces {
     "OpenROADM.org";
   description
     "YANG definitions for device facility otnodu interfaces.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
+     
      Also contains code components extracted from IETF Interfaces.  These code components
      are copyrighted and licensed as follows:
-
+     
      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
      All rights reserved.
-
+     
      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
      publication of this document. Please review these documents carefully, as they
@@ -120,31 +123,31 @@ module org-openroadm-otn-odu-interfaces {
     description
       "OPU4 MSI - ODTU4.ts, TS is occupied/allocated";
   }
-
+  
   identity ODTU4.1 {
     base odtu-type-identity;
     description
       "ODTU4.1 MSI type";
   }
-
+  
   identity ODTU4.2 {
     base odtu-type-identity;
     description
       "ODTU4.2 MSI type";
   }
-
+  
   identity ODTU4.8 {
     base odtu-type-identity;
     description
       "ODTU4.8 MSI type";
   }
-
+  
   identity ODTU4.31 {
     base odtu-type-identity;
     description
       "ODTU4.31 MSI type";
   }
-
+  
   identity ODTU01 {
     base odtu-type-identity;
     description
@@ -332,7 +335,7 @@ module org-openroadm-otn-odu-interfaces {
         enum "not-terminated" {
           description
             "Not Terminated: no detection or generation.
-             Overhead is passed through the interface transparently in receive direction
+             Overhead is passed through the interface transparently in receive direction 
              unless extension is set for erase";
         }
         enum "terminated" {
@@ -344,7 +347,7 @@ module org-openroadm-otn-odu-interfaces {
         enum "monitored" {
           description
             "Monitored: detection enabled.
-             Overhead is passed through the interface transparently in receive direction
+             Overhead is passed through the interface transparently in receive direction 
              unless extension is set for erase";
         }
       }
diff --git a/ordmodels/device/src/main/yang/org-openroadm-otn-odu-interfaces@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-otn-odu-interfaces@2017-12-15.yang
new file mode 100644 (file)
index 0000000..87f9f8b
--- /dev/null
@@ -0,0 +1,340 @@
+module org-openroadm-otn-odu-interfaces {
+  namespace "http://org/openroadm/otn-odu-interfaces";
+  prefix org-openroadm-otn-odu-interfaces;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix openROADM-if;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-maintenance-testsignal {
+    prefix org-openroadm-maint-testsignal;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-otn-common {
+    prefix org-openroadm-otn-common;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-otn-common-types {
+    prefix org-openroadm-otn-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility otnodu interfaces.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping msi-entry {
+    leaf trib-slot {
+      type uint16;
+      description
+        "tributary slot (TS)";
+    }
+    leaf odtu-type {
+      type identityref {
+        base org-openroadm-otn-common-types:odtu-type-identity;
+      }
+      description
+        "ODTU type, part of the MSI (Multiplex Structure Identifier)";
+    }
+    leaf trib-port {
+      type uint16;
+      description
+        "Tributary Port Number (0-based), part of the MSI";
+    }
+    leaf trib-port-payload {
+      type string;
+      description
+        "interface name being mapped to trib-port";
+    }
+  }
+
+  grouping odu-attributes {
+    description
+      "ODU attributes";
+    leaf rate {
+      type identityref {
+        base org-openroadm-otn-common-types:odu-rate-identity;
+      }
+      description
+        "rate identity of the ODU. 'identityref' is used
+         to allow to extend for future higher rates";
+    }
+    leaf odu-function {
+      type identityref {
+        base org-openroadm-otn-common-types:odu-function-identity;
+      }
+      description
+        "function of the ODU interface";
+    }
+    leaf monitoring-mode {
+      type enumeration {
+        enum "not-terminated" {
+          description
+            "Not Terminated: no detection or generation.
+             Overhead is passed through the interface transparently in receive direction";
+        }
+        enum "terminated" {
+          description
+            "Terminated: detection and generation enabled.
+             Overhead is erased (replaced with all zeros) in receive direction";
+        }
+        enum "monitored" {
+          description
+            "Monitored: detection enabled.
+             Overhead is passed through the interface transparently in receive direction";
+        }
+      }
+      description
+        "Monitoring mode of the ODU Overhead";
+    }
+    leaf no-oam-function {
+      type empty;
+      description
+        "No OAM functionality exists for this ODU interface, the entity exists in software only. This entity does not report alarms or PM and does not support TCM, TTI, delay measurement, loopbacks, test signal and other hardware-based functions. This is an optional parameter, only needs to be present when no-oam-function supported for this interface.";
+    }
+    leaf proactive-delay-measurement-enabled {
+      type boolean;
+      description
+        "enable/disable proactive Delay Measurement";
+    }
+    uses parent-odu-allocation;
+    uses org-openroadm-otn-common:trail-trace;
+    uses org-openroadm-otn-common:deg-threshold;
+    list tcm {
+      key "layer tcm-direction";
+      max-elements "6";
+      description
+        "Tandem Connection Management";
+      uses tcm-attributes;
+    }
+    uses opu;
+  }
+
+  grouping parent-odu-allocation {
+    container parent-odu-allocation {
+      when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface[org-openroadm-device:name = current()/../../org-openroadm-device:supporting-interface]/org-openroadm-device:type = 'openROADM-if:otnOdu'";
+      presence "Explicit assignment of parent ODU trib-slot and trib-port allocation. ";
+      leaf trib-port-number {
+        type uint16 {
+          range "1 .. 80";
+        }
+        mandatory true;
+        description
+          "Assigned tributary port number in parent OPU";
+      }
+      leaf-list trib-slots {
+        type uint16 {
+          range "1 .. 80";
+        }
+        min-elements 1;
+        max-elements "80";
+        description
+          "Assigned trib slots occupied in parent OPU MSI";
+      }
+    }
+  }
+
+  grouping opu {
+    container opu {
+      when "../monitoring-mode = 'terminated' or ../monitoring-mode = 'monitored'";
+      description
+        "Optical Channel Payload Unit (OPU)";
+      leaf payload-type {
+        type org-openroadm-otn-common-types:payload-type-def;
+        description
+          "Payload Type";
+      }
+      leaf rx-payload-type {
+        type org-openroadm-otn-common-types:payload-type-def;
+        description
+          "Received Payload Type";
+      }
+      leaf exp-payload-type {
+        type org-openroadm-otn-common-types:payload-type-def;
+        description
+          "Expected Payload Type";
+      }
+      leaf payload-interface {
+        type string;
+        description
+          "Expected Payload of OPU. It designates client interface name";
+      }
+      container msi {
+        when "../payload-type = '20' or ../payload-type = '21'";
+        list tx-msi {
+          key "trib-slot";
+          description
+            "Transmit MSI";
+          uses msi-entry;
+        }
+        list rx-msi {
+          key "trib-slot";
+          description
+            "Receive MSI";
+          uses msi-entry;
+        }
+        list exp-msi {
+          key "trib-slot";
+          description
+            "Expected MSI";
+          uses msi-entry;
+        }
+      }
+    }
+  }
+
+  grouping tcm-attributes {
+    description
+      "Tandem Connection Monitoring (TCM) attributes";
+    leaf layer {
+      type uint8 {
+        range "1..6";
+      }
+      description
+        "TCM layer";
+    }
+    leaf monitoring-mode {
+      type enumeration {
+        enum "not-terminated" {
+          description
+            "Not Terminated: no detection or generation.
+             Overhead is passed through the interface transparently in receive direction 
+             unless extension is set for erase";
+        }
+        enum "terminated" {
+          description
+            "Terminated: detection and generation enabled.
+             Overhead is erased (replaced with all zeros) in receive direction, unless
+             extension is set to passthrough";
+        }
+        enum "monitored" {
+          description
+            "Monitored: detection enabled.
+             Overhead is passed through the interface transparently in receive direction 
+             unless extension is set for erase";
+        }
+      }
+      description
+        "Monitoring mode of the TCM layer";
+    }
+    leaf ltc-act-enabled {
+      type boolean;
+      description
+        "enable/disable alarm transfer on detection of Loss of Tandem Connection (LTC)";
+    }
+    leaf proactive-delay-measurement-enabled {
+      type boolean;
+      description
+        "enable/disable proactive Delay Measurement for TCM";
+    }
+    leaf tcm-direction {
+      type enumeration {
+        enum "up-tcm" {
+          description
+            "TCM termination direction faces the switch fabric.";
+        }
+        enum "down-tcm" {
+          description
+            "TCM termination direction faces the facility";
+        }
+      }
+      description
+        "Direction of TCM.";
+    }
+    uses org-openroadm-otn-common:trail-trace;
+    uses org-openroadm-otn-common:deg-threshold;
+  }
+
+  grouping odu-container {
+    container odu {
+      presence "Attribute Nodes for Optical Data Unit (ODU)";
+      description
+        "Optical Channel Data Unit (ODU)";
+      uses odu-attributes {
+        refine "opu/rx-payload-type" {
+          config false;
+        }
+        refine "opu/msi" {
+          config false;
+        }
+        refine "no-oam-function" {
+          config false;
+        }
+      }
+      uses org-openroadm-maint-testsignal:maint-testsignal;
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
+    when "org-openroadm-device:type = 'openROADM-if:otnOdu'";
+    uses odu-container;
+  }
+}
index 4fe3bb3558dba43d3cc7c6a779776d7d72165522..f30529c32910b773f58b623d59b51567f9c87b0e 100644 (file)
@@ -4,12 +4,15 @@ module org-openroadm-otn-otu-interfaces {
 
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
   import org-openroadm-interfaces {
     prefix openROADM-if;
+    revision-date 2016-10-14;
   }
   import org-openroadm-maintenance-loopback {
     prefix org-openroadm-maint-loopback;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -17,39 +20,39 @@ module org-openroadm-otn-otu-interfaces {
     "OpenROADM.org";
   description
     "YANG definitions for device facility otnotu interfaces.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
+     
      Also contains code components extracted from IETF Interfaces.  These code components
      are copyrighted and licensed as follows:
-
+     
      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
      All rights reserved.
-
+     
      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
      publication of this document. Please review these documents carefully, as they
diff --git a/ordmodels/device/src/main/yang/org-openroadm-otn-otu-interfaces@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-otn-otu-interfaces@2017-12-15.yang
new file mode 100644 (file)
index 0000000..1b18dfc
--- /dev/null
@@ -0,0 +1,168 @@
+module org-openroadm-otn-otu-interfaces {
+  namespace "http://org/openroadm/otn-otu-interfaces";
+  prefix org-openroadm-otn-otu-interfaces;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-interfaces {
+    prefix openROADM-if;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-maintenance-loopback {
+    prefix org-openroadm-maint-loopback;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-otn-common {
+    prefix org-openroadm-otn-common;
+    revision-date 2017-06-26;
+  }
+  import org-openroadm-otn-common-types {
+    prefix org-openroadm-otn-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility otnotu interfaces.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping otu-attributes {
+    description
+      "OTU attributes";
+    leaf rate {
+      type identityref {
+        base org-openroadm-otn-common-types:otu-rate-identity;
+      }
+      description
+        "rate identity of the OTU. 'identityref' is used
+         to allow to extend for future higher rates";
+    }
+    leaf fec {
+      type enumeration {
+        enum "off" {
+          value 0;
+          description
+            "fec off";
+        }
+        enum "rsfec" {
+          value 1;
+          description
+            "rsfec";
+        }
+        enum "sdfeca1" {
+          value 2;
+          description
+            "Clariphy SDFEC";
+        }
+        enum "efec" {
+          value 3;
+          description
+            "G.975.1 I.4";
+        }
+        enum "ufec" {
+          value 4;
+          description
+            "G.975.1 I.7";
+        }
+        enum "sdfec" {
+          value 5;
+          description
+            "Soft decision FEC";
+        }
+        enum "sdfecb1" {
+          value 6;
+          description
+            "SDFEC with SCFEC";
+        }
+        enum "scfec" {
+          value 7;
+          description
+            "Stair case FEC";
+        }
+      }
+      description
+        "Forward Error Correction";
+    }
+    uses org-openroadm-otn-common:trail-trace;
+    uses org-openroadm-otn-common:deg-threshold;
+  }
+
+  grouping otu-container {
+    container otu {
+      description
+        "Optical Channel Transport Unit (OTU)";
+      uses otu-attributes;
+      uses org-openroadm-maint-loopback:maint-loopback;
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface" {
+    when "org-openroadm-device:type = 'openROADM-if:otnOtu'";
+    uses otu-container;
+  }
+}
index 4251018c606f15d9ea189e2dd4ba8e8b30bc831f..406c17e053bf09167d629d9f7706639ab1edbda4 100644 (file)
@@ -4,6 +4,7 @@ module org-openroadm-physical-types {
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
+    revision-date 2016-10-14;
   }
   import ietf-yang-types {
     prefix yang;
@@ -14,31 +15,31 @@ module org-openroadm-physical-types {
     "OpenROADM.org";
   description
     "YANG definitions of physical types.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-physical-types@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-physical-types@2017-12-15.yang
new file mode 100644 (file)
index 0000000..806bd34
--- /dev/null
@@ -0,0 +1,136 @@
+module org-openroadm-physical-types {
+  namespace "http://org/openroadm/physical/types";
+  prefix org-openroadm-physical-types;
+
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+  import ietf-yang-types {
+    prefix yang;
+    revision-date 2013-07-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions of physical types.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping node-info {
+    description
+      "Physical inventory data used by the node";
+    leaf vendor {
+      type string;
+      config false;
+      mandatory true;
+      description
+        "Vendor of the equipment";
+    }
+    leaf model {
+      type string;
+      config false;
+      mandatory true;
+      description
+        "Physical resource model information.";
+    }
+    leaf serial-id {
+      type string;
+      config false;
+      mandatory true;
+      description
+        "Product Code for this physical resource";
+    }
+  }
+
+  grouping common-info {
+    description
+      "Physical inventory data used by all other entities";
+    uses node-info;
+    leaf type {
+      type string;
+      config false;
+      description
+        "The specific type of this physical resource - ie the type of
+         shelf, type of circuit-pack, etc.";
+    }
+    leaf product-code {
+      type string;
+      config false;
+      description
+        "Product Code for this physical resource";
+    }
+    leaf manufacture-date {
+      type yang:date-and-time;
+      config false;
+      description
+        "Manufacture date of physical resource";
+    }
+    leaf clei {
+      type string;
+      config false;
+      description
+        "CLEI for this physical resource";
+    }
+    leaf hardware-version {
+      type string;
+      config false;
+      description
+        "The version of the hardware.";
+    }
+    leaf operational-state {
+      type org-openroadm-common-types:state;
+      config false;
+      description
+        "Operational state of the physical resource";
+    }
+  }
+}
diff --git a/ordmodels/device/src/main/yang/org-openroadm-pluggable-optics-holder-capability@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-pluggable-optics-holder-capability@2017-12-15.yang
new file mode 100644 (file)
index 0000000..77cc760
--- /dev/null
@@ -0,0 +1,100 @@
+module org-openroadm-pluggable-optics-holder-capability {
+  namespace "http://org/openroadm/pluggable-optics-holder-capability";
+  prefix org-openroadm-pluggable-optics-holder-capability;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-port-capability {
+    prefix org-openroadm-port-capability;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for pluggable optics holder capability.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2017 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+
+  grouping pluggable-optics-holder-capability {
+    description
+      "Pluggable optics holder capability parameters.";
+    container pluggable-optics-holder-capability {
+      config false;
+      list supported-circuit-pack-types {
+        key "supported-circuit-pack-type";
+        leaf supported-circuit-pack-type {
+          type string;
+          mandatory true;
+          description
+            "Type of pluggable circuit-pack supported";
+        }
+        list ports {
+          key "port-name";
+          description
+            "Port reference on supported pluggable circuit-pack";
+          leaf port-name {
+            type leafref {
+              path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:ports/org-openroadm-device:port-name";
+            }
+            description
+              "Port name";
+          }
+          uses org-openroadm-port-capability:port-capability-grp;
+        }
+      }
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:cp-slots" {
+    when "org-openroadm-device:slot-type='pluggable-optics-holder'";
+    uses pluggable-optics-holder-capability;
+  }
+}
diff --git a/ordmodels/device/src/main/yang/org-openroadm-port-capability@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-port-capability@2017-12-15.yang
new file mode 100644 (file)
index 0000000..0959a03
--- /dev/null
@@ -0,0 +1,338 @@
+module org-openroadm-port-capability {
+  namespace "http://org/openroadm/port-capability";
+  prefix org-openroadm-port-capability;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-port-types {
+    prefix org-openroadm-port-types;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-prot-otn-linear-aps {
+    prefix org-openroadm-prot-otn-linear-aps;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-otn-common-types {
+    prefix org-openroadm-otn-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility OTN linear APS protection groups.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2017 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+
+  typedef tcm-direction-capability-type {
+    type enumeration {
+      enum "up-tcm" {
+        description
+          "Port supports up TCM termination, e.g., direction facing the switch fabric";
+      }
+      enum "down-tcm" {
+        description
+          "Port supports down TCM termination, e.g., direction facing out of the equipment ";
+      }
+      enum "up-down-tcm" {
+        description
+          "Port supports both up and down TCM terminations";
+      }
+    }
+    description
+      "TCM direction capability for the port";
+  }
+
+  grouping port-id-grp {
+    leaf circuit-pack-name {
+      type leafref {
+        path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:circuit-pack-name";
+      }
+      description
+        "Circuit-Pack identifier. Unique within the context of a device.";
+    }
+    leaf port-name {
+      type leafref {
+        path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:ports/org-openroadm-device:port-name";
+      }
+      description
+        "Port index identifier. Unique within the context of a circuit-pack.";
+    }
+  }
+
+  grouping slot-id-grp {
+    leaf circuit-pack-name {
+      type leafref {
+        path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:circuit-pack-name";
+      }
+      description
+        "Circuit-Pack identifier. Unique within the context of a device.";
+    }
+    leaf slot-name {
+      type leafref {
+        path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:cp-slots/org-openroadm-device:slot-name";
+      }
+      description
+        "cp-slot name. Unique within the context of a circuit-pack.";
+    }
+  }
+
+  grouping port-capability-grp {
+    description
+      "OpenROADM port capability parameters.";
+    container port-capabilities {
+      config false;
+      list supported-interface-capability {
+        key "if-cap-type";
+        description
+          "Supported interface capability on the port.";
+        leaf if-cap-type {
+          type identityref {
+            base org-openroadm-port-types:supported-if-capability;
+          }
+          description
+            "Interface type/hierarchy/rate supported on this port";
+        }
+        container otn-capability {
+          leaf-list if-protection-capability {
+            type identityref {
+              base org-openroadm-prot-otn-linear-aps:otn-protection-type;
+            }
+            description
+              "supported protection types if protection is supported on this port";
+          }
+          leaf proactive-DMp {
+            type boolean;
+            description
+              "ODU PM delay measurement (DMp) (G.709 06-2016 15.8.2.1.6)";
+          }
+          leaf tcm-capable {
+            type boolean;
+            description
+              "only when tcm-capable=true, the following two are applicable (ie, proactive-DMt, tcm-direction";
+          }
+          leaf proactive-DMt {
+            when "../tcm-capable= 'true'";
+            type boolean;
+            description
+              "ODU TCM delay measurement (DMt) (G.709 06-2016 15.8.2.2.8)";
+          }
+          leaf tcm-direction-capability {
+            when "../tcm-capable= 'true'";
+            type tcm-direction-capability-type;
+            description
+              "Supported tcm direction capability on the ODUk associated with the port.";
+          }
+          leaf-list opu-payload-type-mapping {
+            type org-openroadm-otn-common-types:payload-type-def;
+            description
+              "OPU payload-type mapping OPU.";
+          }
+          container mpdr-client-restriction {
+            description
+              "Restriction rules for how LO ODUs are multiplexed into HO ODU
+               and the relation with mapped client ports.";
+            leaf network-ho-odu-circuit-pack-name {
+              type leafref {
+                path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:circuit-pack-name";
+              }
+              mandatory true;
+              description
+                "Circuit-Pack identifier. Unique within the context of a device.";
+            }
+            leaf network-ho-odu-port-name {
+              type leafref {
+                path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs[org-openroadm-device:circuit-pack-name=current()/../network-ho-odu-circuit-pack-name]/org-openroadm-device:ports/org-openroadm-device:port-name";
+              }
+              mandatory true;
+              description
+                "port identifier.";
+            }
+            leaf odtu-type {
+              type identityref {
+                base org-openroadm-otn-common-types:odtu-type-identity;
+              }
+              mandatory true;
+              description
+                "ODTU type, part of the MSI (Multiplex Structure Identifier)";
+            }
+            leaf network-ho-odu-trib-port-number {
+              type uint16 {
+                range "1 .. 80";
+              }
+              mandatory true;
+              description
+                "Tributary port number";
+            }
+            leaf-list network-ho-odu-trib-slots {
+              type uint16 {
+                range "1 .. 80";
+              }
+              min-elements 1;
+              max-elements "80";
+            }
+          }
+          container odu-mux-hierarchy {
+            presence "HO ODU supported hierarchy.";
+            list mux-capability {
+              key "stage-number ho-odu-type ho-odu-payload-type";
+              leaf stage-number {
+                type uint8 {
+                  range "1 .. 2";
+                }
+              }
+              leaf ho-odu-type {
+                type identityref {
+                  base org-openroadm-otn-common-types:odu-rate-identity;
+                }
+              }
+              leaf ho-odu-payload-type {
+                type org-openroadm-otn-common-types:payload-type-def;
+                description
+                  "high order ODU payload type";
+              }
+              leaf-list supported-lo-odu-type {
+                type identityref {
+                  base org-openroadm-otn-common-types:odu-rate-identity;
+                }
+              }
+              leaf lo-odu-proactive-DMp {
+                type boolean;
+                description
+                  "lo order ODU PM delay measurement (DMp) (G.709 06-2016 15.8.2.1.6)";
+              }
+              leaf lo-odu-tcm-capable {
+                type boolean;
+                description
+                  "only when lo-odu-tcm-capable=true, the following two are applicable (ie, lo-odu-proactive-DMt, lo-odu-tcm-direction";
+              }
+              leaf lo-odu-proactive-DMt {
+                when "../lo-odu-tcm-capable= 'true'";
+                type boolean;
+                description
+                  "lo order ODU TCM delay measurement (DMt) (G.709 06-2016 15.8.2.2.8)";
+              }
+              leaf lo-odu-tcm-direction-capability {
+                when "../lo-odu-tcm-capable= 'true'";
+                type tcm-direction-capability-type;
+                description
+                  "Supported tcm direction capability for low order ODU associated with the port.";
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+
+  grouping port-group-restriction-grp {
+    container port-group-restriction {
+      config false;
+      list port-bandwidth-sharing {
+        key "port-sharing-id";
+        leaf port-sharing-id {
+          type uint16;
+        }
+        list port-list {
+          key "circuit-pack-name port-name";
+          uses port-id-grp;
+        }
+        list pluggable-optics-holder-list {
+          key "circuit-pack-name slot-name";
+          uses slot-id-grp;
+        }
+        leaf shared-bandwidth {
+          type uint16;
+          units "Gbps";
+        }
+        list possible-port-config {
+          key "config-id";
+          leaf config-id {
+            type uint16;
+          }
+          list port-if-type-config {
+            key "circuit-pack-name port-name";
+            uses port-id-grp;
+            leaf-list port-if-type {
+              type identityref {
+                base org-openroadm-port-types:supported-if-capability;
+              }
+            }
+          }
+          list slot-if-type-config {
+            key "circuit-pack-name slot-name port-name";
+            uses slot-id-grp;
+            leaf port-name {
+              type leafref {
+                path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:ports/org-openroadm-device:port-name";
+              }
+            }
+            leaf-list port-if-type {
+              type identityref {
+                base org-openroadm-port-types:supported-if-capability;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:circuit-packs/org-openroadm-device:ports" {
+    uses port-capability-grp;
+  }
+  augment "/org-openroadm-device:org-openroadm-device" {
+    uses port-group-restriction-grp;
+  }
+}
diff --git a/ordmodels/device/src/main/yang/org-openroadm-prot-otn-linear-aps@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-prot-otn-linear-aps@2017-12-15.yang
new file mode 100644 (file)
index 0000000..e56512e
--- /dev/null
@@ -0,0 +1,341 @@
+module org-openroadm-prot-otn-linear-aps {
+  namespace "http://org/openroadm/prot/otn-linear-aps";
+  prefix org-openroadm-prot-otn-linear-aps;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for device facility OTN linear APS protection groups.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+
+  identity otn-protection-type {
+    description
+      "OTN base protection identity from which
+         specific protection types are derived.";
+  }
+
+  identity odu-one-plus-one {
+    base otn-protection-type;
+    description
+      "ODU Linear Protection 1+1 permanant bridge";
+  }
+
+  grouping odu-sncp-protection-grps {
+    list odu-sncp-pg {
+      key "name";
+      leaf name {
+        type string;
+        description
+          "The odu-sncp-protection-group name";
+      }
+      leaf level {
+        type enumeration {
+          enum "line" {
+            value 1;
+          }
+          enum "path" {
+            value 2;
+          }
+        }
+        mandatory true;
+        description
+          "Designates protection group as Line or Path";
+      }
+      leaf prot-type {
+        type identityref {
+          base otn-protection-type;
+        }
+        default "odu-one-plus-one";
+        description
+          "The type of the protection group.";
+      }
+      leaf switching-direction {
+        type enumeration {
+          enum "unidirectional-switching" {
+            value 1;
+          }
+          enum "bidirectional-switching" {
+            value 2;
+          }
+        }
+        default "unidirectional-switching";
+        description
+          "Bidirectional refers to APS signaling enabled (G.873.1 Table 7-1 Table 8-1).";
+      }
+      leaf revertive {
+        type boolean;
+        default "false";
+        description
+          "Sets reversion behavior.";
+      }
+      leaf mode {
+        type enumeration {
+          enum "SNC/Ne" {
+            value 1;
+            description
+              "applicable to line or path switching";
+          }
+          enum "SNC/Ns" {
+            value 2;
+            description
+              "applicable to line or path switching";
+          }
+          enum "SNC/S" {
+            value 3;
+            description
+              "applicable to line or path switching";
+          }
+          enum "SNC/I" {
+            value 4;
+            description
+              "applicable to line switching only";
+          }
+          enum "CL-SNCG/I" {
+            value 5;
+            description
+              "applicable to line switching only";
+          }
+        }
+        mandatory true;
+        description
+          "Sets the protection mode";
+      }
+      leaf protection-trigger-level {
+        type enumeration {
+          enum "OTUk/ODUkA-SSF-SSD" {
+            value 1;
+            description
+              "applicable to SNC/I";
+          }
+          enum "ODUkP/ODUjA-SSF-SSD" {
+            value 2;
+            description
+              "applicable to CL-SNCG/I";
+          }
+          enum "ODUP-SSF-SSD" {
+            value 3;
+            description
+              "applicable to SNC/Ne";
+          }
+          enum "ODUT1" {
+            value 4;
+            description
+              "applicable to SNC/Ns or SNC/S";
+          }
+          enum "ODUT2" {
+            value 5;
+            description
+              "applicable to SNC/Ns or SNC/S";
+          }
+          enum "ODUT3" {
+            value 6;
+            description
+              "applicable to SNC/Ns or SNC/S";
+          }
+          enum "ODUT4" {
+            value 7;
+            description
+              "applicable to SNC/Ns or SNC/S";
+          }
+          enum "ODUT5" {
+            value 8;
+            description
+              "applicable to SNC/Ns or SNC/S";
+          }
+          enum "ODUT6" {
+            value 9;
+            description
+              "applicable to SNC/Ns or SNC/S";
+          }
+        }
+        description
+          "Indicates switch trigger.";
+      }
+      leaf wait-to-restore {
+        when "../revertive = 'true'";
+        type uint8 {
+          range "1..12";
+        }
+        units "minutes";
+        default "5";
+        description
+          "Wait to restore time in minutes";
+      }
+      container holdoff-timer {
+        leaf holdoff {
+          type uint8 {
+            range "0 | 20 | 100";
+          }
+          units "milliseconds";
+          default "0";
+          description
+            "switch hold-off time in milliseconds";
+        }
+        leaf holdoff-multiplier {
+          when "../holdoff= 100";
+          type uint8 {
+            range "1 .. 100";
+          }
+          default "1";
+          description
+            "switch holdoff time multiplier x100 milliseconds";
+        }
+      }
+      leaf working-if {
+        type leafref {
+          path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
+        }
+        mandatory true;
+        description
+          "Designated work interface";
+      }
+      leaf-list pg-interfaces {
+        type leafref {
+          path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
+        }
+        min-elements 1;
+        description
+          "List of interfaces in the PG";
+      }
+      leaf active-if {
+        type leafref {
+          path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
+        }
+        config false;
+        description
+          "Active interface in the PG";
+      }
+    }
+  }
+
+  rpc odu-sncp-protection-switch {
+    description
+      "ODU SNCP Protection Switch RPC with synchronous implementation";
+    input {
+      leaf protection-group {
+        type leafref {
+          path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protection-grps/org-openroadm-prot-otn-linear-aps:odu-sncp-pg/org-openroadm-prot-otn-linear-aps:name";
+        }
+        mandatory true;
+        description
+          "Target protection group";
+      }
+      leaf pg-interface {
+        type leafref {
+          path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
+        }
+        mandatory true;
+        description
+          "Target protection group interface";
+      }
+      leaf switch-command {
+        type enumeration {
+          enum "Lock-Out-Protect" {
+            value 1;
+          }
+          enum "Force-Switch" {
+            value 2;
+          }
+          enum "Manual-Switch" {
+            value 3;
+          }
+          enum "Release" {
+            value 4;
+          }
+        }
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  notification odu-sncp-pg-switch-event {
+    leaf switch-status {
+      type enumeration {
+        enum "switched-to-protect" {
+          value 1;
+        }
+        enum "switched-back-to-working" {
+          value 2;
+        }
+      }
+      description
+        "Completed protection switch";
+    }
+    leaf odu-sncp-pg-name {
+      type string;
+      description
+        "The odu-sncp-protection-group name";
+    }
+  }
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protection-grps" {
+    uses odu-sncp-protection-grps;
+  }
+}
index 0bec3d913e88df1b7e3d726a124d285e24eb625e..e95dfb4477d45c9cad8259e0d6f7113da08b4a4c 100644 (file)
@@ -4,39 +4,40 @@ module org-openroadm-rstp {
 
   import org-openroadm-device {
     prefix org-openroadm-device;
+    revision-date 2017-02-06;
   }
 
   organization "Open ROADM MSA";
   contact
     "OpenROADM.org";
   description
-    "YANG definitions for rstp protocol.
-
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+    "YANG definitions for rstp protocol. 
+     
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
@@ -208,7 +209,7 @@ module org-openroadm-rstp {
       }
       leaf designated-bridgeid {
         description
-          "The Bridge Identifier of the bridge that this port considers
+          "The Bridge Identifier of the bridge that this port considers 
            to be the Designated Bridge for this port's segment";
         type bridge-id-type;
       }
diff --git a/ordmodels/device/src/main/yang/org-openroadm-rstp@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-rstp@2017-12-15.yang
new file mode 100644 (file)
index 0000000..502bb3d
--- /dev/null
@@ -0,0 +1,347 @@
+module org-openroadm-rstp {
+  namespace "http://org/openroadm/rstp";
+  prefix org-openroadm-rstp;
+
+  import org-openroadm-device {
+    prefix org-openroadm-device;
+    revision-date 2017-12-15;
+  }
+  import org-openroadm-resource-types {
+    prefix org-openroadm-resource-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for rstp protocol. 
+     
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  typedef bridge-id-type {
+    type string;
+    description
+      "Unique Bridge Identifier";
+  }
+
+  grouping rstp-common-bridge-config {
+    leaf bridge-priority {
+      type uint32 {
+        range "0..61440";
+      }
+      default "32768";
+      description
+        "Bridge Priority Value";
+    }
+    leaf shutdown {
+      type empty;
+      description
+        "Bridge admin state";
+    }
+    leaf hold-time {
+      type uint32 {
+        range "1..10";
+      }
+      default "2";
+      description
+        "The time interval during which no more than two
+            BPDUs transmitted by this node in seconds - not used in rstp mode (in seconds)";
+    }
+    leaf hello-time {
+      type uint32 {
+        range "1..2";
+      }
+      default "2";
+      description
+        "The time between the transmission of BPDU's by this node on any
+            port, when role is root (in seconds)";
+    }
+    leaf max-age {
+      type uint32 {
+        range "6..40";
+      }
+      default "20";
+      description
+        "The value that all bridges use for MaxAge when this bridge
+            is acting as the root";
+    }
+    leaf forward-delay {
+      type uint32 {
+        range "4..30";
+      }
+      default "15";
+      description
+        "The port on the Switch spends this time in the listening
+            state while moving from the blocking state to the forwarding state (in seconds)";
+    }
+    leaf transmit-hold-count {
+      type uint32 {
+        range "1..10";
+      }
+      default "2";
+      description
+        "Maximum BPDU transmission rate";
+    }
+  }
+
+  grouping rstp-root-bridge-attr {
+    leaf root-bridge-port {
+      type uint32;
+      description
+        "Port id of the root port";
+    }
+    leaf root-path-cost {
+      type uint32;
+      description
+        "The cost of the path to the root as
+               seen from this bridge";
+    }
+    leaf root-bridge-priority {
+      type uint32;
+      description
+        "Root Bridge Priority Value";
+    }
+    leaf root-bridge-id {
+      type bridge-id-type;
+      description
+        "Root Bridge identifier";
+    }
+    leaf root-hold-time {
+      type uint32;
+      description
+        "The time interval during which no more than two
+               BPDUs transmitted by this node in seconds at root node (in seconds)";
+    }
+    leaf root-hello-time {
+      type uint32;
+      description
+        "The time between the transmission of BPDU's used at root node (in seconds)";
+    }
+    leaf root-max-age {
+      type uint32;
+      description
+        "The value that all bridges use for MaxAge used at root node";
+    }
+    leaf root-forward-delay {
+      type uint32;
+      description
+        "The time in seconds spent on the listening state used at root node (in seconds)";
+    }
+  }
+
+  grouping rstp-bridge-port-state-attr {
+    list rstp-bridge-port-table {
+      key "ifname";
+      max-elements "15";
+      description
+        "This table contains port-specific information for rstp state attributes";
+      leaf ifname {
+        type string {
+          length "1..255";
+        }
+        description
+          "Interface name of the port";
+      }
+      leaf bridge-port-state {
+        type enumeration {
+          enum "discarding";
+          enum "blocked";
+          enum "learning";
+          enum "forwarding";
+          enum "unknown";
+        }
+        description
+          "The port's current state";
+      }
+      leaf bridge-port-role {
+        type enumeration {
+          enum "designated";
+          enum "root";
+          enum "alternate";
+          enum "disabled";
+          enum "backup";
+          enum "unknown";
+        }
+        description
+          "The role payed by this port in the bridge";
+      }
+      leaf bridge-port-id {
+        type uint32;
+        description
+          "Unique port id of this port";
+      }
+      leaf oper-edge-bridge-port {
+        type empty;
+        description
+          "The operational value of the Edge Port parameter";
+      }
+      leaf designated-bridge-port {
+        type uint32;
+        description
+          "Port id of the designated port";
+      }
+      leaf designated-bridgeid {
+        type bridge-id-type;
+        description
+          "The Bridge Identifier of the bridge that this port considers 
+           to be the Designated Bridge for this port's segment";
+      }
+    }
+  }
+
+  grouping rstp-bridge-port-attr {
+    list rstp-bridge-port-table {
+      key "ifname";
+      max-elements "15";
+      description
+        "Table contains port-specific information for rstp config";
+      leaf ifname {
+        type leafref {
+          path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
+        }
+        description
+          "Interface name of the port";
+      }
+      leaf cost {
+        type uint32 {
+          range "2000..200000";
+        }
+        default "20000";
+        description
+          "The contribution of this port to the path cost of
+                 paths towards the spanning tree root which include this port also";
+      }
+      leaf priority {
+        type uint32 {
+          range "0..240";
+        }
+        description
+          "The value of the priority field";
+      }
+    }
+  }
+
+  grouping rstp-container {
+    container rstp {
+      description
+        "Open ROADM RSTP top level";
+      list rstp-bridge-instance {
+        key "bridge-name";
+        max-elements "1";
+        description
+          "rstp bridge instance, max instance = 1";
+        leaf bridge-name {
+          type string {
+            length "1..255";
+          }
+          description
+            "unique name of the bridge";
+        }
+        container rstp-config {
+          description
+            "Collection of rstp configuration attributes";
+          uses rstp-common-bridge-config;
+          uses rstp-bridge-port-attr;
+        }
+        container rstp-state {
+          config false;
+          description
+            "Collection of rstp operational attributes";
+          container rstp-bridge-attr {
+            description
+              "Collection of operational rstp bridge attributes";
+            uses rstp-root-bridge-attr;
+            leaf bridge-id {
+              type bridge-id-type;
+              description
+                "Bridge identifier of the bridge";
+            }
+            leaf topo-change-count {
+              type uint32;
+              description
+                "The total number of topology changes";
+            }
+            leaf time-since-topo-change {
+              type uint32;
+              description
+                "Time since last topology changes occurred (in seconds)";
+            }
+          }
+          container rstp-bridge-port-attr {
+            description
+              "Collection of operational rstp port related attributes";
+            uses rstp-bridge-port-state-attr;
+          }
+        }
+      }
+    }
+  }
+
+  notification rstp-topology-change {
+    description
+      "RSTP: A topologyChange event is sent by a bridge when any of
+       its configured ports transitions from the Learning state
+       to the Forwarding state, or from the Forwarding state to
+       the Blocking state. The event is not sent if a rstp-new-root
+       event is sent for the same transition";
+    uses org-openroadm-resource-types:device-id;
+  }
+  notification rstp-new-root {
+    description
+      "RSTP:The rstp-new-root event indicates that the sending agent has
+       become the new root of the Spanning Tree ";
+    uses org-openroadm-resource-types:device-id;
+  }
+  augment "/org-openroadm-device:org-openroadm-device/org-openroadm-device:protocols" {
+    when "/org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='rdm' or /org-openroadm-device:org-openroadm-device/org-openroadm-device:info/org-openroadm-device:node-type='ila'";
+    uses rstp-container;
+  }
+}
index 0fdcdb6056f01957c2f913401c527d4c5539f933..92787feb34cdb0af315928c0189b7b719cdd0abd 100644 (file)
@@ -8,6 +8,7 @@ module org-openroadm-swdl {
 
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
+    revision-date 2016-10-14;
   }
 
   organization "Open ROADM MSA";
@@ -15,31 +16,31 @@ module org-openroadm-swdl {
     "OpenROADM.org";
   description
     "Yang definitions for System Management.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-swdl@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-swdl@2017-12-15.yang
new file mode 100644 (file)
index 0000000..8647978
--- /dev/null
@@ -0,0 +1,151 @@
+module org-openroadm-swdl {
+  namespace "http://org/openroadm/de/swdl";
+  prefix org-openroadm-swdl;
+
+  import ietf-yang-types {
+    prefix yang;
+    revision-date 2013-07-15;
+  }
+  import org-openroadm-common-types {
+    prefix org-openroadm-common-types;
+    revision-date 2017-12-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "Yang definitions for System Management.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2017-06-26 {
+    description
+      "Version 2.0";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping sw-bank {
+    leaf sw-version {
+      type string;
+      description
+        "Gissue of the SW in this bank";
+    }
+    leaf sw-validation-timer {
+      type string {
+        pattern "(([0-1][0-9]|2[0-3])-([0-5][0-9])-([0-5][0-9]))";
+      }
+      description
+        "value of validation timer in hh-mm-ss";
+    }
+    leaf activation-date-time {
+      type yang:date-and-time;
+      description
+        "activation date and time: The date load was activated";
+    }
+  }
+
+  rpc sw-stage {
+    description
+      "SW stage - copies the SW from repo to staging bank";
+    input {
+      leaf filename {
+        type string {
+          length "10..255";
+        }
+        description
+          "file name which has the load";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc sw-activate {
+    description
+      "Activate new load";
+    input {
+      leaf version {
+        type string;
+        description
+          " software version of the new load which is being activated";
+      }
+      leaf validationTimer {
+        type string;
+        description
+          "validation timer hh-mm-ss";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  rpc cancel-validation-timer {
+    description
+      "Cancel validation timer which user provisioned as part of activate command";
+    input {
+      leaf accept {
+        type boolean;
+        default "true";
+        description
+          " TRUE means  validation timer is cancelled and new load is accepted";
+      }
+    }
+    output {
+      uses org-openroadm-common-types:rpc-response-status;
+    }
+  }
+  notification sw-stage-notification {
+    description
+      "notification for sw-stage.";
+    uses org-openroadm-common-types:rpc-response-status;
+  }
+  notification sw-activate-notification {
+    description
+      "notification for sw-activate events.";
+    leaf sw-active-notification-type {
+      type org-openroadm-common-types:activate-notification-type;
+    }
+    uses org-openroadm-common-types:rpc-response-status;
+  }
+}
index cdac3e8c10a76e3aed8b50ee5eadddf3334ecfe9..b0d7709acc549024dd12eac985ddbaa3a76f0f87 100644 (file)
@@ -10,41 +10,41 @@ module org-openroadm-syslog {
   contact
     "OpenROADM.org";
   description
-    "This module contains a collection of YANG definitions
+    "This module contains a collection of YANG definitions 
      for Syslog configuration.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.
-
+     
      Also contains code components extracted from IETF Interfaces.  These code components
      are copyrighted and licensed as follows:
-
+     
      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
      All rights reserved.
-
+     
      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
      publication of this document. Please review these documents carefully, as they
@@ -61,8 +61,8 @@ module org-openroadm-syslog {
 
   feature selector-sevop-config {
     description
-      "This feature represents the ability to select messages
-       using the additional operators equal to, or not equal to
+      "This feature represents the ability to select messages 
+       using the additional operators equal to, or not equal to 
        when comparing the Syslog message severity.";
   }
 
@@ -125,13 +125,13 @@ module org-openroadm-syslog {
       enum "all" {
         value 8;
         description
-          "This enum describes the case where all severities
+          "This enum describes the case where all severities 
            are selected.";
       }
       enum "none" {
         value 9;
         description
-          "This enum describes the case where no severities
+          "This enum describes the case where no severities 
            are selected.";
       }
     }
@@ -142,15 +142,15 @@ module org-openroadm-syslog {
 
   grouping syslog-severity {
     description
-      "This grouping defines the Syslog severity which is used to
+      "This grouping defines the Syslog severity which is used to 
        select log messages.";
     leaf severity {
       type severity;
       mandatory true;
       description
-        "This leaf specifies the Syslog message severity. When
-         severity is specified, the default severity comparison
-         is all messages of the specified severity and greater are
+        "This leaf specifies the Syslog message severity. When 
+         severity is specified, the default severity comparison 
+         is all messages of the specified severity and greater are 
          selected. 'all' is a special case which means all severities
          are selected. 'none' is a special case which means that
          no selection should occur or disable this filter.";
@@ -160,75 +160,75 @@ module org-openroadm-syslog {
         "../severity != 'all' and
                     ../severity != 'none'" {
         description
-          "The severity-operator is not applicable for severity 'all' or
+          "The severity-operator is not applicable for severity 'all' or 
            severity 'none'";
       }
       if-feature selector-sevop-config;
       type enumeration {
         enum "equals-or-higher" {
           description
-            "This enum specifies all messages of the specified
-             severity and higher are logged according to the
+            "This enum specifies all messages of the specified 
+             severity and higher are logged according to the 
              given log-action";
         }
         enum "equals" {
           description
-            "This enum specifies all messages that are for
-             the specified severity are logged according to the
+            "This enum specifies all messages that are for 
+             the specified severity are logged according to the 
              given log-action";
         }
         enum "not-equals" {
           description
-            "This enum specifies all messages that are not for
-             the specified severity are logged according to the
+            "This enum specifies all messages that are not for 
+             the specified severity are logged according to the 
              given log-action";
         }
       }
       default "equals-or-higher";
       description
-        "This leaf describes the option to specify how the
+        "This leaf describes the option to specify how the 
          severity comparison is performed.";
     }
   }
 
   grouping syslog-selector {
     description
-      "This grouping defines a Syslog selector which is used to
-       select log messages for the log-action (buffer, file,
+      "This grouping defines a Syslog selector which is used to 
+       select log messages for the log-action (buffer, file, 
        etc). Choose one of the following:
          no-log-facility
          log-facility [<facility> <severity>...]";
     container log-selector {
       description
-        "This container describes the log selector parameters
+        "This container describes the log selector parameters 
          for Syslog.";
       choice selector-facility {
         mandatory true;
         description
-          "This choice describes the option to specify no
+          "This choice describes the option to specify no 
            facilities, or a specific facility which can be
            all for all facilities.";
         case no-log-facility {
           description
-            "This case specifies no facilities will match when
-             comparing the Syslog message facility. This is a
-             method that can be used to effectively disable a
+            "This case specifies no facilities will match when 
+             comparing the Syslog message facility. This is a 
+             method that can be used to effectively disable a 
              particular log-action (buffer, file, etc).";
           leaf no-facilities {
             type empty;
             description
-              "This leaf specifies that no facilities are selected
+              "This leaf specifies that no facilities are selected 
                for this log-action.";
           }
         }
         case log-facility {
           description
-            "This case specifies one or more specified facilities
+            "This case specifies one or more specified facilities 
              will match when comparing the Syslog message facility.";
           list log-facility {
             key "facility";
             description
-              "This list describes a collection of Syslog
+              "This list describes a collection of Syslog 
                facilities and severities.";
             leaf facility {
               type union {
@@ -238,7 +238,7 @@ module org-openroadm-syslog {
                 type enumeration {
                   enum "all" {
                     description
-                      "This enum describes the case where all
+                      "This enum describes the case where all 
                        facilities are requested.";
                   }
                 }
@@ -255,20 +255,20 @@ module org-openroadm-syslog {
 
   container syslog {
     description
-      "This container describes the configuration parameters for
+      "This container describes the configuration parameters for 
        Syslog.";
     container log-actions {
       description
-        "This container describes the log-action parameters
+        "This container describes the log-action parameters 
          for Syslog.";
       container remote {
         description
-          "This container describes the configuration parameters for
+          "This container describes the configuration parameters for 
            remote logging.";
         list destination {
           key "name";
           description
-            "This list describes a collection of remote logging
+            "This list describes a collection of remote logging 
              destinations.";
           leaf name {
             type string;
@@ -288,16 +288,16 @@ module org-openroadm-syslog {
                 leaf address {
                   type inet:host;
                   description
-                    "The leaf uniquely specifies the address of
-                     the remote host. One of the following must
-                     be specified: an ipv4 address, an ipv6
+                    "The leaf uniquely specifies the address of 
+                     the remote host. One of the following must 
+                     be specified: an ipv4 address, an ipv6 
                      address, or a host name.";
                 }
                 leaf port {
                   type inet:port-number;
                   default "514";
                   description
-                    "This leaf specifies the port number used to
+                    "This leaf specifies the port number used to 
                      deliver messages to the remote server.";
                 }
               }
@@ -311,16 +311,16 @@ module org-openroadm-syslog {
                 leaf address {
                   type inet:host;
                   description
-                    "The leaf uniquely specifies the address of
-                     the remote host. One of the following must be
-                     specified: an ipv4 address, an ipv6 address,
+                    "The leaf uniquely specifies the address of 
+                     the remote host. One of the following must be 
+                     specified: an ipv4 address, an ipv6 address, 
                      or a host name.";
                 }
                 leaf port {
                   type inet:port-number;
                   default "514";
                   description
-                    "This leaf specifies the port number used to
+                    "This leaf specifies the port number used to 
                      deliver messages to the remote server.";
                 }
               }
diff --git a/ordmodels/device/src/main/yang/org-openroadm-syslog@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-syslog@2017-12-15.yang
new file mode 100644 (file)
index 0000000..54af614
--- /dev/null
@@ -0,0 +1,353 @@
+module org-openroadm-syslog {
+  namespace "http://org/openroadm/syslog";
+  prefix org-openroadm-syslog;
+
+  import ietf-inet-types {
+    prefix inet;
+    revision-date 2013-07-15;
+  }
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "This module contains a collection of YANG definitions 
+     for Syslog configuration.                                               
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.
+     
+     Also contains code components extracted from IETF Interfaces.  These code components
+     are copyrighted and licensed as follows:
+     
+     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
+     All rights reserved.
+     
+     This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
+     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
+     publication of this document. Please review these documents carefully, as they
+     describe your rights and restrictions with respect to this document. Code Components
+     extracted from this document must include Simplified BSD License text as described in
+     Section 4.e of the Trust Legal Provisions and are provided without warranty as
+     described in the Simplified BSD License.";
+  reference "RFC 5424: The Syslog Protocol";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2017-09-29 {
+    description
+      "Version 2.1";
+  }
+  revision 2017-07-28 {
+    description
+      "Version 2.0.1 - added revision-date to imports";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  feature selector-sevop-config {
+    description
+      "This feature represents the ability to select messages 
+       using the additional operators equal to, or not equal to 
+       when comparing the Syslog message severity.";
+  }
+
+  feature selector-match-config {
+    description
+      "This feature represents the ability to select messages based
+       on a Posix 1003.2 regular expression pattern match.";
+  }
+
+  identity syslog-facility {
+    description
+      "The base identity to represent syslog facilities";
+  }
+
+  typedef severity {
+    type enumeration {
+      enum "emergency" {
+        value 0;
+        description
+          "Emergency Level Msg";
+      }
+      enum "alert" {
+        value 1;
+        description
+          "Alert Level Msg";
+      }
+      enum "critical" {
+        value 2;
+        description
+          "Critical Level Msg";
+      }
+      enum "error" {
+        value 3;
+        description
+          "Error Level Msg";
+      }
+      enum "warning" {
+        value 4;
+        description
+          "Warning Level Msg";
+      }
+      enum "notice" {
+        value 5;
+        description
+          "Notification Level Msg";
+      }
+      enum "info" {
+        value 6;
+        description
+          "Informational Level Msg";
+      }
+      enum "debug" {
+        value 7;
+        description
+          "Debugging Level Msg";
+      }
+      enum "all" {
+        value 8;
+        description
+          "This enum describes the case where all severities 
+           are selected.";
+      }
+      enum "none" {
+        value 9;
+        description
+          "This enum describes the case where no severities 
+           are selected.";
+      }
+    }
+    description
+      "The definitions for Syslog message severity as per RFC 5424.
+       Extended the RFC definition with enums for all and none";
+  }
+
+  grouping syslog-severity {
+    description
+      "This grouping defines the Syslog severity which is used to 
+       select log messages.";
+    leaf severity {
+      type severity;
+      mandatory true;
+      description
+        "This leaf specifies the Syslog message severity. When 
+         severity is specified, the default severity comparison 
+         is all messages of the specified severity and greater are 
+         selected. 'all' is a special case which means all severities
+         are selected. 'none' is a special case which means that
+         no selection should occur or disable this filter.";
+    }
+    leaf severity-operator {
+      when
+        "../severity != 'all' and
+                    ../severity != 'none'" {
+        description
+          "The severity-operator is not applicable for severity 'all' or 
+           severity 'none'";
+      }
+      if-feature "selector-sevop-config";
+      type enumeration {
+        enum "equals-or-higher" {
+          description
+            "This enum specifies all messages of the specified 
+             severity and higher are logged according to the 
+             given log-action";
+        }
+        enum "equals" {
+          description
+            "This enum specifies all messages that are for 
+             the specified severity are logged according to the 
+             given log-action";
+        }
+        enum "not-equals" {
+          description
+            "This enum specifies all messages that are not for 
+             the specified severity are logged according to the 
+             given log-action";
+        }
+      }
+      default "equals-or-higher";
+      description
+        "This leaf describes the option to specify how the 
+         severity comparison is performed.";
+    }
+  }
+
+  grouping syslog-selector {
+    description
+      "This grouping defines a Syslog selector which is used to 
+       select log messages for the log-action (buffer, file, 
+       etc). Choose one of the following:
+         no-log-facility
+         log-facility [<facility> <severity>...]";
+    container log-selector {
+      description
+        "This container describes the log selector parameters 
+         for Syslog.";
+      choice selector-facility {
+        mandatory true;
+        description
+          "This choice describes the option to specify no 
+           facilities, or a specific facility which can be
+           all for all facilities.";
+        case no-log-facility {
+          description
+            "This case specifies no facilities will match when 
+             comparing the Syslog message facility. This is a 
+             method that can be used to effectively disable a 
+             particular log-action (buffer, file, etc).";
+          leaf no-facilities {
+            type empty;
+            description
+              "This leaf specifies that no facilities are selected 
+               for this log-action.";
+          }
+        }
+        case log-facility {
+          description
+            "This case specifies one or more specified facilities 
+             will match when comparing the Syslog message facility.";
+          list log-facility {
+            key "facility";
+            description
+              "This list describes a collection of Syslog 
+               facilities and severities.";
+            leaf facility {
+              type union {
+                type identityref {
+                  base syslog-facility;
+                }
+                type enumeration {
+                  enum "all" {
+                    description
+                      "This enum describes the case where all 
+                       facilities are requested.";
+                  }
+                }
+              }
+              description
+                "The leaf uniquely identifies a Syslog facility.";
+            }
+            uses syslog-severity;
+          }
+        }
+      }
+    }
+  }
+
+  container syslog {
+    description
+      "This container describes the configuration parameters for 
+       Syslog.";
+    leaf local-syslog-filename {
+      type string;
+      config false;
+      mandatory true;
+      description
+        "The syslog file name. It should be a fully qualified name 
+         so that the user can get the file using transfer RPC.";
+    }
+    container log-actions {
+      description
+        "This container describes the log-action parameters 
+         for Syslog.";
+      container remote {
+        description
+          "This container describes the configuration parameters for 
+           remote logging.";
+        list destination {
+          key "name";
+          description
+            "This list describes a collection of remote logging 
+             destinations.";
+          leaf name {
+            type string;
+            description
+              "An arbitrary name for the endpoint to connect to.";
+          }
+          choice transport {
+            mandatory true;
+            description
+              "This choice describes the transport option.";
+            case tcp {
+              container tcp {
+                description
+                  "This container describes the TCP transport
+                   options.";
+                reference "RFC 6587: Transmission of Syslog Messages over TCP";
+                leaf address {
+                  type inet:host;
+                  description
+                    "The leaf uniquely specifies the address of 
+                     the remote host. One of the following must 
+                     be specified: an ipv4 address, an ipv6 
+                     address, or a host name.";
+                }
+                leaf port {
+                  type inet:port-number;
+                  default "514";
+                  description
+                    "This leaf specifies the port number used to 
+                     deliver messages to the remote server.";
+                }
+              }
+            }
+            case udp {
+              container udp {
+                description
+                  "This container describes the UDP transport
+                   options.";
+                reference "RFC 5426: Transmission of Syslog Messages over UDP";
+                leaf address {
+                  type inet:host;
+                  description
+                    "The leaf uniquely specifies the address of 
+                     the remote host. One of the following must be 
+                     specified: an ipv4 address, an ipv6 address, 
+                     or a host name.";
+                }
+                leaf port {
+                  type inet:port-number;
+                  default "514";
+                  description
+                    "This leaf specifies the port number used to 
+                     deliver messages to the remote server.";
+                }
+              }
+            }
+          }
+          uses syslog-selector;
+        }
+      }
+    }
+  }
+}
index 451cae63a912a93c6f1b3e8fe75a0eaa6502462b..0d2a63a78e470648591aa2ad5f0aa64a8496ad0b 100644 (file)
@@ -7,31 +7,31 @@ module org-openroadm-wavelength-map {
     "OpenROADM.org";
   description
     "YANG definitions for mapping wavelength-number to center frequency and wavelength value.
-
-     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
      AT&T Intellectual Property.  All other rights reserved.
-
-     Redistribution and use in source and binary forms, with or without modification,
+     
+     Redistribution and use in source and binary forms, with or without modification, 
      are permitted provided that the following conditions are met:
-
-     * Redistributions of source code must retain the above copyright notice, this
+     
+     * Redistributions of source code must retain the above copyright notice, this 
        list of conditions and the following disclaimer.
-     * Redistributions in binary form must reproduce the above copyright notice,
-       this list of conditions and the following disclaimer in the documentation and/or
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
        other materials provided with the distribution.
-     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-       contributors may be used to endorse or promote products derived from this software
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
        without specific prior written permission.
-
-     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
      POSSIBILITY OF SUCH DAMAGE.";
 
   revision 2016-10-14 {
diff --git a/ordmodels/device/src/main/yang/org-openroadm-wavelength-map@2017-12-15.yang b/ordmodels/device/src/main/yang/org-openroadm-wavelength-map@2017-12-15.yang
new file mode 100644 (file)
index 0000000..febbb0b
--- /dev/null
@@ -0,0 +1,76 @@
+module org-openroadm-wavelength-map {
+  namespace "http://org/openroadm/wavelength-map";
+  prefix org-openroadm-wavelength-map;
+
+  organization
+    "Open ROADM MSA";
+  contact
+    "OpenROADM.org";
+  description
+    "YANG definitions for mapping wavelength-number to center frequency and wavelength value.
+     
+     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
+     AT&T Intellectual Property.  All other rights reserved.
+     
+     Redistribution and use in source and binary forms, with or without modification, 
+     are permitted provided that the following conditions are met:
+     
+     * Redistributions of source code must retain the above copyright notice, this 
+       list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice, 
+       this list of conditions and the following disclaimer in the documentation and/or 
+       other materials provided with the distribution.
+     * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+       contributors may be used to endorse or promote products derived from this software 
+       without specific prior written permission.
+     
+     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+     POSSIBILITY OF SUCH DAMAGE.";
+
+  revision 2017-12-15 {
+    description
+      "Version 2.2";
+  }
+  revision 2016-10-14 {
+    description
+      "Version 1.2";
+  }
+
+  grouping wavelength-map-g {
+    list wavelengths {
+      key "wavelength-number";
+      config false;
+      leaf wavelength-number {
+        type uint32;
+      }
+      leaf center-frequency {
+        type decimal64 {
+          fraction-digits 3;
+          range "191.350..196.100";
+        }
+        units "THz";
+        description
+          "Frequency of the transmit optical channel
+           Domain range:  191.350THz .. 196.100THz ";
+      }
+      leaf wavelength {
+        type decimal64 {
+          fraction-digits 2;
+          range "1528.77..1566.72";
+        }
+        units "nm";
+        description
+          "Lambda corresponding to transmit frequency
+           Domain range:  1528.72nm .. 1566.72nm ";
+      }
+    }
+  }
+}
index e262d8799b352991f354fed49baffa377f3cd494..635496c066c3f062f2f1b5dfbfae30a2e6196c8b 100644 (file)
-module ietf-network-topology {\r
-  yang-version 1;\r
-  namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";\r
-  prefix lnk;\r
-\r
-  import ietf-inet-types {\r
-    prefix inet;\r
-  }\r
-  import ietf-network {\r
-    prefix nd;\r
-  }\r
-\r
-  organization "TBD";\r
-  contact\r
-    "WILL-BE-DEFINED-LATER";\r
-  description\r
-    "This module defines a common base model for network topology, \r
-     augmenting the base network model with links to connect nodes, \r
-     as well as termination points to terminate links on nodes.";\r
-\r
-  revision 2015-06-08 {\r
-    description\r
-      "Initial revision.";\r
-    reference "draft-ietf-i2rs-yang-network-topo-01";\r
-  }\r
-\r
-  typedef link-id {\r
-    type inet:uri;\r
-    description\r
-      "An identifier for a link in a topology.\r
-       The identifier may be opaque.\r
-       The identifier SHOULD be chosen such that the same link in a\r
-       real network topology will always be identified through the\r
-       same identifier, even if the model is instantiated in \r
-          separate datastores. An implementation MAY choose to capture\r
-       semantics in the identifier, for example to indicate the type\r
-       of link and/or the type of topology that the link is a part \r
-       of.";\r
-  }\r
-\r
-  typedef tp-id {\r
-    type inet:uri;\r
-    description\r
-      "An identifier for termination points on a node.\r
-       The identifier may be opaque.\r
-       The identifier SHOULD be chosen such that the same TP in a\r
-       real network topology will always be identified through the\r
-       same identifier, even if the model is instantiated in\r
-       separate datastores. An implementation MAY choose to capture\r
-       semantics in the identifier, for example to indicate the type\r
-       of TP and/or the type of node and topology that the TP is a \r
-       part of.";\r
-  }\r
-\r
-  grouping link-ref {\r
-    description\r
-      "References a link in a specific network.";\r
-    leaf link-ref {\r
-      type leafref {\r
-        path "/nd:network[nd:network-id=current()/../"+\r
-          "nd:network-ref]/link/link-id";\r
-      }\r
-      description\r
-        "A type for an absolute reference a link instance.\r
-         (This type should not be used for relative references.\r
-         In such a case, a relative path should be used instead.)";\r
-    }\r
-    uses nd:network-ref;\r
-  }\r
-\r
-  grouping tp-ref {\r
-    description\r
-      "References a termination point in a specific node.";\r
-    leaf tp-ref {\r
-      type leafref {\r
-        path "/nd:network[nd:network-id=current()/../"+\r
-          "nd:network-ref]/nd:node[nd:node-id=current()/../"+\r
-          "nd:node-ref]/termination-point/tp-id";\r
-      }\r
-      description\r
-        "A type for an absolute reference to a termination point.\r
-         (This type should not be used for relative references.\r
-         In such a case, a relative path should be used instead.)";\r
-    }\r
-    uses nd:node-ref;\r
-  }\r
-\r
-  augment "/nd:network" {\r
-    description \r
-      "Add links to the network model.";\r
-    list link {\r
-      key "link-id";\r
-      description\r
-        "A Network Link connects a by Local (Source) node and\r
-         a Remote (Destination) Network Nodes via a set of the\r
-         nodes' termination points.\r
-         As it is possible to have several links between the same\r
-         source and destination nodes, and as a link could\r
-         potentially be re-homed between termination points, to\r
-         ensure that we would always know to distinguish between\r
-         links, every link is identified by a dedicated link\r
-         identifier.\r
-         Note that a link models a point-to-point link, not a\r
-         multipoint link.\r
-         Layering dependencies on links in underlay topologies are\r
-         not represented as the layering information of nodes and of\r
-         termination points is sufficient.";\r
-      container source {\r
-        description\r
-          "This container holds the logical source of a particular\r
-           link.";\r
-        leaf source-node {\r
-          type leafref {\r
-            path "../../../nd:node/nd:node-id";\r
-          }\r
-          mandatory true;\r
-          description\r
-            "Source node identifier, must be in same topology.";\r
-        }\r
-        leaf source-tp {\r
-          type leafref {\r
-            path "../../../nd:node[nd:node-id=current()/../"+\r
-              "source-node]/termination-point/tp-id";\r
-          }\r
-          description\r
-            "Termination point within source node that terminates\r
-             the link.";\r
-        }\r
-      }\r
-      container destination {\r
-        description\r
-          "This container holds the logical destination of a\r
-           particular link.";\r
-        leaf dest-node {\r
-          type leafref {\r
-            path "../../../nd:node/nd:node-id";\r
-          }\r
-          mandatory true;\r
-          description\r
-            "Destination node identifier, must be in the same\r
-             network.";\r
-        }\r
-        leaf dest-tp {\r
-          type leafref {\r
-            path "../../../nd:node[nd:node-id=current()/../"+\r
-              "dest-node]/termination-point/tp-id";\r
-          }\r
-          description\r
-            "Termination point within destination node that\r
-             terminates the link.";\r
-        }\r
-      }\r
-      leaf link-id {\r
-        type link-id;\r
-        description\r
-          "The identifier of a link in the topology.\r
-           A link is specific to a topology to which it belongs.";\r
-      }\r
-      list supporting-link {\r
-        key "network-ref link-ref";\r
-        description\r
-          "Identifies the link, or links, that this link\r
-           is dependent on.";\r
-        leaf network-ref {\r
-          type leafref {\r
-            path "../../../nd:supporting-network/nd:network-ref";\r
-          }\r
-          description\r
-            "This leaf identifies in which underlay topology\r
-             supporting link is present.";\r
-        }\r
-        leaf link-ref {\r
-          type leafref {\r
-            path "/nd:network[nd:network-id=current()/.."+\r
-              "/network-ref]/link/link-id";\r
-          }\r
-          description\r
-            "This leaf identifies a link which is a part\r
-             of this link's underlay. Reference loops, in which\r
-             a link identifies itself as its underlay, either\r
-             directly or transitively, are not allowed.";\r
-        }\r
-      }\r
-    }\r
-  }\r
-  augment "/nd:network/nd:node" {\r
-    description\r
-      "Augment termination points which terminate links.  \r
-       Termination points can ultimately be mapped to interfaces.";\r
-    list termination-point {\r
-      key "tp-id";\r
-      description\r
-        "A termination point can terminate a link.\r
-         Depending on the type of topology, a termination point\r
-         could, for example, refer to a port or an interface.";\r
-      leaf tp-id {\r
-        type tp-id;\r
-        description\r
-          "Termination point identifier.";\r
-      }\r
-      list supporting-termination-point {\r
-        key "network-ref node-ref tp-ref";\r
-        description\r
-          "The leaf list identifies any termination points that\r
-           the termination point is dependent on, or maps onto.\r
-           Those termination points will themselves be contained\r
-           in a supporting node.\r
-           This dependency information can be inferred from\r
-           the dependencies between links.  For this reason,\r
-           this item is not separately configurable.  Hence no\r
-           corresponding constraint needs to be articulated.\r
-           The corresponding information is simply provided by the\r
-           implementing system.";\r
-        leaf network-ref {\r
-          type leafref {\r
-            path "../../../nd:supporting-node/nd:network-ref";\r
-          }\r
-          description\r
-            "This leaf identifies in which topology the\r
-             supporting termination point is present.";\r
-        }\r
-        leaf node-ref {\r
-          type leafref {\r
-            path "../../../nd:supporting-node/nd:node-ref";\r
-          }\r
-          description\r
-            "This leaf identifies in which node the supporting\r
-             termination point is present.";\r
-        }\r
-        leaf tp-ref {\r
-          type leafref {\r
-            path "/nd:network[nd:network-id=current()/../"+\r
-              "network-ref]/nd:node[nd:node-id=current()/../"+\r
-              "node-ref]/termination-point/tp-id";\r
-          }\r
-          description\r
-            "Reference to the underlay node, must be in a\r
-             different topology";\r
-        }\r
-      }\r
-    }\r
-  }\r
-}\r
+module ietf-network-topology {
+  yang-version 1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";
+  prefix lnk;
+
+  import ietf-inet-types {
+    prefix inet;
+  }
+  import ietf-network {
+    prefix nd;
+  }
+
+  organization "TBD";
+  contact
+    "WILL-BE-DEFINED-LATER";
+  description
+    "This module defines a common base model for network topology, 
+     augmenting the base network model with links to connect nodes, 
+     as well as termination points to terminate links on nodes.";
+
+  revision 2015-06-08 {
+    description
+      "Initial revision.";
+    reference "draft-ietf-i2rs-yang-network-topo-01";
+  }
+
+  typedef link-id {
+    type inet:uri;
+    description
+      "An identifier for a link in a topology.
+       The identifier may be opaque.
+       The identifier SHOULD be chosen such that the same link in a
+       real network topology will always be identified through the
+       same identifier, even if the model is instantiated in 
+          separate datastores. An implementation MAY choose to capture
+       semantics in the identifier, for example to indicate the type
+       of link and/or the type of topology that the link is a part 
+       of.";
+  }
+
+  typedef tp-id {
+    type inet:uri;
+    description
+      "An identifier for termination points on a node.
+       The identifier may be opaque.
+       The identifier SHOULD be chosen such that the same TP in a
+       real network topology will always be identified through the
+       same identifier, even if the model is instantiated in
+       separate datastores. An implementation MAY choose to capture
+       semantics in the identifier, for example to indicate the type
+       of TP and/or the type of node and topology that the TP is a 
+       part of.";
+  }
+
+  grouping link-ref {
+    description
+      "References a link in a specific network.";
+    leaf link-ref {
+      type leafref {
+        path "/nd:network[nd:network-id=current()/../"+
+          "nd:network-ref]/link/link-id";
+      }
+      description
+        "A type for an absolute reference a link instance.
+         (This type should not be used for relative references.
+         In such a case, a relative path should be used instead.)";
+    }
+    uses nd:network-ref;
+  }
+
+  grouping tp-ref {
+    description
+      "References a termination point in a specific node.";
+    leaf tp-ref {
+      type leafref {
+        path "/nd:network[nd:network-id=current()/../"+
+          "nd:network-ref]/nd:node[nd:node-id=current()/../"+
+          "nd:node-ref]/termination-point/tp-id";
+      }
+      description
+        "A type for an absolute reference to a termination point.
+         (This type should not be used for relative references.
+         In such a case, a relative path should be used instead.)";
+    }
+    uses nd:node-ref;
+  }
+
+  augment "/nd:network" {
+    description 
+      "Add links to the network model.";
+    list link {
+      key "link-id";
+      description
+        "A Network Link connects a by Local (Source) node and
+         a Remote (Destination) Network Nodes via a set of the
+         nodes' termination points.
+         As it is possible to have several links between the same
+         source and destination nodes, and as a link could
+         potentially be re-homed between termination points, to
+         ensure that we would always know to distinguish between
+         links, every link is identified by a dedicated link
+         identifier.
+         Note that a link models a point-to-point link, not a
+         multipoint link.
+         Layering dependencies on links in underlay topologies are
+         not represented as the layering information of nodes and of
+         termination points is sufficient.";
+      container source {
+        description
+          "This container holds the logical source of a particular
+           link.";
+        leaf source-node {
+          type leafref {
+            path "../../../nd:node/nd:node-id";
+          }
+          mandatory true;
+          description
+            "Source node identifier, must be in same topology.";
+        }
+        leaf source-tp {
+          type leafref {
+            path "../../../nd:node[nd:node-id=current()/../"+
+              "source-node]/termination-point/tp-id";
+          }
+          description
+            "Termination point within source node that terminates
+             the link.";
+        }
+      }
+      container destination {
+        description
+          "This container holds the logical destination of a
+           particular link.";
+        leaf dest-node {
+          type leafref {
+            path "../../../nd:node/nd:node-id";
+          }
+          mandatory true;
+          description
+            "Destination node identifier, must be in the same
+             network.";
+        }
+        leaf dest-tp {
+          type leafref {
+            path "../../../nd:node[nd:node-id=current()/../"+
+              "dest-node]/termination-point/tp-id";
+          }
+          description
+            "Termination point within destination node that
+             terminates the link.";
+        }
+      }
+      leaf link-id {
+        type link-id;
+        description
+          "The identifier of a link in the topology.
+           A link is specific to a topology to which it belongs.";
+      }
+      list supporting-link {
+        key "network-ref link-ref";
+        description
+          "Identifies the link, or links, that this link
+           is dependent on.";
+        leaf network-ref {
+          type leafref {
+            path "../../../nd:supporting-network/nd:network-ref";
+          }
+          description
+            "This leaf identifies in which underlay topology
+             supporting link is present.";
+        }
+        leaf link-ref {
+          type leafref {
+            path "/nd:network[nd:network-id=current()/.."+
+              "/network-ref]/link/link-id";
+          }
+          description
+            "This leaf identifies a link which is a part
+             of this link's underlay. Reference loops, in which
+             a link identifies itself as its underlay, either
+             directly or transitively, are not allowed.";
+        }
+      }
+    }
+  }
+  augment "/nd:network/nd:node" {
+    description
+      "Augment termination points which terminate links.  
+       Termination points can ultimately be mapped to interfaces.";
+    list termination-point {
+      key "tp-id";
+      description
+        "A termination point can terminate a link.
+         Depending on the type of topology, a termination point
+         could, for example, refer to a port or an interface.";
+      leaf tp-id {
+        type tp-id;
+        description
+          "Termination point identifier.";
+      }
+      list supporting-termination-point {
+        key "network-ref node-ref tp-ref";
+        description
+          "The leaf list identifies any termination points that
+           the termination point is dependent on, or maps onto.
+           Those termination points will themselves be contained
+           in a supporting node.
+           This dependency information can be inferred from
+           the dependencies between links.  For this reason,
+           this item is not separately configurable.  Hence no
+           corresponding constraint needs to be articulated.
+           The corresponding information is simply provided by the
+           implementing system.";
+        leaf network-ref {
+          type leafref {
+            path "../../../nd:supporting-node/nd:network-ref";
+          }
+          description
+            "This leaf identifies in which topology the
+             supporting termination point is present.";
+        }
+        leaf node-ref {
+          type leafref {
+            path "../../../nd:supporting-node/nd:node-ref";
+          }
+          description
+            "This leaf identifies in which node the supporting
+             termination point is present.";
+        }
+        leaf tp-ref {
+          type leafref {
+            path "/nd:network[nd:network-id=current()/../"+
+              "network-ref]/nd:node[nd:node-id=current()/../"+
+              "node-ref]/termination-point/tp-id";
+          }
+          description
+            "Reference to the underlay node, must be in a
+             different topology";
+        }
+      }
+    }
+  }
+}
index c7463432527dc71883f2722f1f2d9d4963646ac7..6e7282c82b39245c0b7d9789644989c6e2003b2d 100644 (file)
-module ietf-network {\r
-  yang-version 1;\r
-  namespace "urn:ietf:params:xml:ns:yang:ietf-network";\r
-  prefix nd;\r
-\r
-  import ietf-inet-types {\r
-    prefix inet;\r
-  }\r
-\r
-  organization "TBD";\r
-  contact\r
-    "WILL-BE-DEFINED-LATER";\r
-  description\r
-    "This module defines a common base model for a collection \r
-     of nodes in a network. Node definitions s are further used\r
-     in network topologies and inventories.";\r
-\r
-  revision 2015-06-08 {\r
-    description\r
-      "Initial revision.";\r
-    reference "draft-ietf-i2rs-yang-network-topo-01";\r
-  }\r
-\r
-  typedef node-id {\r
-    type inet:uri;\r
-    description\r
-      "Identifier for a node.";\r
-  }\r
-\r
-  typedef network-id {\r
-    type inet:uri;\r
-    description\r
-      "Identifier for a network.";\r
-  }\r
-\r
-  grouping network-ref {\r
-    description\r
-      "Contains the information necessary to reference a network,\r
-       for example an underlay network.";\r
-    leaf network-ref {\r
-      type leafref {\r
-        path "/network/network-id";\r
-      }\r
-      description\r
-        "Used to reference a network, for example an underlay\r
-         network.";\r
-    }\r
-  }\r
-\r
-  grouping node-ref {\r
-    description \r
-      "Contains the information necessary to reference a node.";\r
-    leaf node-ref {\r
-      type leafref {\r
-        path "/network[network-id=current()/../network-ref]"+\r
-          "/node/node-id";\r
-      }\r
-      description\r
-        "Used to reference a node.  \r
-         Nodes are identified relative to the network they are\r
-         contained in.";\r
-    }\r
-    uses network-ref;\r
-  }\r
-\r
-  list network {\r
-    key "network-id";\r
-    description\r
-      "Describes a network.\r
-       A network typically contains an inventory of nodes,\r
-       topological information (augmented through \r
-       network-topology model), as well as layering \r
-       information.";\r
-    container network-types {\r
-      description\r
-        "Serves as an augmentation target.  \r
-         The network type is indicated through corresponding\r
-         presence containers augmented into this container.";\r
-    }\r
-    leaf network-id {\r
-      type network-id;\r
-      description\r
-        "Identifies a network.";\r
-    }\r
-    leaf server-provided {\r
-      type boolean;\r
-      config false;\r
-      description\r
-        "Indicates whether the information concerning this\r
-         particular network is populated by the server \r
-         (server-provided true, the general case for network \r
-         information discovered from the server), \r
-         or whether it is configured by a client \r
-         (server-provided true, possible e.g. for \r
-         service overlays managed through a controller).";\r
-    }\r
-    list supporting-network {\r
-      key "network-ref";\r
-      description\r
-        "An underlay network, used to represent layered network\r
-         topologies.";\r
-      leaf network-ref {\r
-        type leafref {\r
-          path "/network/network-id";\r
-        }\r
-        description\r
-          "References the underlay network.";\r
-      }\r
-    }\r
-    list node {\r
-      key "node-id";\r
-      description\r
-        "The inventory of nodes of this network.";\r
-      leaf node-id {\r
-        type node-id;\r
-        description\r
-          "Identifies a node uniquely within the containing \r
-           network.";\r
-      }\r
-      list supporting-node {\r
-        key "network-ref node-ref";\r
-        description\r
-          "Represents another node, in an underlay network, that \r
-           this node is supported by.  Used to represent layering \r
-           structure.";\r
-        leaf network-ref {\r
-          type leafref {\r
-            path "../../../supporting-network/network-ref";\r
-          }\r
-          description\r
-            "References the underlay network that the \r
-             underlay node is part of.";\r
-        }\r
-        leaf node-ref {\r
-          type leafref {\r
-            path "/network/node/node-id";\r
-          }\r
-          description\r
-            "References the underlay node itself.";\r
-        }\r
-      }\r
-    }\r
-  }\r
-}\r
+module ietf-network {
+  yang-version 1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-network";
+  prefix nd;
+
+  import ietf-inet-types {
+    prefix inet;
+  }
+
+  organization "TBD";
+  contact
+    "WILL-BE-DEFINED-LATER";
+  description
+    "This module defines a common base model for a collection 
+     of nodes in a network. Node definitions s are further used
+     in network topologies and inventories.";
+
+  revision 2015-06-08 {
+    description
+      "Initial revision.";
+    reference "draft-ietf-i2rs-yang-network-topo-01";
+  }
+
+  typedef node-id {
+    type inet:uri;
+    description
+      "Identifier for a node.";
+  }
+
+  typedef network-id {
+    type inet:uri;
+    description
+      "Identifier for a network.";
+  }
+
+  grouping network-ref {
+    description
+      "Contains the information necessary to reference a network,
+       for example an underlay network.";
+    leaf network-ref {
+      type leafref {
+        path "/network/network-id";
+      }
+      description
+        "Used to reference a network, for example an underlay
+         network.";
+    }
+  }
+
+  grouping node-ref {
+    description 
+      "Contains the information necessary to reference a node.";
+    leaf node-ref {
+      type leafref {
+        path "/network[network-id=current()/../network-ref]"+
+          "/node/node-id";
+      }
+      description
+        "Used to reference a node.  
+         Nodes are identified relative to the network they are
+         contained in.";
+    }
+    uses network-ref;
+  }
+
+  list network {
+    key "network-id";
+    description
+      "Describes a network.
+       A network typically contains an inventory of nodes,
+       topological information (augmented through 
+       network-topology model), as well as layering 
+       information.";
+    container network-types {
+      description
+        "Serves as an augmentation target.  
+         The network type is indicated through corresponding
+         presence containers augmented into this container.";
+    }
+    leaf network-id {
+      type network-id;
+      description
+        "Identifies a network.";
+    }
+    leaf server-provided {
+      type boolean;
+      config false;
+      description
+        "Indicates whether the information concerning this
+         particular network is populated by the server 
+         (server-provided true, the general case for network 
+         information discovered from the server), 
+         or whether it is configured by a client 
+         (server-provided true, possible e.g. for 
+         service overlays managed through a controller).";
+    }
+    list supporting-network {
+      key "network-ref";
+      description
+        "An underlay network, used to represent layered network
+         topologies.";
+      leaf network-ref {
+        type leafref {
+          path "/network/network-id";
+        }
+        description
+          "References the underlay network.";
+      }
+    }
+    list node {
+      key "node-id";
+      description
+        "The inventory of nodes of this network.";
+      leaf node-id {
+        type node-id;
+        description
+          "Identifies a node uniquely within the containing 
+           network.";
+      }
+      list supporting-node {
+        key "network-ref node-ref";
+        description
+          "Represents another node, in an underlay network, that 
+           this node is supported by.  Used to represent layering 
+           structure.";
+        leaf network-ref {
+          type leafref {
+            path "../../../supporting-network/network-ref";
+          }
+          description
+            "References the underlay network that the 
+             underlay node is part of.";
+        }
+        leaf node-ref {
+          type leafref {
+            path "/network/node/node-id";
+          }
+          description
+            "References the underlay node itself.";
+        }
+      }
+    }
+  }
+}
index f70b7d601c5bfab21ed61d008513f99d37a2ad4c..58b8ca08a7144524e02690f8ff9027b710505966 100644 (file)
@@ -8,19 +8,21 @@ module org-openroadm-common-service-types {
   import ietf-inet-types {
     prefix inet;
   }
-  import org-openroadm-routing-constraints {
-     prefix org-openroadm-routing-constraints;
-     revision-date 2016-10-14;
+  import org-openroadm-routing-constraints { 
+         prefix org-openroadm-routing-constraints; 
+         revision-date 2016-10-14; 
   }
   import org-openroadm-topology {
     prefix org-openroadm-topology;
-  }
-  import org-openroadm-common-types {
-     prefix org-openroadm-common-types;
      revision-date 2016-10-14;
   }
+  import org-openroadm-common-types { 
+         prefix org-openroadm-common-types; 
+         revision-date 2016-10-14; 
+  }
   import org-openroadm-resource-types {
     prefix org-openroadm-resource-types;
+     revision-date 2016-10-14;
   }
 
   organization
@@ -29,31 +31,31 @@ module org-openroadm-common-service-types {
     "OpenROADM.org";
   description
     "YANG definitions of common service types.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
@@ -96,7 +98,7 @@ module org-openroadm-common-service-types {
     }
     leaf service-rate {
       when "../service-format!='OMS'"{
-        description "service rate not applicable when service
+        description "service rate not applicable when service 
         format is roadmline";
       }
       type uint32;
@@ -344,7 +346,7 @@ module org-openroadm-common-service-types {
     leaf common-id {
       type string;
       description
-        "To be used by the ROADM controller to identify the routing
+        "To be used by the ROADM controller to identify the routing 
          constraints received from planning application (PED).";
     }
     uses sdnc-request-header;
@@ -399,7 +401,7 @@ module org-openroadm-common-service-types {
     }
     leaf-list supporting-service-name {
       description
-        "The service name that this runs over top. If connection-type is service, then this is the related
+        "The service name that this runs over top. If connection-type is service, then this is the related 
          connection-type = infrastructure service, for example.";
       type string;
     }
@@ -474,7 +476,7 @@ module org-openroadm-common-service-types {
       //Add Martial
       enum "service-feasibility-check-result" {
         value 8;
-      }
+      } 
     }
   }
 
index e8f5a1ed61273ae3927c164cfb00f72f5fbf9ef9..229726b0884c333135a33f0619484d13daf19e67 100644 (file)
@@ -8,31 +8,31 @@ module org-openroadm-routing-constraints {
     "OpenROADM.org";
   description
     "YANG definitions of routing constraints.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+      
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
index 09192eee4f23281e2913741e8469f0a193beb4c8..bf678934ae9165029459747c9a7492ba732cf72e 100644 (file)
@@ -7,16 +7,20 @@ module org-openroadm-service {
   }
   import org-openroadm-routing-constraints {
     prefix org-openroadm-routing-constraints;
+    revision-date 2016-10-14;
   }
   import org-openroadm-common-types {
     prefix org-openroadm-common-types;
     revision-date 2016-10-14;
+
   }
   import org-openroadm-resource-types {
     prefix org-openroadm-resource-types;
+    revision-date 2016-10-14;
   }
   import org-openroadm-common-service-types {
     prefix org-openroadm-common-service-types;
+    revision-date 2016-10-14;
   }
 
   organization
@@ -25,31 +29,31 @@ module org-openroadm-service {
     "OpenROADM.org";
   description
     "YANG definitions of services.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
@@ -99,7 +103,7 @@ module org-openroadm-service {
         type string;
         mandatory true;
         description
-          "To be used by the ROADM controller to identify the routing
+          "To be used by the ROADM controller to identify the routing 
            constraints received from planning application (PED).";
       }
       uses org-openroadm-common-service-types:sdnc-request-header;
@@ -328,7 +332,7 @@ module org-openroadm-service {
       leaf common-id {
         type string;
         description
-          "To be used by the ROADM controller to identify the routing
+          "To be used by the ROADM controller to identify the routing 
            constraints received from planning application (PED).";
       }
       leaf connection-type {
index f616c6a996b26c5fd69403af5401918f5a1e88b4..31c0e95d0ac163c5d0d981a76e8ac0a94769e432 100644 (file)
@@ -4,6 +4,7 @@ module org-openroadm-topology {
 
   import org-openroadm-resource {
     prefix org-openroadm-resource;
+    revision-date 2016-10-14;
   }
 
   organization
@@ -12,31 +13,31 @@ module org-openroadm-topology {
     "OpenROADM.org";
   description
     "YANG definitions of topology.
-
-      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
+       
+      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
       AT&T Intellectual Property.  All other rights reserved.
-
-      Redistribution and use in source and binary forms, with or without modification,
+      
+      Redistribution and use in source and binary forms, with or without modification, 
       are permitted provided that the following conditions are met:
-
-      * Redistributions of source code must retain the above copyright notice, this
+      
+      * Redistributions of source code must retain the above copyright notice, this 
         list of conditions and the following disclaimer.
-      * Redistributions in binary form must reproduce the above copyright notice,
-        this list of conditions and the following disclaimer in the documentation and/or
+      * Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation and/or 
         other materials provided with the distribution.
-      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
-        contributors may be used to endorse or promote products derived from this software
+      * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
+        contributors may be used to endorse or promote products derived from this software 
         without specific prior written permission.
-
-      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
-      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
-      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
-      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+      
+      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
+      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
+      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
+      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
+      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
       POSSIBILITY OF SUCH DAMAGE";
 
   revision 2016-10-14 {
index bfe5aa4d18174e77b226e844d597dee83f4e23b2..848981fd2c6b3cc3161ad13a7be67e5e437fca92 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.transportpce.renderer.provisiondevice;
 
 import java.util.ArrayList;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -16,13 +17,21 @@ import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
 import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
 import org.opendaylight.transportpce.renderer.utils.CreateOtsOmsDataUtils;
@@ -38,17 +47,34 @@ public class DeviceRendererServiceImplCreateOtsOmsTest extends AbstractTest {
     private OpenRoadmInterfaces openRoadmInterfaces;
     private OpenRoadmInterfaceFactory openRoadmInterfaceFactory;
     private DeviceTransactionManager deviceTransactionManager;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
     private void setMountPoint(MountPoint mountPoint) {
         MountPointService mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
         this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
-        PortMapping portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+        this.portMappingVersion22 = new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager,
                 this.openRoadmInterfaces);
-        this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+        this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager,
                 this.openRoadmInterfaces);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+        PortMapping portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
+        this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping, this.openRoadmInterfaces);
+        this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
+                this.crossConnectImpl121, this.crossConnectImpl22);
         this.crossConnect = Mockito.spy(this.crossConnect);
         this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
             this.deviceTransactionManager, this.openRoadmInterfaceFactory, this.openRoadmInterfaces,
index 65fe3fa7af244150f34c8d43be99332fe934a938..fc6bdf6b075de19ffa80445f931841aa9e4ab643 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.transportpce.renderer.provisiondevice;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -19,13 +20,21 @@ import org.opendaylight.controller.md.sal.binding.api.MountPointService;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
 import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
 import org.opendaylight.transportpce.renderer.utils.MountPointUtils;
@@ -50,17 +59,34 @@ public class DeviceRendererServiceImplDeleteTest extends AbstractTest {
     private OpenRoadmInterfaces openRoadmInterfaces;
     private OpenRoadmInterfaceFactory openRoadmInterfaceFactory;
     private DeviceTransactionManager deviceTransactionManager;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
     private void setMountPoint(MountPoint mountPoint) {
         MountPointService mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(this.deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
         this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
-        PortMapping portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
+        this.portMappingVersion22 = new PortMappingVersion22(getDataBroker(), this.deviceTransactionManager,
                 this.openRoadmInterfaces);
-        this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+        this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), this.deviceTransactionManager,
                 this.openRoadmInterfaces);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+        PortMapping portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
+        this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping, this.openRoadmInterfaces);
+        this.crossConnectImpl121 = new CrossConnectImpl121(this.deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(this.deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager, this.mappingUtils,
+                this.crossConnectImpl121, this.crossConnectImpl22);
         this.crossConnect = Mockito.spy(this.crossConnect);
         this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
             this.deviceTransactionManager, this.openRoadmInterfaceFactory, this.openRoadmInterfaces,
index 3cf081ede49d09f5c7406dfaefe46e93b048f0bb..5bdc6770cc70cd60dafee24724ec3712ed7dff10 100644 (file)
@@ -10,20 +10,30 @@ package org.opendaylight.transportpce.renderer.provisiondevice;
 
 import java.util.ArrayList;
 import java.util.List;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.StringConstants;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
 import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
 import org.opendaylight.transportpce.renderer.stub.MountPointStub;
@@ -41,18 +51,37 @@ public class DeviceRendererServiceImplRollbackTest extends AbstractTest {
     private DeviceRendererService deviceRendererService;
     private CrossConnect crossConnect;
     private OpenRoadmInterfaces openRoadmInterfaces;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
     private void setMountPoint(MountPoint mountPoint) {
         MountPointService mountPointService = new MountPointServiceStub(mountPoint);
         DeviceTransactionManager deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.mappingUtils = Mockito.spy(this.mappingUtils);
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
         this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
-        PortMapping portMapping = new PortMappingImpl(this.getDataBroker(), deviceTransactionManager,
-                this.openRoadmInterfaces);
-        OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
+        this.portMappingVersion22 =
+                new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), deviceTransactionManager,
                 this.openRoadmInterfaces);
-        this.crossConnect = new CrossConnectImpl(deviceTransactionManager);
+        this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
+                this.crossConnectImpl22);
         this.crossConnect = Mockito.spy(this.crossConnect);
+        PortMapping portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
+        OpenRoadmInterfaceFactory openRoadmInterfaceFactory =
+                new OpenRoadmInterfaceFactory(portMapping, this.openRoadmInterfaces);
         this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
                 deviceTransactionManager, openRoadmInterfaceFactory, this.openRoadmInterfaces, this.crossConnect,
             portMapping);
@@ -84,7 +113,8 @@ public class DeviceRendererServiceImplRollbackTest extends AbstractTest {
         nodeInterfaces.add(nodeInterfaceBuilder.build());
         RendererRollbackInputBuilder rendererRollbackInputBuilder = new RendererRollbackInputBuilder();
         rendererRollbackInputBuilder.setNodeInterface(nodeInterfaces);
-
+        Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
+                .getOpenRoadmVersion("node1");
         RendererRollbackOutput rendererRollbackOutput =
                 this.deviceRendererService.rendererRollback(rendererRollbackInputBuilder.build());
         Assert.assertFalse(rendererRollbackOutput.isSuccess());
index dfb78bf2a437f6ef2081ac4c4c5b22d12cf6dc86..584c336effbd7a8a2cc1dc5e7a8b057538b9580a 100644 (file)
@@ -10,20 +10,30 @@ package org.opendaylight.transportpce.renderer.provisiondevice;
 
 import java.util.ArrayList;
 import java.util.List;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.opendaylight.controller.md.sal.binding.api.MountPoint;
 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
+import org.opendaylight.transportpce.common.StringConstants;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
 import org.opendaylight.transportpce.renderer.provisiondevice.servicepath.ServicePathDirection;
 import org.opendaylight.transportpce.renderer.stub.MountPointServiceStub;
@@ -42,20 +52,39 @@ public class DeviceRendererServiceImplSetupTest extends AbstractTest {
     private CrossConnect crossConnect;
     private PortMapping portMapping;
     private OpenRoadmInterfaces openRoadmInterfaces;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
 
     private void setMountPoint(MountPoint mountPoint) {
         MountPointService mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.mappingUtils = Mockito.spy(this.mappingUtils);
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
         this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
-        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
-                this.openRoadmInterfaces);
+        this.portMappingVersion22 =
+                new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMappingVersion121 =
+                new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
         this.portMapping = Mockito.spy(this.portMapping);
-        OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(this.portMapping,
-            this.openRoadmInterfaces);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+        this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
+                this.crossConnectImpl22);
         this.crossConnect = Mockito.spy(this.crossConnect);
+        OpenRoadmInterfaceFactory openRoadmInterfaceFactory =
+                new OpenRoadmInterfaceFactory(this.portMapping, this.openRoadmInterfaces);
         this.deviceRendererService = new DeviceRendererServiceImpl(this.getDataBroker(),
         this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
             portMapping);
@@ -101,6 +130,8 @@ public class DeviceRendererServiceImplSetupTest extends AbstractTest {
         List<Nodes> nodes = new ArrayList<>();
         nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
         ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
+        Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
+                .getOpenRoadmVersion("node1");
         Mockito.doReturn(java.util.Optional.empty()).when(this.crossConnect).postCrossConnect(nodeId, 20L, srcTP,
             dstTp);
         ServicePathOutput servicePathOutput = deviceRendererService.setupServicePath(servicePathInput,
@@ -142,7 +173,8 @@ public class DeviceRendererServiceImplSetupTest extends AbstractTest {
                 List<Nodes> nodes = new ArrayList<>();
                 nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
                 ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
-
+                Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
+                        .getOpenRoadmVersion("node1");
                 for (ServicePathDirection servicePathDirection : ServicePathDirection.values()) {
                     ServicePathOutput servicePathOutput = deviceRendererService.setupServicePath(servicePathInput,
                             servicePathDirection);
@@ -173,7 +205,8 @@ public class DeviceRendererServiceImplSetupTest extends AbstractTest {
         List<Nodes> nodes = new ArrayList<>();
         nodes.add(ServiceImplementationDataUtils.createNode(nodeId, srcTP, dstTp));
         ServicePathInput servicePathInput = ServiceImplementationDataUtils.buildServicePathInputs(nodes);
-
+        Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(this.mappingUtils)
+                .getOpenRoadmVersion("node1");
         for (ServicePathDirection servicePathDirection : ServicePathDirection.values()) {
             ServicePathOutput servicePathOutput = deviceRendererService.setupServicePath(servicePathInput,
                     servicePathDirection);
index 920e43f049390fec1f1c54f36c6a413555b8c1e2..820982fb0ef4fad2121c0877c691bd975b1038fe 100644 (file)
@@ -25,12 +25,20 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.ResponseCodes;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
 import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
 import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
@@ -64,17 +72,36 @@ public class RendererServiceOperationsImplDeleteTest extends AbstractTest {
     private CrossConnect crossConnect;
     private NetworkModelWavelengthService networkModelWavelengthService;
     private TransportpceOlmService olmService;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
     private void setMountPoint(MountPoint mountPoint) {
         MountPointService mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
-        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
-                openRoadmInterfaces);
-        OpenRoadmInterfaceFactory openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
-                openRoadmInterfaces);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
+        this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
+        this.portMappingVersion22 =
+                new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMappingVersion121 =
+                new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
+        this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
+                this.crossConnectImpl22);
         this.crossConnect = Mockito.spy(crossConnect);
+        OpenRoadmInterfaceFactory openRoadmInterfaceFactory =
+                new OpenRoadmInterfaceFactory(portMapping, openRoadmInterfaces);
         this.deviceRenderer = new DeviceRendererServiceImpl(this.getDataBroker(),
                 this.deviceTransactionManager, openRoadmInterfaceFactory, openRoadmInterfaces, crossConnect,
             this.portMapping);
index 3a4e25ad7262b14f4497ac2cbcd613ee10cc458b..be4d641ca242d47e1b48f57ccf3faccc53e868ba 100644 (file)
@@ -21,13 +21,21 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService
 import org.opendaylight.transportpce.common.ResponseCodes;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
 import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
+import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl22;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
 import org.opendaylight.transportpce.common.device.DeviceTransactionManagerImpl;
+import org.opendaylight.transportpce.common.mapping.MappingUtils;
+import org.opendaylight.transportpce.common.mapping.MappingUtilsImpl;
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.mapping.PortMappingImpl;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion121;
+import org.opendaylight.transportpce.common.mapping.PortMappingVersion22;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
+import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl22;
 import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
 import org.opendaylight.transportpce.renderer.NetworkModelWavelengthServiceImpl;
 import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
@@ -65,17 +73,35 @@ public class RendererServiceOperationsImplTest extends AbstractTest {
     private CrossConnect crossConnect;
     private TransportpceOlmService olmService;
     private NetworkModelWavelengthService networkModelWavelengthService;
+    private MappingUtils mappingUtils;
+    private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
+    private OpenRoadmInterfacesImpl22 openRoadmInterfacesImpl22;
+    private PortMappingVersion22 portMappingVersion22;
+    private PortMappingVersion121 portMappingVersion121;
+    private CrossConnectImpl121 crossConnectImpl121;
+    private CrossConnectImpl22 crossConnectImpl22;
 
     private void setMountPoint(MountPoint mountPoint) {
         this.mountPointService = new MountPointServiceStub(mountPoint);
         this.deviceTransactionManager = new DeviceTransactionManagerImpl(this.mountPointService, 3000);
-        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(this.deviceTransactionManager);
+        this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl22(deviceTransactionManager);
+        this.mappingUtils = new MappingUtilsImpl(getDataBroker());
+        this.openRoadmInterfaces = new OpenRoadmInterfacesImpl(deviceTransactionManager, mappingUtils,
+                openRoadmInterfacesImpl121, openRoadmInterfacesImpl22);
         this.openRoadmInterfaces = Mockito.spy(this.openRoadmInterfaces);
-        this.portMapping = new PortMappingImpl(this.getDataBroker(), this.deviceTransactionManager,
-            openRoadmInterfaces);
+        this.portMappingVersion22 =
+                new PortMappingVersion22(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMappingVersion121 =
+                new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion22, this.mappingUtils,
+                this.portMappingVersion121);
         this.openRoadmInterfaceFactory = new OpenRoadmInterfaceFactory(portMapping,
             openRoadmInterfaces);
-        this.crossConnect = new CrossConnectImpl(this.deviceTransactionManager);
+        this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
+        this.crossConnectImpl22 = new CrossConnectImpl22(deviceTransactionManager);
+        this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
+                this.crossConnectImpl22);
     }
 
     @Before