From 72384f4cf8aa066e18cf4712a545c70ec23638f4 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Tue, 3 Aug 2021 15:41:28 +0530 Subject: New devicemanager for OpenROADM version 7.1 Support for org.openroadm.device yang revision 7.1 and related yangs Issue-ID: CCSDK-3412 Signed-off-by: Ravi Pendurty Change-Id: Ie9f5b42947c725ed2cdc4f8b3c4ad7f6cdfd7b82 Signed-off-by: Ravi Pendurty --- .../devicemanager-onap/openroadm71/feature/pom.xml | 48 + .../openroadm71/installer/pom.xml | 113 + .../src/assembly/assemble_mvnrepo_zip.xml | 47 + .../devicemanager-onap/openroadm71/model/pom.xml | 70 + .../src/main/yang/devicemanager-openroadm71.yang | 37 + sdnr/wt/devicemanager-onap/openroadm71/pom.xml | 60 + .../openroadm71/provider/pom.xml | 133 + .../impl/DeviceManagerOpenroadmImpl.java | 103 + .../openroadm71/impl/InitialDeviceAlarmReader.java | 159 ++ .../impl/OpenroadmChangeNotificationListener.java | 130 + .../OpenroadmDeviceChangeNotificationListener.java | 129 + .../impl/OpenroadmFaultNotificationListener.java | 159 ++ .../openroadm71/impl/OpenroadmInventoryInput.java | 151 ++ .../openroadm71/impl/OpenroadmNetworkElement.java | 329 +++ .../impl/OpenroadmNetworkElementBase.java | 74 + .../impl/OpenroadmNetworkElementFactory.java | 64 + .../openroadm71/impl/PmDataBuilderOpenRoadm.java | 300 +++ .../pm/types/rev200327/PmDataTypeBuilder.java | 23 + .../org/opendaylight/blueprint/impl-blueprint.xml | 38 + .../provider/src/main/resources/version.properties | 24 + .../provider/src/main/yang/iana-hardware.yang | 180 ++ .../provider/src/main/yang/ietf-hardware.yang | 1141 +++++++++ .../provider/src/main/yang/ietf-interfaces.yang | 1073 ++++++++ .../src/main/yang/org-openroadm-alarm.yang | 190 ++ .../yang/org-openroadm-common-alarm-pm-types.yang | 81 + .../yang/org-openroadm-common-amplifier-types.yang | 99 + .../main/yang/org-openroadm-common-attributes.yang | 188 ++ .../yang/org-openroadm-common-equipment-types.yang | 102 + .../main/yang/org-openroadm-common-link-types.yang | 95 + .../main/yang/org-openroadm-common-node-types.yang | 69 + ...org-openroadm-common-optical-channel-types.yang | 297 +++ .../yang/org-openroadm-common-state-types.yang | 113 + .../src/main/yang/org-openroadm-common-types.yang | 427 ++++ .../src/main/yang/org-openroadm-device-types.yang | 151 ++ .../src/main/yang/org-openroadm-device.yang | 2608 ++++++++++++++++++++ .../yang/org-openroadm-equipment-states-types.yang | 147 ++ .../src/main/yang/org-openroadm-interfaces.yang | 181 ++ ...g-openroadm-optical-operational-interfaces.yang | 92 + .../main/yang/org-openroadm-otn-common-types.yang | 352 +++ .../main/yang/org-openroadm-physical-types.yang | 153 ++ .../src/main/yang/org-openroadm-pm-types.yang | 709 ++++++ .../provider/src/main/yang/org-openroadm-pm.yang | 361 +++ .../src/main/yang/org-openroadm-port-types.yang | 440 ++++ .../main/yang/org-openroadm-probable-cause.yang | 890 +++++++ .../main/yang/org-openroadm-resource-types.yang | 374 +++ .../src/main/yang/org-openroadm-resource.yang | 366 +++ .../provider/src/main/yang/org-openroadm-swdl.yang | 215 ++ .../yang/org-openroadm-switching-pool-types.yang | 63 + .../src/main/yang/org-openroadm-user-mgmt.yang | 161 ++ .../test/TestChangeNotificationListener.java | 92 + .../test/TestDeviceManagerOpenRoadmImpl.java | 54 + .../test/TestOpenRoadmAlarmNotification.java | 110 + .../TestOpenRoadmDeviceChangeNotification.java | 120 + .../openroadm/test/TestOpenRoadmInventory.java | 144 ++ .../test/TestOpenRoadmNetworkElement.java | 310 +++ .../test/TestOpenRoadmNetworkElementFactory.java | 101 + .../openroadm/test/TestOpenRoadmPMDataBuilder.java | 221 ++ .../test/TestOpenroadmNetworkElementBase.java | 62 + .../org.mockito.plugins.MockMaker | 1 + .../src/test/resources/simplelogger.properties | 61 + 60 files changed, 14785 insertions(+) create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/feature/pom.xml create mode 100755 sdnr/wt/devicemanager-onap/openroadm71/installer/pom.xml create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/installer/src/assembly/assemble_mvnrepo_zip.xml create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/model/pom.xml create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/model/src/main/yang/devicemanager-openroadm71.yang create mode 100755 sdnr/wt/devicemanager-onap/openroadm71/pom.xml create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/pom.xml create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/DeviceManagerOpenroadmImpl.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/InitialDeviceAlarmReader.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmChangeNotificationListener.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmDeviceChangeNotificationListener.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmFaultNotificationListener.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmInventoryInput.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElement.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementBase.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementFactory.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/PmDataBuilderOpenRoadm.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev200327/PmDataTypeBuilder.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/version.properties create mode 100755 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/iana-hardware.yang create mode 100755 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-hardware.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-interfaces.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-alarm.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-alarm-pm-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-amplifier-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-attributes.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-equipment-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-link-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-node-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-optical-channel-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-state-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-equipment-states-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-interfaces.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-optical-operational-interfaces.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-otn-common-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-physical-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-port-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-probable-cause.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-swdl.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-switching-pool-types.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-user-mgmt.yang create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenroadmNetworkElementBase.java create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker create mode 100644 sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/simplelogger.properties (limited to 'sdnr/wt/devicemanager-onap/openroadm71') diff --git a/sdnr/wt/devicemanager-onap/openroadm71/feature/pom.xml b/sdnr/wt/devicemanager-onap/openroadm71/feature/pom.xml new file mode 100644 index 000000000..0269b22a3 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/feature/pom.xml @@ -0,0 +1,48 @@ + + + + + 4.0.0 + + + org.onap.ccsdk.parent + single-feature-parent + 2.2.0-SNAPSHOT + + + + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-devicemanager-onap-openroadm71-feature + 1.2.0-SNAPSHOT + feature + + ccsdk-features :: ${project.artifactId} + + + + ${project.groupId} + sdnr-wt-devicemanager-onap-openroadm71-provider + ${project.version} + + + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/installer/pom.xml b/sdnr/wt/devicemanager-onap/openroadm71/installer/pom.xml new file mode 100755 index 000000000..cd1ecfe51 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/installer/pom.xml @@ -0,0 +1,113 @@ + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 2.2.0-SNAPSHOT + + + + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-devicemanager-onap-openroadm71-installer + 1.2.0-SNAPSHOT + pom + + ccsdk-features :: ${project.artifactId} + + + sdnr-wt-devicemanager-onap-openroadm71 + false + + + + + ${project.groupId} + ${application.name}-feature + ${project.version} + xml + features + + + * + * + + + + + ${project.groupId} + ${application.name}-provider + ${project.version} + + + + + + + maven-assembly-plugin + + + maven-repo-zip + + single + + package + + true + stage/${application.name}-${project.version} + + src/assembly/assemble_mvnrepo_zip.xml + + true + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-nested-dependencies + + copy-dependencies + + prepare-package + + true + ${project.build.directory}/assembly/system + false + true + true + true + false + false + + + + + + + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/installer/src/assembly/assemble_mvnrepo_zip.xml b/sdnr/wt/devicemanager-onap/openroadm71/installer/src/assembly/assemble_mvnrepo_zip.xml new file mode 100644 index 000000000..dfe5060bf --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/installer/src/assembly/assemble_mvnrepo_zip.xml @@ -0,0 +1,47 @@ + + + + + + repo + + zip + + + + false + + + + target/assembly/ + . + + + + + + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/model/pom.xml b/sdnr/wt/devicemanager-onap/openroadm71/model/pom.xml new file mode 100644 index 000000000..c386408f3 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/model/pom.xml @@ -0,0 +1,70 @@ + + + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 2.2.0-SNAPSHOT + + + + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-devicemanager-onap-openroadm71-model + 1.2.0-SNAPSHOT + bundle + + ccsdk-features :: ${project.artifactId} + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + + + + + true + + + + + + + + + org.jacoco + jacoco-maven-plugin + + + **/gen/** + **/generated-sources/** + **/yang-gen-sal/** + **/pax/** + + + + + + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/model/src/main/yang/devicemanager-openroadm71.yang b/sdnr/wt/devicemanager-onap/openroadm71/model/src/main/yang/devicemanager-openroadm71.yang new file mode 100644 index 000000000..6b55c9164 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/model/src/main/yang/devicemanager-openroadm71.yang @@ -0,0 +1,37 @@ +module devicemanager-openroadm71{ + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:devicemanager-openroadm71"; + prefix devicemanager-openroadm71; + + organization + "highstreet technologies GmbH"; + contact + "Web: + O-RAN: + + + + 4.0.0 + + + org.onap.ccsdk.parent + odlparent-lite + 2.2.0-SNAPSHOT + + + + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-devicemanager-onap-openroadm71-top + 1.2.0-SNAPSHOT + pom + + ccsdk-features :: ${project.artifactId} + + + model + provider + feature + installer + + + + sdnr-wt-devicemanager-onap-openroadm71 + + + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/pom.xml b/sdnr/wt/devicemanager-onap/openroadm71/provider/pom.xml new file mode 100644 index 000000000..78293a25b --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/pom.xml @@ -0,0 +1,133 @@ + + + + + 4.0.0 + + + org.onap.ccsdk.parent + binding-parent + 2.2.0-SNAPSHOT + + + + org.onap.ccsdk.features.sdnr.wt + sdnr-wt-devicemanager-onap-openroadm71-provider + 1.2.0-SNAPSHOT + bundle + + ccsdk-features :: ${project.artifactId} + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + + + + + true + yyyy-MM-dd HH:mm + ${maven.build.timestamp} UTC + + + + + + org.mockito + mockito-core + + test + + + byte-buddy + net.bytebuddy + + test + + + + + + ${project.groupId} + ietf-alarms + ${project.version} + provided + + + ${project.groupId} + sdnr-wt-devicemanager-onap-openroadm71-model + ${project.version} + + + ${project.groupId} + sdnr-wt-devicemanager-core-model + ${project.version} + provided + + + ${project.groupId} + sdnr-wt-data-provider-model + ${project.version} + provided + + + ${project.groupId} + sdnr-wt-netconfnode-state-service-model + ${project.version} + provided + + + org.opendaylight.netconf + sal-netconf-connector + provided + + + org.osgi + org.osgi.core + provided + + + + + + + src/main/resources + true + + + + + org.jacoco + jacoco-maven-plugin + + + **/gen/** + **/generated-sources/** + **/yang-gen-sal/** + **/pax/** + + + + + + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/DeviceManagerOpenroadmImpl.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/DeviceManagerOpenroadmImpl.java new file mode 100644 index 000000000..9feee5171 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/DeviceManagerOpenroadmImpl.java @@ -0,0 +1,103 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.FactoryRegistration; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Shabnam Sultana + * + * Class to initialize the OpenRoadm Device Manager + **/ +public class DeviceManagerOpenroadmImpl implements AutoCloseable { + + // variables + private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerOpenroadmImpl.class); + private static final String APPLICATION_NAME = "DeviceManagerOpenRoadm"; + @SuppressWarnings("unused") + private static final String CONFIGURATIONFILE = "etc/devicemanager-opeenroadm.properties"; + private NetconfNetworkElementService netconfNetworkElementService; + private HtDatabaseClient htDatabaseClient; + private Boolean devicemanagerInitializationOk = false; + private FactoryRegistration resOpenRoadm; + // end of variables + + // Blueprint begin + // constructors + public DeviceManagerOpenroadmImpl() { + LOG.info("Creating provider for {}", APPLICATION_NAME); + resOpenRoadm = null; + } + // end of constructors + + // public methods + public void setNetconfNetworkElementService(NetconfNetworkElementService netconfNetworkElementService) { + this.netconfNetworkElementService = netconfNetworkElementService; + } + + public void init() throws Exception { + + LOG.info("Session Initiated start {}", APPLICATION_NAME); + + resOpenRoadm = netconfNetworkElementService.registerBindingNetworkElementFactory(new OpenroadmNetworkElementFactory()); + + + netconfNetworkElementService.writeToEventLog(APPLICATION_NAME, "startup", "done"); + this.devicemanagerInitializationOk = true; + + LOG.info("Session Initiated end. Initialization done {}", devicemanagerInitializationOk); + } + // Blueprint end + + @Override + public void close() throws Exception { + LOG.info("closing ..."); + close(htDatabaseClient); + close(resOpenRoadm); + LOG.info("closing done"); + } + // end of public methods + + // private methods + /** + * Used to close all Services, that should support AutoCloseable Pattern + * + * @param toClose + * @throws Exception + */ + private void close(AutoCloseable... toCloseList) { + for (AutoCloseable element : toCloseList) { + if (element != null) { + try { + element.close(); + } catch (Exception e) { + LOG.warn("Fail during close: ", e); + } + } + } + } + // end of private methods +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/InitialDeviceAlarmReader.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/InitialDeviceAlarmReader.java new file mode 100644 index 000000000..5a9beaf9a --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/InitialDeviceAlarmReader.java @@ -0,0 +1,159 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.ActiveAlarmList; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.Severity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.active.alarm.list.ActiveAlarms; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Faultlog; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Shabnam Sultana + * + * Class to read the initial alarms at the time of device registration + * + **/ + +public class InitialDeviceAlarmReader { + // variables + // in fact there is no alarm counter in the alarm obj, we have to do it on our own globally per device + private Integer alarmCounter = 1; + private static final Logger log = LoggerFactory.getLogger(InitialDeviceAlarmReader.class); + private final NetconfBindingAccessor netConfAccesor; + private final @NonNull FaultService faultEventListener; + private final DataProvider dataProvider; + // end of variables + + // constructors + public InitialDeviceAlarmReader(NetconfBindingAccessor accessor, DeviceManagerServiceProvider serviceProvider) { + this.netConfAccesor = accessor; + this.faultEventListener = serviceProvider.getFaultService(); + this.dataProvider = serviceProvider.getDataProvider(); + } + // end of constructors + + // protected methods + // Mapping the alarm data with the fault data + protected FaultData writeFaultData() { + FaultData faultData = new FaultData(); + Optional list = this.getActiveAlarmList(this.netConfAccesor); + if (list.isPresent() && list.get().getActiveAlarms() != null) { + Collection activeAlarms = YangHelper.getCollection(list.get().getActiveAlarms()); + if (!activeAlarms.isEmpty()) { + for (ActiveAlarms activeAlarm : activeAlarms) { + faultData.add(this.netConfAccesor.getNodeId(), this.alarmCounter, activeAlarm.getRaiseTime(), + activeAlarm.getResource().getDevice().getNodeId().getValue(), + activeAlarm.getProbableCause().getCause().getName(), + checkSeverityValue(activeAlarm.getSeverity())); + this.alarmCounter++; + } + return faultData; + } + } + return faultData; + } + + // Write into the FaultLog + protected void writeAlarmLog(FaultData faultData) { + if (faultData != null) { + List faultLog = faultData.getProblemList(); + for (Faultlog fe : faultLog) { + this.dataProvider.writeFaultLog(fe); + } + } + } + + // Use the FaultService for Alarm notifications + protected void faultService() { + this.faultEventListener.initCurrentProblemStatus(this.netConfAccesor.getNodeId(), writeFaultData()); + writeAlarmLog(writeFaultData()); + } + // Mapping Severity of AlarmNotification to SeverityType of FaultLog + protected static SeverityType checkSeverityValue(Severity severity) { + SeverityType severityType = null; + log.info("Device Severity: {}", severity.getName()); + + switch (severity.getName()) { + case ("warning"): + severityType = SeverityType.Warning; + break; + case ("major"): + severityType = SeverityType.Major; + break; + case ("minor"): + severityType = SeverityType.Minor; + break; + case ("clear"): + severityType = SeverityType.NonAlarmed; + break; + case ("critical"): + severityType = SeverityType.Critical; + break; + case ("indeterminate"): + severityType = SeverityType.Critical; + break; + default: + severityType = SeverityType.Critical; + break; + + } + return severityType; + + } + // end of protected methods + + // private methods + + // Read Alarm Data + private Optional getActiveAlarmList(NetconfBindingAccessor accessor) { + final Class classAlarm = ActiveAlarmList.class; + log.info("Get Alarm data for element {}", accessor.getNodeId().getValue()); + InstanceIdentifier alarmDataIid = InstanceIdentifier.builder(classAlarm).build(); + + ActiveAlarmList alarmData = accessor.getTransactionUtils().readData(accessor.getDataBroker(), + LogicalDatastoreType.OPERATIONAL, alarmDataIid); + + log.info("AlarmData {}", alarmData); + return Optional.ofNullable(alarmData); + } + + + // end of private methods + + + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmChangeNotificationListener.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmChangeNotificationListener.java new file mode 100644 index 000000000..d65017c51 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmChangeNotificationListener.java @@ -0,0 +1,130 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import java.util.List; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.IetfNetconfNotificationsListener; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfCapabilityChange; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfirmedCommit; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionEnd; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStart; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author Shabnam Sultana + * + * Listener for change notifications + * + **/ +public class OpenroadmChangeNotificationListener implements IetfNetconfNotificationsListener { + + // variables + private static final Logger log = LoggerFactory.getLogger(OpenroadmChangeNotificationListener.class); + private final NetconfAccessor netconfAccessor; + private final DataProvider databaseService; + private final WebsocketManagerService notificationServiceService; + // end of variables + + // constructors + public OpenroadmChangeNotificationListener(NetconfAccessor netconfAccessor, DataProvider databaseService, + WebsocketManagerService notificationService) { + this.netconfAccessor = netconfAccessor; + this.databaseService = databaseService; + this.notificationServiceService = notificationService; + } + // end of constructors + + // public methods + @Override + public void onNetconfConfirmedCommit(NetconfConfirmedCommit notification) { + log.info("onNetconfConfirmedCommit {} ", notification); + this.notificationServiceService.sendNotification(notification, this.netconfAccessor.getNodeId(), + NetconfConfirmedCommit.QNAME, NetconfTimeStampImpl.getConverter().getTimeStamp()); + } + + @Override + public void onNetconfSessionStart(NetconfSessionStart notification) { + log.info("onNetconfSessionStart {} ", notification); + this.notificationServiceService.sendNotification(notification, this.netconfAccessor.getNodeId(), + NetconfSessionStart.QNAME, NetconfTimeStampImpl.getConverter().getTimeStamp()); + + } + + @Override + public void onNetconfSessionEnd(NetconfSessionEnd notification) { + log.info("onNetconfSessionEnd {}", notification); + this.notificationServiceService.sendNotification(notification, this.netconfAccessor.getNodeId(), + NetconfSessionEnd.QNAME, NetconfTimeStampImpl.getConverter().getTimeStamp()); + } + + @Override + public void onNetconfCapabilityChange(NetconfCapabilityChange notification) { + log.info("onNetconfCapabilityChange {}", notification); + this.notificationServiceService.sendNotification(notification, this.netconfAccessor.getNodeId(), + NetconfCapabilityChange.QNAME, NetconfTimeStampImpl.getConverter().getTimeStamp()); + } + + @Override + public void onNetconfConfigChange(NetconfConfigChange notification) { + log.info("onNetconfConfigChange (1) {}", notification); + StringBuffer sb = new StringBuffer(); + List editList = notification.nonnullEdit(); + for (Edit edit : editList) { + if (sb.length() > 0) { + sb.append(", "); + } + sb.append(edit); + + EventlogBuilder eventlogBuilder = new EventlogBuilder(); + + InstanceIdentifier target = edit.getTarget(); + if (target != null) { + eventlogBuilder.setObjectId(target.toString()); + log.info("TARGET: {} {}", target.getClass(), target.getTargetType()); + for (PathArgument pa : target.getPathArguments()) { + log.info("PathArgument {}", pa); + } + } + eventlogBuilder.setNodeId(netconfAccessor.getNodeId().getValue()); + eventlogBuilder.setNewValue(String.valueOf(edit.getOperation())); + databaseService.writeEventLog(eventlogBuilder.build()); + } + log.info("onNetconfConfigChange (2) {}", sb); + this.notificationServiceService.sendNotification(notification, this.netconfAccessor.getNodeId(), + NetconfConfigChange.QNAME, NetconfTimeStampImpl.getConverter().getTimeStamp()); + + } + + // end of public methods + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmDeviceChangeNotificationListener.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmDeviceChangeNotificationListener.java new file mode 100644 index 000000000..3263e1de2 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmDeviceChangeNotificationListener.java @@ -0,0 +1,129 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.ChangeNotification; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.CreateTechInfoNotification; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OrgOpenroadmDeviceListener; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.OtdrScanResult; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.change.notification.Edit; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Shabnam Sultana + * + * Listener for Open roadm device specific change notifications + **/ + +public class OpenroadmDeviceChangeNotificationListener implements OrgOpenroadmDeviceListener { + // variables + private static final Logger log = LoggerFactory.getLogger(OpenroadmDeviceChangeNotificationListener.class); + private Integer counter = 1; + private final NetconfAccessor netconfAccessor; + private final DataProvider databaseProvider; + private final WebsocketManagerService notificationServiceService; + private static final NetconfTimeStamp ncTimeConverter = NetconfTimeStampImpl.getConverter(); + // end of variables + + // constructors + public OpenroadmDeviceChangeNotificationListener(NetconfAccessor netconfAccessor, DataProvider databaseService, + WebsocketManagerService faultService) { + this.netconfAccessor = netconfAccessor; + this.databaseProvider = databaseService; + this.notificationServiceService = faultService; + } + // end of constructors + + // public methods + @Override + public void onOtdrScanResult(OtdrScanResult notification) { + // TODO Auto-generated method stub + + } + + @Override + public void onChangeNotification(ChangeNotification notification) { + log.info("onDeviceConfigChange(1){}", notification); + StringBuffer sb = new StringBuffer(); + + @NonNull + List editList = notification.nonnullEdit(); + for (Edit edit : editList) { + if (sb.length() > 0) { + sb.append(", "); + } + sb.append(edit); + EventlogBuilder eventlogBuilder = new EventlogBuilder(); + InstanceIdentifier target = edit.getTarget(); + if (target != null) { + eventlogBuilder.setObjectId(target.getPathArguments().toString()); + log.info("TARGET: {} {}", target.getClass(), target.getTargetType()); + for (PathArgument pa : target.getPathArguments()) { + log.info("PathArgument {}", pa); + } + eventlogBuilder.setAttributeName(target.getTargetType().getName()); + } + eventlogBuilder.setNodeId(netconfAccessor.getNodeId().getValue()); + eventlogBuilder.setNewValue(String.valueOf(edit.getOperation())); + eventlogBuilder.setTimestamp(notification.getChangeTime()); + eventlogBuilder.setCounter(counter); + eventlogBuilder.setSourceType(SourceType.Netconf); + databaseProvider.writeEventLog(eventlogBuilder.build()); + log.info("onDeviceConfigChange (2) {}", sb); + counter++; + } + this.notificationServiceService.sendNotification(notification, this.netconfAccessor.getNodeId(), + ChangeNotification.QNAME, notification.getChangeTime()); + } + + @Override + public void onCreateTechInfoNotification(CreateTechInfoNotification notification) { + + DateAndTime now = NetconfTimeStampImpl.getConverter().getTimeStamp(); + log.info("onCreateTechInfoNotification(1){}", notification); + EventlogBuilder eventlogBuilder = new EventlogBuilder(); + eventlogBuilder.setId(notification.getShelfId()).setAttributeName(notification.getShelfId()) + .setObjectId(notification.getShelfId()).setNodeId(this.netconfAccessor.getNodeId().getValue()) + .setCounter(counter).setNewValue(notification.getStatus().getName()).setSourceType(SourceType.Netconf) + .setTimestamp(now); + databaseProvider.writeEventLog(eventlogBuilder.build()); + this.notificationServiceService.sendNotification(notification, this.netconfAccessor.getNodeId(), + CreateTechInfoNotification.QNAME, now); + log.info("Create-techInfo Notification written "); + counter++; + } + // end of public methods + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmFaultNotificationListener.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmFaultNotificationListener.java new file mode 100644 index 000000000..7a1116515 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmFaultNotificationListener.java @@ -0,0 +1,159 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + + +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.AlarmNotification; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.OrgOpenroadmAlarmListener; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.alarm.ProbableCause; +import org.opendaylight.yang.gen.v1.http.org.openroadm.probablecause.rev200529.ProbableCauseEnum; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.Resource; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.CircuitPack; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Connection; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Degree; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Device; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Interface; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.InternalLink; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.LineAmplifier; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.OduSncpPg; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Other; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.PhysicalLink; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Port; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Service; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Shelf; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Srg; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.TempService; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.VersionedService; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.Xponder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Shabnam Sultana + * + * Listener for Open roadm device specific alarm notifications + **/ +public class OpenroadmFaultNotificationListener implements OrgOpenroadmAlarmListener { + private static final Logger log = LoggerFactory.getLogger(OpenroadmFaultNotificationListener.class); + + private final @NonNull FaultService faultEventListener; + private @NonNull WebsocketManagerService notificationService; + private Integer count = 1; + + private NetconfBindingAccessor netconfAccessor; + + + public OpenroadmFaultNotificationListener(NetconfBindingAccessor accessor, DeviceManagerServiceProvider serviceProvider) { + this.netconfAccessor = accessor; + this.faultEventListener = serviceProvider.getFaultService(); + this.notificationService = serviceProvider.getWebsocketService(); + + } + + @Override + public void onAlarmNotification(AlarmNotification notification) { + log.info("AlarmNotification is {} \t {}", notification.getId(), notification.getAdditionalDetail()); + String affectedResourceName = getAffectedResourceName(notification.getResource().getResource().getResource()); + String probableCauseName = getProbableCauseName(notification.getProbableCause()); + + if (notification.getId() == null) { + log.warn("Alarm ID is null. Not logging alarm information to the DB. Alarm ID should not be null. Please fix the same in the Device"); + return; + } + FaultlogEntity faultAlarm = new FaultlogBuilder().setObjectId(affectedResourceName) + .setProblem(probableCauseName).setSourceType(SourceType.Netconf) + .setTimestamp(notification.getRaiseTime()).setId(notification.getId()).setNodeId(netconfAccessor.getNodeId().getValue()) + .setSeverity(InitialDeviceAlarmReader.checkSeverityValue(notification.getSeverity())).setCounter(count) + .build(); + + this.faultEventListener.faultNotification(faultAlarm); + this.notificationService.sendNotification(notification,new NodeId(netconfAccessor.getNodeId().getValue()), AlarmNotification.QNAME, + notification.getRaiseTime()); + count++; + log.info("Notification is written into the database {}", faultAlarm.getObjectId()); + + } + + public String getAffectedResourceName(Resource affectedResource) { + if (affectedResource instanceof CircuitPack) { + return ((CircuitPack)affectedResource).getCircuitPackName(); + } else if (affectedResource instanceof Port) { + return ((Port)affectedResource).getPort().getPortName(); + } else if (affectedResource instanceof Connection) { + return ((Connection)affectedResource).getConnectionName(); + } else if (affectedResource instanceof PhysicalLink) { + return ((PhysicalLink)affectedResource).getPhysicalLinkName(); + } else if (affectedResource instanceof InternalLink) { + return ((InternalLink)affectedResource).getInternalLinkName(); + } else if (affectedResource instanceof Shelf) { + return ((Shelf)affectedResource).getShelfName(); + } else if (affectedResource instanceof Srg) { + return "SRG #- " + ((Srg)affectedResource).getSrgNumber().toString(); + } else if (affectedResource instanceof Degree) { + return "Degree - " + ((Degree)affectedResource).getDegreeNumber().toString(); + } else if (affectedResource instanceof Service) { + return ((Service)affectedResource).getServiceName(); + } else if (affectedResource instanceof Interface) { + return ((Interface)affectedResource).getInterfaceName(); + } else if (affectedResource instanceof OduSncpPg) { + return ((OduSncpPg)affectedResource).getOduSncpPgName(); + } else if (affectedResource instanceof Device) { + return ((Device)affectedResource).getNodeId().getValue(); + } else if (affectedResource instanceof LineAmplifier) { + return "LineAmplifier # - " + ((LineAmplifier)affectedResource).getAmpNumber().toString(); + } else if (affectedResource instanceof Xponder) { + return "Xponder # - "+ ((Xponder)affectedResource).getXpdrNumber().toString(); + } else if (affectedResource instanceof Other) { + return ((Other)affectedResource).getOtherResourceId(); + } else if (affectedResource instanceof VersionedService) { + return ((VersionedService)affectedResource).getVersionedServiceName(); + } else if (affectedResource instanceof TempService) { + return ((TempService)affectedResource).getCommonId(); + } + + log.warn("Unknown Resource {} received from Notification", affectedResource.getClass().getSimpleName()); + return "Unknown Resource"; + } + + public String getProbableCauseName(ProbableCause probableCause) { + if (probableCause != null) { + ProbableCauseEnum pce = probableCause.getCause(); + if (pce != null) { + return pce.getName(); + } + log.warn("ProbableCauseEnum is NULL"); + return "Unknown Cause"; + } + log.warn("ProbableCause is NULL"); + return "Unknown Cause"; + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmInventoryInput.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmInventoryInput.java new file mode 100644 index 000000000..1f6cfd658 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmInventoryInput.java @@ -0,0 +1,151 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Info; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.InventoryBuilder; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Shabnam Sultana + * + * Reading the inventory data of an open roadm device + * + **/ +public class OpenroadmInventoryInput { + // variable + private static final Logger log = LoggerFactory.getLogger(OpenroadmInventoryInput.class); + private static final String NOT_AVAILABLE = "N/A"; + private OrgOpenroadmDevice openRoadmDevice; + private final NetconfAccessor accessor; + // end of variables + + // constructors + public OpenroadmInventoryInput(NetconfAccessor netconfAccessor, OrgOpenroadmDevice roadmDevice) { + this.openRoadmDevice = roadmDevice; + this.accessor = netconfAccessor; + } + // end of constructors + + // public methods + public Inventory getInventoryData(Uint32 treeLevel) { + InventoryBuilder inventoryBuilder = new InventoryBuilder(); + log.info("Info for device {}", this.openRoadmDevice.getInfo().getNodeId().getValue()); + Info info = this.openRoadmDevice.getInfo(); + inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()) + .setUuid(info.getNodeId() == null ? NOT_AVAILABLE : info.getNodeId().getValue()) + .setDate(info.getCurrentDatetime() != null ? info.getCurrentDatetime().getValue() : null) + .setId(info.getNodeId().getValue()).setManufacturerIdentifier(info.getVendor()) + .setModelIdentifier(info.getModel()).setSerial(info.getSerialId()).setTreeLevel(treeLevel) + .setVersion(info.getOpenroadmVersion() != null ? info.getOpenroadmVersion().getName() : null) + .setDescription("org-openroadm-device").setParentUuid("None").setTypeName(info.getNodeType().getName()) + .setPartTypeId("device"); + log.info("Inventory data written for device {}", this.openRoadmDevice.getInfo().getNodeId().getValue()); + return inventoryBuilder.build(); + } + + public Inventory getShelvesInventory(Shelves shelf, Uint32 treeLevel) { + InventoryBuilder inventoryBuilder = new InventoryBuilder(); + inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setId(shelf.getShelfName()) + .setDescription((shelf.getUserDescription() == null) + ? ("Position: " + shelf.getShelfPosition() + "\nState: " + shelf.getOperationalState()) + : (shelf.getUserDescription()) + "\nPosition: " + shelf.getShelfPosition() + "\nState: " + + shelf.getOperationalState()) + .setSerial(shelf.getSerialId()).setUuid(shelf.getShelfName()) + .setParentUuid(this.openRoadmDevice.getInfo().getNodeId().getValue()).setTreeLevel(treeLevel) + .setTypeName(shelf.getShelfType()).setPartTypeId(shelf.getClei()) + .setManufacturerIdentifier(shelf.getVendor()).setModelIdentifier(shelf.getModel()) + .setVersion(shelf.getHardwareVersion()) + .setDate(shelf.getManufactureDate() != null ? shelf.getManufactureDate().getValue() : NOT_AVAILABLE); + log.info("Inventory data written for Shelf {}", shelf.getShelfName()); + return inventoryBuilder.build(); + } + + public Inventory getInterfacesInventory(Interface deviceInterface, Uint32 treeLevel) { + InventoryBuilder inventoryBuilder = new InventoryBuilder(); + inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setId(deviceInterface.getName()) + .setDescription( + (deviceInterface.getDescription() == null) ? NOT_AVAILABLE : deviceInterface.getDescription()) + .setUuid(deviceInterface.getName()).setSerial(deviceInterface.getName()) + .setParentUuid((deviceInterface.getSupportingCircuitPackName() != null) + ? deviceInterface.getSupportingCircuitPackName() + // : ((deviceInterface.getSupportingInterface() != null) ? deviceInterface.getSupportingInterface() + : this.openRoadmDevice.getInfo().getNodeId().getValue()) + .setTreeLevel(treeLevel) + .setTypeName((deviceInterface.getType() == null) ? "Interface" + : deviceInterface.getType().getName().substring(69, + deviceInterface.getType().getName().length())) + .setPartTypeId("Interface").setManufacturerIdentifier(this.openRoadmDevice.getInfo().getVendor()) + .setModelIdentifier(this.openRoadmDevice.getInfo().getModel()).setVersion("N/A") + .setDate(this.openRoadmDevice.getInfo().getCurrentDatetime().getValue()); + log.info("Inventory data written for Interface {}", deviceInterface.getName()); + + return inventoryBuilder.build(); + } + + public Inventory getCircuitPackInventory(CircuitPacks circuitPack, Uint32 treeLevel) { + InventoryBuilder inventoryBuilder = new InventoryBuilder(); + inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setUuid(circuitPack.getCircuitPackName()) + .setDate((circuitPack.getManufactureDate() == null) ? NOT_AVAILABLE + : circuitPack.getManufactureDate().getValue().substring(0, 19)) + .setId(circuitPack.getCircuitPackName()).setManufacturerIdentifier(circuitPack.getVendor()) + .setModelIdentifier(circuitPack.getModel()).setSerial(circuitPack.getSerialId()).setTreeLevel(treeLevel) + .setVersion(circuitPack.getHardwareVersion()) + .setDescription("ProductCode: " + circuitPack.getProductCode() + " " + "Mode: " + + circuitPack.getCircuitPackMode()) + .setTypeName((circuitPack.getType() == null) ? circuitPack.getCircuitPackType() : circuitPack.getType()) + .setPartTypeId((circuitPack.getClei() == null) ? circuitPack.getType() : circuitPack.getClei()) + .setParentUuid((circuitPack.getParentCircuitPack() != null) + ? circuitPack.getParentCircuitPack().getCircuitPackName() + : ((circuitPack.getShelf() != null) ? circuitPack.getShelf() + : this.openRoadmDevice.getInfo().getNodeId().getValue())); + log.info("Inventory data written for CircuitPack {}", circuitPack.getCircuitPackName()); + + return inventoryBuilder.build(); + } + + public Inventory getXponderInventory(Xponder xpdr, Uint32 treeLevel) { + InventoryBuilder inventoryBuilder = new InventoryBuilder(); + inventoryBuilder.setNodeId(this.accessor.getNodeId().getValue()).setId(xpdr.getXpdrNumber().toString()) + .setDescription("Xponder\nLifecycleState: " + xpdr.getLifecycleState().getName()) + .setUuid(xpdr.getXpdrNumber().toString()).setSerial(xpdr.getXpdrNumber().toString()) + .setParentUuid(this.openRoadmDevice.getInfo().getNodeId().getValue()).setTreeLevel(treeLevel) + .setTypeName(xpdr.getXpdrType().getName()).setPartTypeId(xpdr.getXpdrType().getName()) + .setManufacturerIdentifier(this.openRoadmDevice.getInfo().getVendor()) + .setModelIdentifier(this.openRoadmDevice.getInfo().getModel()) + .setVersion(this.openRoadmDevice.getInfo().getOpenroadmVersion().getName()) + .setDate(this.openRoadmDevice.getInfo().getCurrentDatetime().getValue()); + log.info("Inventory data written for Xponder{}", xpdr.getXpdrNumber()); + + return inventoryBuilder.build(); + } + // end of public methods +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElement.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElement.java new file mode 100644 index 000000000..87fd14b72 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElement.java @@ -0,0 +1,329 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Hashtable; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelf.Slots; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.xponder.XpdrPort; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.NotificationListener; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Shabnam Sultana + * + * Creating the openroadm device as an optical network element and writing inventory, fault, pm data to elastic + * search db + * + **/ +public class OpenroadmNetworkElement extends OpenroadmNetworkElementBase { + + // variables + private final long EQUIPMENTLEVEL_BASE = 1; + private static final Logger LOG = LoggerFactory.getLogger(OpenroadmNetworkElement.class); + private Hashtable circuitPacksRecord; + private Hashtable shelfProvisionedcircuitPacks; + private ListenerRegistration openRdmListenerRegistrationResult; + private @NonNull final OpenroadmChangeNotificationListener openRdmListener; + private ListenerRegistration opnRdmFaultListenerRegistrationResult; + private @NonNull OpenroadmFaultNotificationListener opnRdmFaultListener; + private ListenerRegistration opnRdmDeviceListenerRegistrationResult; + private OpenroadmDeviceChangeNotificationListener opnRdmDeviceListener; + private OpenroadmInventoryInput opnRdmInventoryInput; + private PmDataBuilderOpenRoadm openRoadmPmData; + private InitialDeviceAlarmReader initialAlarmReader; + + private static final NetconfTimeStamp ncTimeConverter = NetconfTimeStampImpl.getConverter(); + private int counter = 1; + // end of variables + + // constructors + public OpenroadmNetworkElement(NetconfBindingAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) { + + super(netconfAccess, serviceProvider); + + LOG.info("Create {}", OpenroadmNetworkElement.class.getSimpleName()); + this.openRdmListenerRegistrationResult = null; + this.openRdmListener = new OpenroadmChangeNotificationListener(netconfAccessor, databaseService, + serviceProvider.getWebsocketService()); + this.opnRdmFaultListenerRegistrationResult = null; + this.opnRdmFaultListener = new OpenroadmFaultNotificationListener(netconfAccessor, serviceProvider); + this.opnRdmDeviceListenerRegistrationResult = null; + this.opnRdmDeviceListener = new OpenroadmDeviceChangeNotificationListener(netconfAccessor, databaseService, + serviceProvider.getWebsocketService()); + this.circuitPacksRecord = new Hashtable<>(); + this.shelfProvisionedcircuitPacks = new Hashtable<>(); + this.openRoadmPmData = new PmDataBuilderOpenRoadm(this.netconfAccessor); + this.initialAlarmReader = new InitialDeviceAlarmReader(this.netconfAccessor, serviceProvider); + LOG.info("NodeId {}", this.netconfAccessor.getNodeId().getValue()); + + + } + // end of constructors + + // public methods + public void initialReadFromNetworkElement() { + + OrgOpenroadmDevice device = readDevice(this.netconfAccessor); + this.opnRdmInventoryInput = new OpenroadmInventoryInput(this.netconfAccessor, device); + LOG.info("openroadmMapper details{}", this.opnRdmInventoryInput.getClass().getName()); + List inventoryList = new ArrayList<>(); + inventoryList.add(this.opnRdmInventoryInput.getInventoryData(Uint32.valueOf(EQUIPMENTLEVEL_BASE))); + readShelvesData(inventoryList, device); + readXpndrData(inventoryList, device); + readCircuitPacketData(inventoryList, device); + readInterfaceData(inventoryList, device); + this.databaseService.writeInventory(this.netconfAccessor.getNodeId().getValue(), inventoryList); + // Writing initial alarms at the time of device registration + initialAlarmReader.faultService(); + // Writing historical PM data at the time of device registration + List pmDataEntity = new ArrayList<>(); + pmDataEntity = this.openRoadmPmData.buildPmDataEntity(this.openRoadmPmData.getPmData(this.netconfAccessor)); + if (!pmDataEntity.isEmpty()) { + this.databaseService.doWritePerformanceData(pmDataEntity); + LOG.info("PmDatEntity is written with size {}", pmDataEntity.size()); + for (PmdataEntity ent : pmDataEntity) { + LOG.info("GetNode: {}, granPeriod: {}", ent.getNodeName(), ent.getGranularityPeriod().getName()); + } + } else { + LOG.info("PmDatEntity is empty"); + } + } + + + @Override + public void register() { + initialReadFromNetworkElement(); + + this.openRdmListenerRegistrationResult = netconfAccessor.doRegisterNotificationListener(openRdmListener); + this.opnRdmFaultListenerRegistrationResult = + netconfAccessor.doRegisterNotificationListener(opnRdmFaultListener); + this.opnRdmDeviceListenerRegistrationResult = + netconfAccessor.doRegisterNotificationListener(opnRdmDeviceListener); + if (netconfAccessor.isNotificationsRFC5277Supported()) { + // Register netconf stream + netconfAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream); + } + else { + LOG.info("device {} does not support netconf notification", netconfAccessor.getNodeId().getValue()); + } + } + + @Override + public void deregister() { + if (openRdmListenerRegistrationResult != null) { + this.openRdmListenerRegistrationResult.close(); + } + if (opnRdmFaultListenerRegistrationResult != null) { + this.opnRdmFaultListenerRegistrationResult.close(); + } + if (opnRdmDeviceListenerRegistrationResult != null) { + this.opnRdmDeviceListenerRegistrationResult.close(); + } + } + + // end of public methods + + // private methods + private void readShelvesData(List inventoryList, OrgOpenroadmDevice device) { + Collection shelves = YangHelper.getCollection(device.getShelves()); + if (shelves != null) { + for (Shelves shelf : shelves) { + LOG.info( + "Shelf Name: {}, \n Serial Id:{}, \n Product Code;{}, \n Position:{}, \n EquipmetState: {}, \n Hardware version: {}" + + "\n ShelfType:{}, \n Vendor: {}, \n LifecycleState: {} ", + shelf.getShelfName(), shelf.getSerialId(), shelf.getProductCode(), shelf.getShelfPosition(), + shelf.getEquipmentState(), shelf.getHardwareVersion(), shelf.getShelfType(), shelf.getVendor(), + shelf.getLifecycleState()); + inventoryList.add( + this.opnRdmInventoryInput.getShelvesInventory(shelf, Uint32.valueOf(EQUIPMENTLEVEL_BASE + 1))); + Collection slotList = YangHelper.getCollection(shelf.getSlots()); + if (slotList != null) { + for (Slots slot : slotList) { + if (slot.getProvisionedCircuitPack() != null) { + this.shelfProvisionedcircuitPacks.put(slot.getProvisionedCircuitPack(), + EQUIPMENTLEVEL_BASE + 2); + } + LOG.info("Slots for the shelf: {}", shelf.getShelfName()); + LOG.info("\n Slot Name: {}, \n Status: {}, \n Slot label: {} ", slot.getSlotName(), + slot.getSlotStatus(), slot.getLabel()); + } + } + } + LOG.info("size of shelfProvisionedcircuitPacks: {} ", shelfProvisionedcircuitPacks.size()); + } + + } + + private void readXpndrData(List inventoryList, OrgOpenroadmDevice device) { + Collection xponderList = YangHelper.getCollection(device.getXponder()); + + if (xponderList != null) { + for (Xponder xponder : xponderList) { + + inventoryList.add(this.opnRdmInventoryInput.getXponderInventory(xponder, + Uint32.valueOf(EQUIPMENTLEVEL_BASE + 1))); + LOG.info("Xponders: No.: {} , \n Port: {} ,\n Type: {}", xponder.getXpdrNumber(), xponder.getXpdrPort(), + xponder.getXpdrType()); + Collection xpdrportlist = YangHelper.getCollection(xponder.getXpdrPort()); + if (xpdrportlist != null) { + for (XpdrPort xpdrport : xpdrportlist) + if (xpdrport.getCircuitPackName() != null) { + this.shelfProvisionedcircuitPacks.put(xpdrport.getCircuitPackName(), + EQUIPMENTLEVEL_BASE + 2); + LOG.info("Size of dict{}", this.shelfProvisionedcircuitPacks.size()); + } + } + + } + } + } + + private void readCircuitPacketData(List inventoryList, OrgOpenroadmDevice device) { + Collection circuitpackCollection = YangHelper.getCollection(device.getCircuitPacks()); + List cpNameList = new ArrayList<>(); + + if (circuitpackCollection != null) { + // collect all circuit pack names. Required to check for invalid parents later on + for (CircuitPacks cp : circuitpackCollection) { + cpNameList.add(cp.getCircuitPackName()); + } + + for (CircuitPacks cp : circuitpackCollection) { + LOG.info("CP Name:{}", cp.getCircuitPackName()); + + if (cp.getParentCircuitPack() == null + && !this.shelfProvisionedcircuitPacks.containsKey(cp.getCircuitPackName())) { + LOG.info("cp has no parent and no shelf"); + this.circuitPacksRecord.put(cp.getCircuitPackName(), (EQUIPMENTLEVEL_BASE + 1)); + inventoryList.add(this.opnRdmInventoryInput.getCircuitPackInventory(cp, + Uint32.valueOf(EQUIPMENTLEVEL_BASE + 1))); + } else { + // check for missing valid parent circuit name + if (cp.getParentCircuitPack().getCpSlotName() != null + && cp.getParentCircuitPack().getCircuitPackName() == null) { + + LOG.info("Cp {} has slotname of the parent circuit pack but no parent circuit pack name", + cp.getCircuitPackName()); + this.circuitPacksRecord.put(cp.getCircuitPackName(), (EQUIPMENTLEVEL_BASE + 3)); + inventoryList.add(this.opnRdmInventoryInput.getCircuitPackInventory(cp, + Uint32.valueOf(EQUIPMENTLEVEL_BASE + 3))); + databaseService.writeEventLog(writeIncorrectParentLog(cp.getCircuitPackName(), counter) + .setObjectId(device.getInfo().getNodeId().getValue()) + .setId(cp.getParentCircuitPack().getCpSlotName()) + .setNewValue("Missing parent circuit pack name").build()); + } else if (cp.getParentCircuitPack().getCircuitPackName() != null + && this.shelfProvisionedcircuitPacks + .containsKey(cp.getParentCircuitPack().getCircuitPackName())) { + LOG.info("Cp {} has parent circuit pack and shelf", cp.getCircuitPackName()); + this.circuitPacksRecord.put(cp.getCircuitPackName(), (EQUIPMENTLEVEL_BASE + 3)); + inventoryList.add(this.opnRdmInventoryInput.getCircuitPackInventory(cp, + Uint32.valueOf(EQUIPMENTLEVEL_BASE + 3))); + } else { + // check for incorrect hierarchy + if (cp.getParentCircuitPack().getCircuitPackName() != null + && !cpNameList.contains(cp.getParentCircuitPack().getCircuitPackName())) { + databaseService.writeEventLog(writeIncorrectParentLog(cp.getCircuitPackName(), counter) + .setObjectId(device.getInfo().getNodeId().getValue()) + .setId(cp.getParentCircuitPack().getCpSlotName()).build()); + } + + LOG.info("Cp has parent circuit pack but no shelf or a shelf but no parent circuit pack"); + this.circuitPacksRecord.put(cp.getCircuitPackName(), (EQUIPMENTLEVEL_BASE + 2)); + inventoryList.add(this.opnRdmInventoryInput.getCircuitPackInventory(cp, + Uint32.valueOf(EQUIPMENTLEVEL_BASE + 2))); + } + + } + } + + } + } + + private void readInterfaceData(List inventoryList, OrgOpenroadmDevice device) { + Collection interfaceList = YangHelper.getCollection(device.getInterface()); + if (interfaceList != null) { + for (Interface deviceInterface : interfaceList) { + LOG.info("\n InterfaceName: {}", deviceInterface.getName()); + LOG.info("Supporting CP {}", this.circuitPacksRecord.size()); + for (String s : this.circuitPacksRecord.keySet()) { + LOG.info("{} value {}", s, this.circuitPacksRecord.get(s)); + } + LOG.info("Interface {} and their supporting CP {}", deviceInterface.getName(), + deviceInterface.getSupportingCircuitPackName()); + if (deviceInterface.getSupportingCircuitPackName() != null) { + if (this.circuitPacksRecord.containsKey(deviceInterface.getSupportingCircuitPackName())) { + inventoryList.add(this.opnRdmInventoryInput.getInterfacesInventory(deviceInterface, + Uint32.valueOf( + this.circuitPacksRecord.get(deviceInterface.getSupportingCircuitPackName()) + + 1))); + } + } else { + inventoryList.add(this.opnRdmInventoryInput.getInterfacesInventory(deviceInterface, + Uint32.valueOf(EQUIPMENTLEVEL_BASE + 1))); + } + } + } + } + + private OrgOpenroadmDevice readDevice(NetconfBindingAccessor accessor) { + InstanceIdentifier deviceId = InstanceIdentifier.create(OrgOpenroadmDevice.class); + return accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + deviceId); + } + + private EventlogBuilder writeIncorrectParentLog(String attributeName, Integer counter) { + EventlogBuilder eventlogBuilder = new EventlogBuilder(); + eventlogBuilder.setAttributeName(attributeName).setCounter(counter) + .setNodeId(this.netconfAccessor.getNodeId().getValue()).setSourceType(SourceType.Netconf) + .setNewValue("Invalid parent circuit-pack name") + .setTimestamp(new DateAndTime(ncTimeConverter.getTimeStamp())); + + return eventlogBuilder; + + } + // end of private methods +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementBase.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementBase.java new file mode 100644 index 000000000..4da2145fb --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementBase.java @@ -0,0 +1,74 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import java.util.Optional; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; + +public class OpenroadmNetworkElementBase implements NetworkElement { + + protected final NetconfBindingAccessor netconfAccessor; + protected final DataProvider databaseService; + + public OpenroadmNetworkElementBase(NetconfBindingAccessor netconfAccess, + DeviceManagerServiceProvider serviceProvider) { + + this.netconfAccessor = netconfAccess; + this.databaseService = serviceProvider.getDataProvider(); + } + + @Override + public void register() {} + + @Override + public void deregister() {} + + @Override + public void warmstart() {} + + @Override + public NodeId getNodeId() { + return netconfAccessor.getNodeId(); + } + + @Override + public NetworkElementDeviceType getDeviceType() { + return NetworkElementDeviceType.OROADM; + } + + @Override + public Optional getService(Class clazz) { + return Optional.empty(); + } + + @Override + public Optional getAcessor() { + return Optional.of(netconfAccessor); + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementFactory.java new file mode 100644 index 000000000..552058fd8 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/OpenroadmNetworkElementFactory.java @@ -0,0 +1,64 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ + +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import java.util.Optional; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.NetworkElementFactory; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Shabnam Sultana + * + * Register the openroadm device as an optical network element + * + **/ + +public class OpenroadmNetworkElementFactory implements NetworkElementFactory { + + // variables + private static final Logger log = LoggerFactory.getLogger(OpenroadmNetworkElementFactory.class); + // end of variables + + // public methods + @Override + public Optional create(NetconfAccessor accessor, DeviceManagerServiceProvider serviceProvider) { + + if (accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)) { + log.info("Create OpenRoadm device {} ", OpenroadmNetworkElement.class.getName()); + log.info("Node Id read by Acessor {}:", accessor.getNodeId().getValue()); + Optional bindingAccessor = accessor.getNetconfBindingAccessor(); + if (bindingAccessor.isPresent()) { + return Optional.of(new OpenroadmNetworkElement(bindingAccessor.get(), serviceProvider)); + } + } + return Optional.empty(); + } + // end of public methods + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/PmDataBuilderOpenRoadm.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/PmDataBuilderOpenRoadm.java new file mode 100644 index 000000000..658c507cd --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm71/impl/PmDataBuilderOpenRoadm.java @@ -0,0 +1,300 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl; + +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.HistoricalPmList; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPm; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.list.HistoricalPmEntry; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.val.group.Measurement; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmDataType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmGranularity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmNamesEnum; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.g836.pm.types.rev200413.ErroredSecond; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.g836.pm.types.rev200413.SeverelyErroredSecond; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413.PerformanceMeasurementTypeId; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GranularityPeriodType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntityBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.entity.PerformanceDataBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.MeasurementBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.MeasurementKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.Celsius; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.DB; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.DBm; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.Fahrenheit; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.KHz; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.MW; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.PerformanceMeasurementUnitId; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author shabnam + * + * Reading Openroadm PM data and returning as PmDataEntitiy data + */ +public class PmDataBuilderOpenRoadm { + // variables + private static final Logger log = LoggerFactory.getLogger(PmDataBuilderOpenRoadm.class); + private PmdataEntityBuilder pmDataBuilder; + private Bundle b = FrameworkUtil.getBundle(this.getClass()); + + // end of variables + // constructors + public PmDataBuilderOpenRoadm(NetconfBindingAccessor accessor) { + this.pmDataBuilder = new PmdataEntityBuilder(); + this.pmDataBuilder.setNodeName(accessor.getNodeId().getValue()); + } + + // end of constructors + // public methods + // Read PM data + public HistoricalPmList getPmData(NetconfBindingAccessor accessor) { + final Class pmDataClass = HistoricalPmList.class; + log.info("Get PM data for element {}", accessor.getNodeId().getValue()); + InstanceIdentifier pmDataIid = InstanceIdentifier.builder(pmDataClass).build(); + return accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + pmDataIid); + + } + + // Build PM entity for writing into the database + public List buildPmDataEntity(HistoricalPmList historicalPmEnitityList) { + List pmEntitiyList = new ArrayList<>(); + if (historicalPmEnitityList == null) { + return pmEntitiyList; + } + Collection pmDataEntryList = + YangHelper.getCollection(historicalPmEnitityList.getHistoricalPmEntry()); + for (HistoricalPmEntry pmDataEntry : pmDataEntryList) { + pmDataBuilder.setUuidInterface(pmDataEntry.getPmResourceType().getName()); + Collection historicalPmList = YangHelper.getCollection(pmDataEntry.getHistoricalPm()); + for (HistoricalPm historicalPm : historicalPmList) { + log.info("PmName:{}", historicalPm.getType()); + // pmDataBuilder.setPerformanceData(value) + + try { + writeperformanceData(historicalPm); + } catch (ClassNotFoundException e) { + log.info("No relevant data found"); + } + pmEntitiyList.add(this.pmDataBuilder.build()); + + log.info("PmListSize before db writing: {}", pmEntitiyList.size()); + } + log.info("PmListSize before db writing: {}", pmEntitiyList.size()); + } + return pmEntitiyList; + } + // end of public methods + + // private methods + private void writeperformanceData(HistoricalPm historicalPm) throws ClassNotFoundException { + Collection measurementList = YangHelper.getCollection(historicalPm.getMeasurement()); + Map measurementMap = + new HashMap<>(); + // Map Performance data of PmDataEntity with MeasurmentData-HistoricalPm + PerformanceDataBuilder performanceDataBuilder = new PerformanceDataBuilder(); + for (Measurement measurementData : measurementList) { + this.pmDataBuilder.setGranularityPeriod(mapGranularityPeriod(measurementData.getGranularity())) + .setTimeStamp(measurementData.getCompletionTime()); + if (measurementData.getValidity().getName().equals("suspect")) { + this.pmDataBuilder.setSuspectIntervalFlag(true); + } + measurementMap.put( + new MeasurementKey(measurementBuilder(historicalPm.getType(), measurementData.getPmParameterUnit(), + measurementData.getPmParameterValue()).getPmKey()), + measurementBuilder(historicalPm.getType(), measurementData.getPmParameterUnit(), + measurementData.getPmParameterValue())); + + + } + + pmDataBuilder.setPerformanceData(performanceDataBuilder.setMeasurement(measurementMap).build()); + } + + + + // Mapping Granularity period of PmDataEntity with PmGranularity of MeasurmentData-HistoricalPm + private GranularityPeriodType mapGranularityPeriod(PmGranularity pmGranularity) { + return this.mapGranularityPeriod(pmGranularity.getName()); + } + + private GranularityPeriodType mapGranularityPeriod(String pmGranularity) { + + GranularityPeriodType granPeriod = null; + switch (pmGranularity) { + case ("notApplicable"): + granPeriod = GranularityPeriodType.Unknown; + break; + case ("15min"): + granPeriod = GranularityPeriodType.Period15Min; + break; + case ("24Hour"): + granPeriod = GranularityPeriodType.Period24Hours; + break; + default: + granPeriod = GranularityPeriodType.Period15Min; + break; + } + return granPeriod; + } + + private List> setMeasurementTypeId() { + String packageName = + "org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.openroadm.pm.types.rev200413"; + String packageName1 = + "/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/data/provider/openroadm/pm/types/rev200413/"; + List> measTypeObjList = new ArrayList<>(); + URL root = Thread.currentThread().getContextClassLoader().getResource(packageName1); + + log.info("path for type package: {}", root); + + Enumeration results = getFileURL(b, packageName); + log.info("FOund Packages {}", results); + if (results != null) { + while (results.hasMoreElements()) { + URL path = results.nextElement(); + + Class cls1 = loadClass(b, path.getFile()); + + if (PerformanceMeasurementTypeId.class.isAssignableFrom(cls1)) { + measTypeObjList.add((Class) cls1); + + + } + if (cls1 != null) { + log.info("Class Added {}", cls1.getSimpleName()); + } + + } + + + } + + return measTypeObjList; + } + + private Class setMeasurementUnit(String unitName) { + Class measurementUnitClass = null; + switch (unitName) { + case ("celsius"): + measurementUnitClass = Celsius.class; + break; + case ("dB"): + measurementUnitClass = DB.class; + break; + case ("dBm"): + measurementUnitClass = DBm.class; + break; + case ("fahrenheit"): + measurementUnitClass = Fahrenheit.class; + break; + case ("kHz"): + measurementUnitClass = KHz.class; + break; + case ("mW"): + measurementUnitClass = MW.class; + break; + default: + break; + } + return measurementUnitClass; + } + + private org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.pmdata.grp.Measurement measurementBuilder( + PmNamesEnum pmType, String pmUnit, PmDataType pmDataType) { + + MeasurementBuilder measBuilder = new MeasurementBuilder(); + if (pmType.getName().equals("erroredSeconds")) { + measBuilder.setPmKey(ErroredSecond.class); + } else if (pmType.getName().equals("severelyErroredSeconds")) { + measBuilder.setPmKey(SeverelyErroredSecond.class); + } else { + for (Class obj : setMeasurementTypeId()) { + if (obj.toString().contains(pmType.name())) { + measBuilder.setPmKey(obj); + } + } + } + measBuilder.setPmUnit(setMeasurementUnit(pmUnit)); + measBuilder.setPmValue(new org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev191129.PmDataType( + pmDataType.getDecimal64())); + return measBuilder.build(); + + } + + private Class loadClass(Bundle bundle, String classFilePath) { + String className = classFilePath.replaceFirst("^/", "").replace('/', '.').replaceFirst(".class$", ""); + try { + return bundle.loadClass(className); + } catch (Exception e) { + log.info(String.format("Class [%s] could not be loaded. Message: [%s].", className, e.getMessage())); + } + return null; + } + + private static Enumeration getFileURL(Bundle b, String classPath) { + + BundleContext context = b == null ? null : b.getBundleContext(); + if (context == null) { + log.info("no bundle context available"); + return null; + } + Bundle[] bundles = context.getBundles(); + if (bundles == null || bundles.length <= 0) { + log.info("no bundles found"); + return null; + } + log.info("found {} bundles", bundles.length); + Enumeration resultUrl = null; + + for (Bundle bundle : bundles) { + resultUrl = bundle.findEntries("/" + classPath.replace(".", "/"), "*.class", false); + if (resultUrl != null) { + break; + + } + + } + + return resultUrl; + } + + + // end of private methods +} + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev200327/PmDataTypeBuilder.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev200327/PmDataTypeBuilder.java new file mode 100644 index 000000000..f470fb6ba --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/pm/types/rev200327/PmDataTypeBuilder.java @@ -0,0 +1,23 @@ +package org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327; +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"); + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml new file mode 100644 index 000000000..0813205d7 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/org/opendaylight/blueprint/impl-blueprint.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/version.properties b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/version.properties new file mode 100644 index 000000000..6638c04f9 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/resources/version.properties @@ -0,0 +1,24 @@ +# +# ============LICENSE_START======================================================= +# ONAP : ccsdk features +# ================================================================================ +# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END======================================================= +# +# + +# Properties filled in by maven during build process +version = ${project.version} +build = ${buildtime} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/iana-hardware.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/iana-hardware.yang new file mode 100755 index 000000000..52bcaf3a0 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/iana-hardware.yang @@ -0,0 +1,180 @@ +module iana-hardware { +yang-version 1.1; +namespace "urn:ietf:params:xml:ns:yang:iana-hardware"; +prefix ianahw; + +organization "IANA"; +contact + " Internet Assigned Numbers Authority + Postal: ICANN + 12025 Waterfront Drive, Suite 300 + Los Angeles, CA 90094-2536 + United States of America + Tel: +1 310 301 5800 + E-Mail: iana@iana.org>"; + +description + "IANA-defined identities for hardware class. + The latest revision of this YANG module can be obtained from + the IANA website. + Requests for new values should be made to IANA via + email (iana@iana.org). + Copyright (c) 2018 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + The initial version of this YANG module is part of RFC 8348; + see the RFC itself for full legal notices."; +reference + "https://www.iana.org/assignments/yang-parameters"; + +revision 2018-03-13 { + description + "Initial revision."; + reference + "RFC 8348: A YANG Data Model for Hardware Management"; +} + +/* + * Identities + */ + +identity hardware-class { + description + "This identity is the base for all hardware class + identifiers."; +} + +identity unknown { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is unknown + to the server."; +} + +identity chassis { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is an + overall container for networking equipment. Any class of + physical component, except a stack, may be contained within a + chassis; a chassis may only be contained within a stack."; +} + +identity backplane { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of device for aggregating and forwarding networking traffic, + such as a shared backplane in a modular ethernet switch. Note + that an implementation may model a backplane as a single + physical component, which is actually implemented as multiple + discrete physical components (within a chassis or stack)."; +} + +identity container { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is capable + of containing one or more removable physical entities, + possibly of different types. For example, each (empty or + full) slot in a chassis will be modeled as a container. Note + that all removable physical components should be modeled + within a container component, such as field-replaceable + modules, fans, or power supplies. Note that all known + containers should be modeled by the agent, including empty + containers."; +} + +identity power-supply { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is a + power-supplying component."; +} + +identity fan { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is a fan or + other heat-reduction component."; +} + +identity sensor { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of sensor, such as a temperature sensor within a router + chassis."; +} + +identity module { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of self-contained sub-system. If a module component is + removable, then it should be modeled within a container + component; otherwise, it should be modeled directly within + another physical component (e.g., a chassis or another + module)."; +} + +identity port { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of networking port capable of receiving and/or transmitting + networking traffic."; +} + +identity stack { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of super-container (possibly virtual) intended to group + together multiple chassis entities. A stack may be realized + by a virtual cable, a real interconnect cable attached to + multiple chassis, or multiple interconnect cables. A stack + should not be modeled within any other physical components, + but a stack may be contained within another stack. Only + chassis components should be contained within a stack."; +} + +identity cpu { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of central processing unit."; +} + +identity energy-object { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of energy object, i.e., it is a piece of equipment that is + part of or attached to a communications network that is + monitored, it is controlled, or it aids in the management of + another device for Energy Management."; +} + +identity battery { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of battery."; +} + +identity storage-drive { + base ianahw:hardware-class; + description + "This identity is applicable if the hardware class is some sort + of component with data storage capability as its main + functionality, e.g., hard disk drive (HDD), solid-state device + (SSD), solid-state hybrid drive (SSHD), object storage device + (OSD), or other."; +} +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-hardware.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-hardware.yang new file mode 100755 index 000000000..f444e26ee --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-hardware.yang @@ -0,0 +1,1141 @@ +module ietf-hardware { +yang-version 1.1; +namespace "urn:ietf:params:xml:ns:yang:ietf-hardware"; +prefix hw; + +import ietf-inet-types { + prefix inet; +} +import ietf-yang-types { + prefix yang; +} +import iana-hardware { + prefix ianahw; +} + +organization + "IETF NETMOD (Network Modeling) Working Group"; + +contact + "WG Web: + WG List: + Editor: Andy Bierman + + Editor: Martin Bjorklund + + Editor: Jie Dong + + Editor: Dan Romascanu + "; + +description + "This module contains a collection of YANG definitions for + managing hardware. + This data model is designed for the Network Management Datastore + Architecture (NMDA) defined in RFC 8342. + Copyright (c) 2018 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 8348; see + the RFC itself for full legal notices."; + +revision 2018-03-13 { + description + "Initial revision."; + reference + "RFC 8348: A YANG Data Model for Hardware Management"; +} + +/* + * Features + */ + +feature entity-mib { + description + "This feature indicates that the device implements + the ENTITY-MIB."; + reference + "RFC 6933: Entity MIB (Version 4)"; +} + +feature hardware-state { + description + "Indicates that ENTITY-STATE-MIB objects are supported"; + reference + "RFC 4268: Entity State MIB"; +} + +feature hardware-sensor { + description + "Indicates that ENTITY-SENSOR-MIB objects are supported"; + reference + "RFC 3433: Entity Sensor Management Information Base"; +} + +/* + * Typedefs + */ + +typedef admin-state { + type enumeration { + enum unknown { + value 1; + description + "The resource is unable to report administrative state."; + } + enum locked { + value 2; + description + "The resource is administratively prohibited from use."; + } + enum shutting-down { + value 3; + description + "The resource usage is administratively limited to current + instances of use."; + } + enum unlocked { + value 4; + description + "The resource is not administratively prohibited from + use."; + } + } + description + "Represents the various possible administrative states."; + reference + "RFC 4268: Entity State MIB - EntityAdminState"; +} + +typedef oper-state { + type enumeration { + enum unknown { + value 1; + description + "The resource is unable to report its operational state."; + } + enum disabled { + value 2; + description + "The resource is totally inoperable."; + } + enum enabled { + value 3; + + description + "The resource is partially or fully operable."; + } + enum testing { + value 4; + description + "The resource is currently being tested and cannot + therefore report whether or not it is operational."; + } + } + description + "Represents the possible values of operational states."; + reference + "RFC 4268: Entity State MIB - EntityOperState"; +} + +typedef usage-state { + type enumeration { + enum unknown { + value 1; + description + "The resource is unable to report usage state."; + } + enum idle { + value 2; + description + "The resource is servicing no users."; + } + enum active { + value 3; + description + "The resource is currently in use, and it has sufficient + spare capacity to provide for additional users."; + } + enum busy { + value 4; + description + "The resource is currently in use, but it currently has no + spare capacity to provide for additional users."; + } + } + description + "Represents the possible values of usage states."; + reference + "RFC 4268: Entity State MIB - EntityUsageState"; +} + +typedef alarm-state { + type bits { + bit unknown { + position 0; + description + "The resource is unable to report alarm state."; + } + bit under-repair { + position 1; + description + "The resource is currently being repaired, which, depending + on the implementation, may make the other values in this + bit string not meaningful."; + } + bit critical { + position 2; + description + "One or more critical alarms are active against the + resource."; + } + bit major { + position 3; + description + "One or more major alarms are active against the + resource."; + } + bit minor { + position 4; + description + "One or more minor alarms are active against the + resource."; + } + bit warning { + position 5; + description + "One or more warning alarms are active against the + resource."; + } + bit indeterminate { + position 6; + description + "One or more alarms of whose perceived severity cannot be + determined are active against this resource."; + } + } + description + "Represents the possible values of alarm states. An alarm is a + persistent indication of an error or warning condition. + When no bits of this attribute are set, then no active alarms + are known against this component and it is not under repair."; + reference + "RFC 4268: Entity State MIB - EntityAlarmStatus"; +} + +typedef standby-state { + type enumeration { + enum unknown { + value 1; + description + "The resource is unable to report standby state."; + } + enum hot-standby { + value 2; + description + "The resource is not providing service, but it will be + immediately able to take over the role of the resource to + be backed up, without the need for initialization + activity, and will contain the same information as the + resource to be backed up."; + } + enum cold-standby { + value 3; + description + "The resource is to back up another resource, but it will + not be immediately able to take over the role of a + resource to be backed up and will require some + initialization activity."; + } + enum providing-service { + value 4; + description + "The resource is providing service."; + } + } + description + "Represents the possible values of standby states."; + reference + "RFC 4268: Entity State MIB - EntityStandbyStatus"; +} + +typedef sensor-value-type { + type enumeration { + enum other { + value 1; + description + "A measure other than those listed below."; + } + enum unknown { + value 2; + description + "An unknown measurement or arbitrary, relative numbers"; + } + enum volts-AC { + value 3; + description + "A measure of electric potential (alternating current)."; + } + enum volts-DC { + value 4; + description + "A measure of electric potential (direct current)."; + } + enum amperes { + value 5; + description + "A measure of electric current."; + } + enum watts { + value 6; + description + "A measure of power."; + } + enum hertz { + value 7; + description + "A measure of frequency."; + } + enum celsius { + value 8; + description + "A measure of temperature."; + } + enum percent-RH { + value 9; + description + "A measure of percent relative humidity."; + } + enum rpm { + value 10; + description + "A measure of shaft revolutions per minute."; + } + enum cmm { + value 11; + description + "A measure of cubic meters per minute (airflow)."; + } + enum truth-value { + value 12; + description + "Value is one of 1 (true) or 2 (false)"; + } + } + description + "A node using this data type represents the sensor measurement + data type associated with a physical sensor value. The actual + data units are determined by examining a node of this type + together with the associated sensor-value-scale node. + A node of this type SHOULD be defined together with nodes of + type sensor-value-scale and type sensor-value-precision. + These three types are used to identify the semantics of a node + of type sensor-value."; + reference + "RFC 3433: Entity Sensor Management Information Base - + EntitySensorDataType"; +} + +typedef sensor-value-scale { + type enumeration { + enum yocto { + value 1; + description + "Data scaling factor of 10^-24."; + } + enum zepto { + value 2; + description + "Data scaling factor of 10^-21."; + } + enum atto { + value 3; + description + "Data scaling factor of 10^-18."; + } + enum femto { + value 4; + description + "Data scaling factor of 10^-15."; + } + enum pico { + value 5; + description + "Data scaling factor of 10^-12."; + } + enum nano { + value 6; + description + "Data scaling factor of 10^-9."; + } + enum micro { + value 7; + description + "Data scaling factor of 10^-6."; + } + enum milli { + value 8; + description + "Data scaling factor of 10^-3."; + } + enum units { + value 9; + description + "Data scaling factor of 10^0."; + } + enum kilo { + value 10; + description + "Data scaling factor of 10^3."; + } + enum mega { + value 11; + description + "Data scaling factor of 10^6."; + } + enum giga { + value 12; + description + "Data scaling factor of 10^9."; + } + enum tera { + value 13; + description + "Data scaling factor of 10^12."; + } + enum peta { + value 14; + description + "Data scaling factor of 10^15."; + } + enum exa { + value 15; + description + "Data scaling factor of 10^18."; + } + enum zetta { + value 16; + description + "Data scaling factor of 10^21."; + } + enum yotta { + value 17; + description + "Data scaling factor of 10^24."; + } + } + description + "A node using this data type represents a data scaling factor, + represented with an International System of Units (SI) prefix. + The actual data units are determined by examining a node of + this type together with the associated sensor-value-type. + A node of this type SHOULD be defined together with nodes of + type sensor-value-type and type sensor-value-precision. + Together, associated nodes of these three types are used to + identify the semantics of a node of type sensor-value."; + reference + "RFC 3433: Entity Sensor Management Information Base - + EntitySensorDataScale"; +} + +typedef sensor-value-precision { + type int8 { + range "-8 .. 9"; + } + description + "A node using this data type represents a sensor value + precision range. + A node of this type SHOULD be defined together with nodes of + type sensor-value-type and type sensor-value-scale. Together, + associated nodes of these three types are used to identify the + semantics of a node of type sensor-value. + If a node of this type contains a value in the range 1 to 9, + it represents the number of decimal places in the fractional + part of an associated sensor-value fixed-point number. + If a node of this type contains a value in the range -8 to -1, + it represents the number of accurate digits in the associated + sensor-value fixed-point number. + The value zero indicates the associated sensor-value node is + not a fixed-point number. + Server implementers must choose a value for the associated + sensor-value-precision node so that the precision and accuracy + of the associated sensor-value node is correctly indicated. + For example, a component representing a temperature sensor + that can measure 0 to 100 degrees C in 0.1 degree + increments, +/- 0.05 degrees, would have a + sensor-value-precision value of '1', a sensor-value-scale + value of 'units', and a sensor-value ranging from '0' to + '1000'. The sensor-value would be interpreted as + 'degrees C * 10'."; + reference + "RFC 3433: Entity Sensor Management Information Base - + EntitySensorPrecision"; +} + +typedef sensor-value { + type int32 { + range "-1000000000 .. 1000000000"; + } + description + "A node using this data type represents a sensor value. + A node of this type SHOULD be defined together with nodes of + type sensor-value-type, type sensor-value-scale, and + type sensor-value-precision. Together, associated nodes of + those three types are used to identify the semantics of a node + of this data type. + The semantics of a node using this data type are determined by + the value of the associated sensor-value-type node. + If the associated sensor-value-type node is equal to 'voltsAC', + 'voltsDC', 'amperes', 'watts', 'hertz', 'celsius', or 'cmm', + then a node of this type MUST contain a fixed-point number + ranging from -999,999,999 to +999,999,999. The value + -1000000000 indicates an underflow error. The value + +1000000000 indicates an overflow error. The + sensor-value-precision indicates how many fractional digits + are represented in the associated sensor-value node. + If the associated sensor-value-type node is equal to + 'percentRH', then a node of this type MUST contain a number + ranging from 0 to 100. + If the associated sensor-value-type node is equal to 'rpm', + then a node of this type MUST contain a number ranging from + -999,999,999 to +999,999,999. + If the associated sensor-value-type node is equal to + 'truth-value', then a node of this type MUST contain either the + value 1 (true) or the value 2 (false). + If the associated sensor-value-type node is equal to 'other' or + 'unknown', then a node of this type MUST contain a number + ranging from -1000000000 to 1000000000."; + reference + "RFC 3433: Entity Sensor Management Information Base - + EntitySensorValue"; +} + +typedef sensor-status { + type enumeration { + enum ok { + value 1; + description + "Indicates that the server can obtain the sensor value."; + } + enum unavailable { + value 2; + description + "Indicates that the server presently cannot obtain the + sensor value."; + } + enum nonoperational { + value 3; + description + "Indicates that the server believes the sensor is broken. + The sensor could have a hard failure (disconnected wire) + or a soft failure such as out-of-range, jittery, or wildly + fluctuating readings."; + } + } + description + "A node using this data type represents the operational status + of a physical sensor."; + reference + "RFC 3433: Entity Sensor Management Information Base - + EntitySensorStatus"; +} + +/* + * Data nodes + */ + +container hardware { + description + "Data nodes representing components. + If the server supports configuration of hardware components, + then this data model is instantiated in the configuration + datastores supported by the server. The leaf-list 'datastore' + for the module 'ietf-hardware' in the YANG library provides + this information."; + + leaf last-change { + type yang:date-and-time; + config false; + description + "The time the '/hardware/component' list changed in the + operational state."; + } + + list component { + key name; + description + "List of components. + When the server detects a new hardware component, it + initializes a list entry in the operational state. + If the server does not support configuration of hardware + components, list entries in the operational state are + initialized with values for all nodes as detected by the + implementation. + Otherwise, this procedure is followed: + 1. If there is an entry in the '/hardware/component' list + in the intended configuration with values for the nodes + 'class', 'parent', and 'parent-rel-pos' that are equal + to the detected values, then the list entry in the + operational state is initialized with the configured + values, including the 'name'. + 2. Otherwise (i.e., there is no matching configuration + entry), the list entry in the operational state is + initialized with values for all nodes as detected by + the implementation. + If the '/hardware/component' list in the intended + configuration is modified, then the system MUST behave as if + it re-initializes itself and follow the procedure in (1)."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalEntry"; + + leaf name { + type string; + description + "The name assigned to this component. + This name is not required to be the same as + entPhysicalName."; + } + + leaf class { + type identityref { + base ianahw:hardware-class; + } + mandatory true; + description + "An indication of the general hardware type of the + component."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalClass"; + } + + leaf physical-index { + if-feature entity-mib; + type int32 { + range "1..2147483647"; + } + config false; + description + "The entPhysicalIndex for the entPhysicalEntry represented + by this list entry."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalIndex"; + } + + leaf description { + type string; + config false; + description + "A textual description of the component. This node should + contain a string that identifies the manufacturer's name + for the component and should be set to a distinct value + for each version or model of the component."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalDescr"; + } + + leaf parent { + type leafref { + path "../../component/name"; + require-instance false; + } + description + "The name of the component that physically contains this + component. + If this leaf is not instantiated, it indicates that this + component is not contained in any other component. + In the event that a physical component is contained by + more than one physical component (e.g., double-wide + modules), this node contains the name of one of these + components. An implementation MUST use the same name + every time this node is instantiated."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalContainedIn"; + } + + leaf parent-rel-pos { + type int32 { + range "0 .. 2147483647"; + } + description + "An indication of the relative position of this child + component among all its sibling components. Sibling + components are defined as components that: + o share the same value of the 'parent' node and + o share a common base identity for the 'class' node. + Note that the last rule gives implementations flexibility + in how components are numbered. For example, some + implementations might have a single number series for all + components derived from 'ianahw:port', while some others + might have different number series for different + components with identities derived from 'ianahw:port' (for + example, one for registered jack 45 (RJ45) and one for + small form-factor pluggable (SFP))."; + + reference + "RFC 6933: Entity MIB (Version 4) - + entPhysicalParentRelPos"; + } + + leaf-list contains-child { + type leafref { + path "../../component/name"; + } + config false; + description + "The name of the contained component."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalChildIndex"; + } + + leaf hardware-rev { + type string; + config false; + description + "The vendor-specific hardware revision string for the + component. The preferred value is the hardware revision + identifier actually printed on the component itself (if + present)."; + reference + "RFC 6933: Entity MIB (Version 4) - + entPhysicalHardwareRev"; + } + + leaf firmware-rev { + type string; + config false; + description + "The vendor-specific firmware revision string for the + component."; + reference + "RFC 6933: Entity MIB (Version 4) - + entPhysicalFirmwareRev"; + } + + leaf software-rev { + type string; + config false; + + description + "The vendor-specific software revision string for the + component."; + reference + "RFC 6933: Entity MIB (Version 4) - + entPhysicalSoftwareRev"; + } + + leaf serial-num { + type string; + config false; + description + "The vendor-specific serial number string for the + component. The preferred value is the serial number + string actually printed on the component itself (if + present)."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalSerialNum"; + } + + leaf mfg-name { + type string; + config false; + description + "The name of the manufacturer of this physical component. + The preferred value is the manufacturer name string + actually printed on the component itself (if present). + Note that comparisons between instances of the + 'model-name', 'firmware-rev', 'software-rev', and + 'serial-num' nodes are only meaningful amongst components + with the same value of 'mfg-name'. + If the manufacturer name string associated with the + physical component is unknown to the server, then this + node is not instantiated."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalMfgName"; + } + + leaf model-name { + type string; + config false; + description + "The vendor-specific model name identifier string + associated with this physical component. The preferred + value is the customer-visible part number, which may be + printed on the component itself. + If the model name string associated with the physical + component is unknown to the server, then this node is not + instantiated."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalModelName"; + } + + leaf alias { + type string; + description + "An 'alias' name for the component, as specified by a + network manager, that provides a non-volatile 'handle' for + the component. + If no configured value exists, the server MAY set the + value of this node to a locally unique value in the + operational state. + A server implementation MAY map this leaf to the + entPhysicalAlias MIB object. Such an implementation needs + to use some mechanism to handle the differences in size + and characters allowed between this leaf and + entPhysicalAlias. The definition of such a mechanism is + outside the scope of this document."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalAlias"; + } + + leaf asset-id { + type string; + description + "This node is a user-assigned asset tracking identifier for + the component. + A server implementation MAY map this leaf to the + entPhysicalAssetID MIB object. Such an implementation + needs to use some mechanism to handle the differences in + size and characters allowed between this leaf and + entPhysicalAssetID. The definition of such a mechanism is + outside the scope of this document."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalAssetID"; + } + + leaf is-fru { + type boolean; + config false; + + description + "This node indicates whether or not this component is + considered a 'field-replaceable unit' by the vendor. If + this node contains the value 'true', then this component + identifies a field-replaceable unit. For all components + that are permanently contained within a field-replaceable + unit, the value 'false' should be returned for this + node."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalIsFRU"; + } + + leaf mfg-date { + type yang:date-and-time; + config false; + description + "The date of manufacturing of the managed component."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalMfgDate"; + } + + leaf-list uri { + type inet:uri; + description + "This node contains identification information about the + component."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalUris"; + } + + leaf uuid { + type yang:uuid; + config false; + description + "A Universally Unique Identifier of the component."; + reference + "RFC 6933: Entity MIB (Version 4) - entPhysicalUUID"; + } + + container state { + if-feature hardware-state; + description + "State-related nodes"; + reference + "RFC 4268: Entity State MIB"; + + leaf state-last-changed { + type yang:date-and-time; + config false; + description + "The date and time when the value of any of the + admin-state, oper-state, usage-state, alarm-state, or + standby-state changed for this component. + If there has been no change since the last + re-initialization of the local system, this node + contains the date and time of local system + initialization. If there has been no change since the + component was added to the local system, this node + contains the date and time of the insertion."; + reference + "RFC 4268: Entity State MIB - entStateLastChanged"; + } + + leaf admin-state { + type admin-state; + description + "The administrative state for this component. + This node refers to a component's administrative + permission to service both other components within its + containment hierarchy as well other users of its + services defined by means outside the scope of this + module. + Some components exhibit only a subset of the remaining + administrative state values. Some components cannot be + locked; hence, this node exhibits only the 'unlocked' + state. Other components cannot be shut down gracefully; + hence, this node does not exhibit the 'shutting-down' + state."; + reference + "RFC 4268: Entity State MIB - entStateAdmin"; + } + + leaf oper-state { + type oper-state; + config false; + description + "The operational state for this component. + Note that this node does not follow the administrative + state. An administrative state of 'down' does not + predict an operational state of 'disabled'. + Note that some implementations may not be able to + accurately report oper-state while the admin-state node + has a value other than 'unlocked'. In these cases, this + node MUST have a value of 'unknown'."; + reference + "RFC 4268: Entity State MIB - entStateOper"; + } + + leaf usage-state { + type usage-state; + config false; + description + "The usage state for this component. + This node refers to a component's ability to service + more components in a containment hierarchy. + Some components will exhibit only a subset of the usage + state values. Components that are unable to ever + service any components within a containment hierarchy + will always have a usage state of 'busy'. In some + cases, a component will be able to support only one + other component within its containment hierarchy and + will therefore only exhibit values of 'idle' and + 'busy'."; + reference + "RFC 4268: Entity State MIB - entStateUsage"; + } + + leaf alarm-state { + type alarm-state; + config false; + description + "The alarm state for this component. It does not + include the alarms raised on child components within its + containment hierarchy."; + reference + "RFC 4268: Entity State MIB - entStateAlarm"; + } + + leaf standby-state { + type standby-state; + config false; + description + "The standby state for this component. + Some components will exhibit only a subset of the + remaining standby state values. If this component + cannot operate in a standby role, the value of this node + will always be 'providing-service'."; + reference + "RFC 4268: Entity State MIB - entStateStandby"; + } + } + + container sensor-data { + when 'derived-from-or-self(../class, + "ianahw:sensor")' { + description + "Sensor data nodes present for any component of type + 'sensor'"; + } + if-feature hardware-sensor; + config false; + + description + "Sensor-related nodes."; + reference + "RFC 3433: Entity Sensor Management Information Base"; + + leaf value { + type sensor-value; + description + "The most recent measurement obtained by the server + for this sensor. + A client that periodically fetches this node should also + fetch the nodes 'value-type', 'value-scale', and + 'value-precision', since they may change when the value + is changed."; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorValue"; + } + + leaf value-type { + type sensor-value-type; + description + "The type of data units associated with the + sensor value"; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorType"; + } + leaf value-scale { + type sensor-value-scale; + description + "The (power of 10) scaling factor associated + with the sensor value"; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorScale"; + } + + leaf value-precision { + type sensor-value-precision; + description + "The number of decimal places of precision + associated with the sensor value"; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorPrecision"; + } + + leaf oper-status { + type sensor-status; + description + "The operational status of the sensor."; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorOperStatus"; + } + + leaf units-display { + type string; + description + "A textual description of the data units that should be + used in the display of the sensor value."; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorUnitsDisplay"; + } + + leaf value-timestamp { + type yang:date-and-time; + description + "The time the status and/or value of this sensor was last + obtained by the server."; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorValueTimeStamp"; + } + leaf value-update-rate { + type uint32; + units "milliseconds"; + description + "An indication of the frequency that the server updates + the associated 'value' node, represented in + milliseconds. The value zero indicates: + - the sensor value is updated on demand (e.g., + when polled by the server for a get-request), + - the sensor value is updated when the sensor + value changes (event-driven), or + - the server does not know the update rate."; + reference + "RFC 3433: Entity Sensor Management Information Base - + entPhySensorValueUpdateRate"; + } + } + } +} + +/* + * Notifications + */ + +notification hardware-state-change { + description + "A hardware-state-change notification is generated when the + value of /hardware/last-change changes in the operational + state."; + reference + "RFC 6933: Entity MIB (Version 4) - entConfigChange"; +} + +notification hardware-state-oper-enabled { + if-feature hardware-state; + description + "A hardware-state-oper-enabled notification signifies that a + component has transitioned into the 'enabled' state."; + + leaf name { + type leafref { + path "/hardware/component/name"; + } + + description + "The name of the component that has transitioned into the + 'enabled' state."; + } + leaf admin-state { + type leafref { + path "/hardware/component/state/admin-state"; + } + description + "The administrative state for the component."; + } + leaf alarm-state { + type leafref { + path "/hardware/component/state/alarm-state"; + } + description + "The alarm state for the component."; + } + reference + "RFC 4268: Entity State MIB - entStateOperEnabled"; +} + +notification hardware-state-oper-disabled { + if-feature hardware-state; + description + "A hardware-state-oper-disabled notification signifies that a + component has transitioned into the 'disabled' state."; + + leaf name { + type leafref { + path "/hardware/component/name"; + } + description + "The name of the component that has transitioned into the + 'disabled' state."; + } + leaf admin-state { + type leafref { + path "/hardware/component/state/admin-state"; + } + description + "The administrative state for the component."; + } + leaf alarm-state { + type leafref { + path "/hardware/component/state/alarm-state"; + } + + description + "The alarm state for the component."; + } + reference + "RFC 4268: Entity State MIB - entStateOperDisabled"; +} + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-interfaces.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-interfaces.yang new file mode 100644 index 000000000..8dae9d3e2 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/ietf-interfaces.yang @@ -0,0 +1,1073 @@ +module ietf-interfaces { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; + prefix if; + + import ietf-yang-types { + prefix yang; + } + + organization + "IETF NETMOD (Network Modeling) Working Group"; + + contact + "WG Web: + WG List: + Editor: Martin Bjorklund + "; + + description + "This module contains a collection of YANG definitions for + managing network interfaces. + Copyright (c) 2018 IETF Trust and the persons identified as + authors of the code. All rights reserved. + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + This version of this YANG module is part of RFC 8343; see + the RFC itself for full legal notices."; + + revision 2018-02-20 { + description + "Updated to support NMDA."; + reference + "RFC 8343: A YANG Data Model for Interface Management"; + } + + revision 2014-05-08 { + description + "Initial revision."; + reference + "RFC 7223: A YANG Data Model for Interface Management"; + } + + /* + * Typedefs + */ + + typedef interface-ref { + type leafref { + path "/if:interfaces/if:interface/if:name"; + } + description + "This type is used by data models that need to reference + interfaces."; + } + + /* + * Identities + */ + + identity interface-type { + description + "Base identity from which specific interface types are + derived."; + } + + /* + * Features + */ + + feature arbitrary-names { + description + "This feature indicates that the device allows user-controlled + interfaces to be named arbitrarily."; + } + feature pre-provisioning { + description + "This feature indicates that the device supports + pre-provisioning of interface configuration, i.e., it is + possible to configure an interface whose physical interface + hardware is not present on the device."; + } + feature if-mib { + description + "This feature indicates that the device implements + the IF-MIB."; + reference + "RFC 2863: The Interfaces Group MIB"; + } + + /* + * Data nodes + */ + + container interfaces { + description + "Interface parameters."; + + list interface { + key "name"; + + description + "The list of interfaces on the device. + The status of an interface is available in this list in the + operational state. If the configuration of a + system-controlled interface cannot be used by the system + (e.g., the interface hardware present does not match the + interface type), then the configuration is not applied to + the system-controlled interface shown in the operational + state. If the configuration of a user-controlled interface + cannot be used by the system, the configured interface is + not instantiated in the operational state. + System-controlled interfaces created by the system are + always present in this list in the operational state, + whether or not they are configured."; + + leaf name { + type string; + description + "The name of the interface. + A device MAY restrict the allowed values for this leaf, + possibly depending on the type of the interface. + For system-controlled interfaces, this leaf is the + device-specific name of the interface. + If a client tries to create configuration for a + system-controlled interface that is not present in the + operational state, the server MAY reject the request if + the implementation does not support pre-provisioning of + interfaces or if the name refers to an interface that can + never exist in the system. A Network Configuration + Protocol (NETCONF) server MUST reply with an rpc-error + with the error-tag 'invalid-value' in this case. + If the device supports pre-provisioning of interface + configuration, the 'pre-provisioning' feature is + advertised. + If the device allows arbitrarily named user-controlled + interfaces, the 'arbitrary-names' feature is advertised. + When a configured user-controlled interface is created by + the system, it is instantiated with the same name in the + operational state. + A server implementation MAY map this leaf to the ifName + MIB object. Such an implementation needs to use some + mechanism to handle the differences in size and characters + allowed between this leaf and ifName. The definition of + such a mechanism is outside the scope of this document."; + reference + "RFC 2863: The Interfaces Group MIB - ifName"; + } + + leaf description { + type string; + description + "A textual description of the interface. + A server implementation MAY map this leaf to the ifAlias + MIB object. Such an implementation needs to use some + mechanism to handle the differences in size and characters + allowed between this leaf and ifAlias. The definition of + such a mechanism is outside the scope of this document. + Since ifAlias is defined to be stored in non-volatile + storage, the MIB implementation MUST map ifAlias to the + value of 'description' in the persistently stored + configuration."; + reference + "RFC 2863: The Interfaces Group MIB - ifAlias"; + } + + leaf type { + type identityref { + base interface-type; + } + mandatory true; + description + "The type of the interface. + When an interface entry is created, a server MAY + initialize the type leaf with a valid value, e.g., if it + is possible to derive the type from the name of the + interface. + If a client tries to set the type of an interface to a + value that can never be used by the system, e.g., if the + type is not supported or if the type does not match the + name of the interface, the server MUST reject the request. + A NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf enabled { + type boolean; + default "true"; + description + "This leaf contains the configured, desired state of the + interface. + Systems that implement the IF-MIB use the value of this + leaf in the intended configuration to set + IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry + has been initialized, as described in RFC 2863. + Changes in this leaf in the intended configuration are + reflected in ifAdminStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf link-up-down-trap-enable { + if-feature if-mib; + type enumeration { + enum enabled { + value 1; + description + "The device will generate linkUp/linkDown SNMP + notifications for this interface."; + } + enum disabled { + value 2; + description + "The device will not generate linkUp/linkDown SNMP + notifications for this interface."; + } + } + description + "Controls whether linkUp/linkDown SNMP notifications + should be generated for this interface. + If this node is not configured, the value 'enabled' is + operationally used by the server for interfaces that do + not operate on top of any other interface (i.e., there are + no 'lower-layer-if' entries), and 'disabled' otherwise."; + reference + "RFC 2863: The Interfaces Group MIB - + ifLinkUpDownTrapEnable"; + } + + leaf admin-status { + if-feature if-mib; + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "Not ready to pass packets and not in some test mode."; + } + enum testing { + value 3; + description + "In some test mode."; + } + } + config false; + mandatory true; + description + "The desired state of the interface. + This leaf has the same read semantics as ifAdminStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf oper-status { + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + + description + "The interface does not pass any packets."; + } + enum testing { + value 3; + description + "In some test mode. No operational packets can + be passed."; + } + enum unknown { + value 4; + description + "Status cannot be determined for some reason."; + } + enum dormant { + value 5; + description + "Waiting for some external event."; + } + enum not-present { + value 6; + description + "Some component (typically hardware) is missing."; + } + enum lower-layer-down { + value 7; + description + "Down due to state of lower-layer interface(s)."; + } + } + config false; + mandatory true; + description + "The current operational state of the interface. + This leaf has the same semantics as ifOperStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifOperStatus"; + } + + leaf last-change { + type yang:date-and-time; + config false; + description + "The time the interface entered its current operational + state. If the current state was entered prior to the + last re-initialization of the local network management + subsystem, then this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifLastChange"; + } + + leaf if-index { + if-feature if-mib; + type int32 { + range "1..2147483647"; + } + config false; + mandatory true; + description + "The ifIndex value for the ifEntry represented by this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifIndex"; + } + + leaf phys-address { + type yang:phys-address; + config false; + description + "The interface's address at its protocol sub-layer. For + example, for an 802.x interface, this object normally + contains a Media Access Control (MAC) address. The + interface's media-specific modules must define the bit + and byte ordering and the format of the value of this + object. For interfaces that do not have such an address + (e.g., a serial line), this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; + } + + leaf-list higher-layer-if { + type interface-ref; + config false; + description + "A list of references to interfaces layered on top of this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf-list lower-layer-if { + type interface-ref; + config false; + + description + "A list of references to interfaces layered underneath this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf speed { + type yang:gauge64; + units "bits/second"; + config false; + description + "An estimate of the interface's current bandwidth in bits + per second. For interfaces that do not vary in + bandwidth or for those where no accurate estimation can + be made, this node should contain the nominal bandwidth. + For interfaces that have no concept of bandwidth, this + node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - + ifSpeed, ifHighSpeed"; + } + + container statistics { + config false; + description + "A collection of interface-related statistics objects."; + + leaf discontinuity-time { + type yang:date-and-time; + mandatory true; + description + "The time on the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + + leaf in-octets { + type yang:counter64; + description + "The total number of octets received on the interface, + including framing characters. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; + } + + leaf in-unicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were not addressed to a + multicast or broadcast address at this sub-layer. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; + } + + leaf in-broadcast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were addressed to a broadcast + address at this sub-layer. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInBroadcastPkts"; + } + + leaf in-multicast-pkts { + type yang:counter64; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were addressed to a multicast + address at this sub-layer. For a MAC-layer protocol, + this includes both Group and Functional addresses. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInMulticastPkts"; + } + + leaf in-discards { + type yang:counter32; + description + "The number of inbound packets that were chosen to be + discarded even though no errors had been detected to + prevent their being deliverable to a higher-layer + protocol. One possible reason for discarding such a + packet could be to free up buffer space. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInDiscards"; + } + + leaf in-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of inbound + packets that contained errors preventing them from being + deliverable to a higher-layer protocol. For character- + oriented or fixed-length interfaces, the number of + inbound transmission units that contained errors + preventing them from being deliverable to a higher-layer + protocol. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInErrors"; + } + + leaf in-unknown-protos { + type yang:counter32; + + description + "For packet-oriented interfaces, the number of packets + received via the interface that were discarded because + of an unknown or unsupported protocol. For + character-oriented or fixed-length interfaces that + support protocol multiplexing, the number of + transmission units received via the interface that were + discarded because of an unknown or unsupported protocol. + For any interface that does not support protocol + multiplexing, this counter is not present. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; + } + + leaf out-octets { + type yang:counter64; + description + "The total number of octets transmitted out of the + interface, including framing characters. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; + } + + leaf out-unicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted and that were not addressed + to a multicast or broadcast address at this sub-layer, + including those that were discarded or not sent. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; + } + + leaf out-broadcast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted and that were addressed to a + broadcast address at this sub-layer, including those + that were discarded or not sent. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutBroadcastPkts"; + } + + leaf out-multicast-pkts { + type yang:counter64; + description + "The total number of packets that higher-level protocols + requested be transmitted and that were addressed to a + multicast address at this sub-layer, including those + that were discarded or not sent. For a MAC-layer + protocol, this includes both Group and Functional + addresses. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutMulticastPkts"; + } + + leaf out-discards { + type yang:counter32; + description + "The number of outbound packets that were chosen to be + discarded even though no errors had been detected to + prevent their being transmitted. One possible reason + for discarding such a packet could be to free up buffer + space. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; + } + + leaf out-errors { + type yang:counter32; + description + "For packet-oriented interfaces, the number of outbound + packets that could not be transmitted because of errors. + For character-oriented or fixed-length interfaces, the + number of outbound transmission units that could not be + transmitted because of errors. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutErrors"; + } + } + + } + } + + /* + * Legacy typedefs + */ + + typedef interface-state-ref { + type leafref { + path "/if:interfaces-state/if:interface/if:name"; + } + status deprecated; + description + "This type is used by data models that need to reference + the operationally present interfaces."; + } + + /* + * Legacy operational state data nodes + */ + + container interfaces-state { + config false; + status deprecated; + description + "Data nodes for the operational state of interfaces."; + + list interface { + key "name"; + status deprecated; + + description + "The list of interfaces on the device. + System-controlled interfaces created by the system are + always present in this list, whether or not they are + configured."; + + leaf name { + type string; + status deprecated; + description + "The name of the interface. + A server implementation MAY map this leaf to the ifName + MIB object. Such an implementation needs to use some + mechanism to handle the differences in size and characters + allowed between this leaf and ifName. The definition of + such a mechanism is outside the scope of this document."; + reference + "RFC 2863: The Interfaces Group MIB - ifName"; + } + + leaf type { + type identityref { + base interface-type; + } + mandatory true; + status deprecated; + description + "The type of the interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf admin-status { + if-feature if-mib; + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "Not ready to pass packets and not in some test mode."; + } + enum testing { + value 3; + description + "In some test mode."; + } + } + mandatory true; + status deprecated; + description + "The desired state of the interface. + This leaf has the same read semantics as ifAdminStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf oper-status { + type enumeration { + enum up { + value 1; + description + "Ready to pass packets."; + } + enum down { + value 2; + description + "The interface does not pass any packets."; + } + enum testing { + value 3; + description + "In some test mode. No operational packets can + be passed."; + } + enum unknown { + value 4; + description + "Status cannot be determined for some reason."; + } + enum dormant { + value 5; + description + "Waiting for some external event."; + } + enum not-present { + value 6; + description + "Some component (typically hardware) is missing."; + } + enum lower-layer-down { + value 7; + description + "Down due to state of lower-layer interface(s)."; + } + } + mandatory true; + status deprecated; + description + "The current operational state of the interface. + This leaf has the same semantics as ifOperStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifOperStatus"; + } + + leaf last-change { + type yang:date-and-time; + status deprecated; + description + "The time the interface entered its current operational + state. If the current state was entered prior to the + last re-initialization of the local network management + subsystem, then this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifLastChange"; + } + + leaf if-index { + if-feature if-mib; + type int32 { + range "1..2147483647"; + } + mandatory true; + status deprecated; + description + "The ifIndex value for the ifEntry represented by this + interface."; + + reference + "RFC 2863: The Interfaces Group MIB - ifIndex"; + } + + leaf phys-address { + type yang:phys-address; + status deprecated; + description + "The interface's address at its protocol sub-layer. For + example, for an 802.x interface, this object normally + contains a Media Access Control (MAC) address. The + interface's media-specific modules must define the bit + and byte ordering and the format of the value of this + object. For interfaces that do not have such an address + (e.g., a serial line), this node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; + } + + leaf-list higher-layer-if { + type interface-state-ref; + status deprecated; + description + "A list of references to interfaces layered on top of this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf-list lower-layer-if { + type interface-state-ref; + status deprecated; + description + "A list of references to interfaces layered underneath this + interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifStackTable"; + } + + leaf speed { + type yang:gauge64; + units "bits/second"; + status deprecated; + description + "An estimate of the interface's current bandwidth in bits + per second. For interfaces that do not vary in + bandwidth or for those where no accurate estimation can + be made, this node should contain the nominal bandwidth. + For interfaces that have no concept of bandwidth, this + node is not present."; + reference + "RFC 2863: The Interfaces Group MIB - + ifSpeed, ifHighSpeed"; + } + + container statistics { + status deprecated; + description + "A collection of interface-related statistics objects."; + + leaf discontinuity-time { + type yang:date-and-time; + mandatory true; + status deprecated; + description + "The time on the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + + leaf in-octets { + type yang:counter64; + status deprecated; + description + "The total number of octets received on the interface, + including framing characters. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; + } + + leaf in-unicast-pkts { + type yang:counter64; + status deprecated; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were not addressed to a + multicast or broadcast address at this sub-layer. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; + } + + leaf in-broadcast-pkts { + type yang:counter64; + status deprecated; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were addressed to a broadcast + address at this sub-layer. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInBroadcastPkts"; + } + + leaf in-multicast-pkts { + type yang:counter64; + status deprecated; + description + "The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were addressed to a multicast + address at this sub-layer. For a MAC-layer protocol, + this includes both Group and Functional addresses. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInMulticastPkts"; + } + + leaf in-discards { + type yang:counter32; + status deprecated; + + description + "The number of inbound packets that were chosen to be + discarded even though no errors had been detected to + prevent their being deliverable to a higher-layer + protocol. One possible reason for discarding such a + packet could be to free up buffer space. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInDiscards"; + } + + leaf in-errors { + type yang:counter32; + status deprecated; + description + "For packet-oriented interfaces, the number of inbound + packets that contained errors preventing them from being + deliverable to a higher-layer protocol. For character- + oriented or fixed-length interfaces, the number of + inbound transmission units that contained errors + preventing them from being deliverable to a higher-layer + protocol. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInErrors"; + } + + leaf in-unknown-protos { + type yang:counter32; + status deprecated; + description + "For packet-oriented interfaces, the number of packets + received via the interface that were discarded because + of an unknown or unsupported protocol. For + character-oriented or fixed-length interfaces that + support protocol multiplexing, the number of + transmission units received via the interface that were + discarded because of an unknown or unsupported protocol. + For any interface that does not support protocol + multiplexing, this counter is not present. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; + } + + leaf out-octets { + type yang:counter64; + status deprecated; + description + "The total number of octets transmitted out of the + interface, including framing characters. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; + } + + leaf out-unicast-pkts { + type yang:counter64; + status deprecated; + description + "The total number of packets that higher-level protocols + requested be transmitted and that were not addressed + to a multicast or broadcast address at this sub-layer, + including those that were discarded or not sent. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; + } + + leaf out-broadcast-pkts { + type yang:counter64; + status deprecated; + + description + "The total number of packets that higher-level protocols + requested be transmitted and that were addressed to a + broadcast address at this sub-layer, including those + that were discarded or not sent. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutBroadcastPkts"; + } + + leaf out-multicast-pkts { + type yang:counter64; + status deprecated; + description + "The total number of packets that higher-level protocols + requested be transmitted and that were addressed to a + multicast address at this sub-layer, including those + that were discarded or not sent. For a MAC-layer + protocol, this includes both Group and Functional + addresses. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutMulticastPkts"; + } + + leaf out-discards { + type yang:counter32; + status deprecated; + description + "The number of outbound packets that were chosen to be + discarded even though no errors had been detected to + prevent their being transmitted. One possible reason + for discarding such a packet could be to free up buffer + space. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; + } + + leaf out-errors { + type yang:counter32; + status deprecated; + description + "For packet-oriented interfaces, the number of outbound + packets that could not be transmitted because of errors. + For character-oriented or fixed-length interfaces, the + number of outbound transmission units that could not be + transmitted because of errors. + Discontinuities in the value of this counter can occur + at re-initialization of the management system and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutErrors"; + } + } + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-alarm.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-alarm.yang new file mode 100644 index 000000000..57cdc61e8 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-alarm.yang @@ -0,0 +1,190 @@ +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-resource { + prefix org-openroadm-resource; + revision-date 2020-05-29; + } + import org-openroadm-probable-cause { + prefix org-openroadm-probable-cause; + revision-date 2020-05-29; + } + + 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, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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 severity { + type enumeration { + enum critical { + value 1; + } + enum major { + value 2; + } + enum minor { + value 3; + } + enum warning { + value 4; + } + enum clear { + value 5; + } + enum indeterminate { + value 6; + } + } + description + "Severity, based on X.733 perceived severity"; + } + + 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 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; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-alarm-pm-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-alarm-pm-types.yang new file mode 100644 index 000000000..d13b85b3f --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-alarm-pm-types.yang @@ -0,0 +1,81 @@ +module org-openroadm-common-alarm-pm-types { + namespace "http://org/openroadm/common-alarm-pm-types"; + prefix org-openroadm-common-alarm-pm-types; + + organization + "Open ROADM MSA"; + contact + "OpenROADM.org"; + description + "YANG definitions of common alarm and pm types. + + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + typedef direction { + type enumeration { + enum tx { + value 1; + } + enum rx { + value 2; + } + enum bidirectional { + value 3; + } + enum notApplicable { + value 4; + } + } + } + + typedef location { + type enumeration { + enum notApplicable { + value 1; + } + enum nearEnd { + value 2; + } + enum farEnd { + value 3; + } + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-amplifier-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-amplifier-types.yang new file mode 100644 index 000000000..d5500a173 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-amplifier-types.yang @@ -0,0 +1,99 @@ +module org-openroadm-common-amplifier-types { + namespace "http://org/openroadm/common-amplifier-types"; + prefix org-openroadm-common-amplifier-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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + typedef amplifier-types { + type enumeration { + enum standard { + value 1; + } + } + description + "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 line-amplifier-control-mode { + type enumeration { + enum gainLoss { + value 2; + } + enum off { + value 3; + } + } + description + "Identifies the line amplifier control mode, either off or gain."; + } + + typedef amplifier-gain-range { + type enumeration { + enum gain-range-1 { + value 1; + } + enum gain-range-2 { + value 2; + } + enum gain-range-3 { + value 3; + } + 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) "; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-attributes.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-attributes.yang new file mode 100644 index 000000000..115271ad6 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-attributes.yang @@ -0,0 +1,188 @@ +module org-openroadm-common-attributes { + namespace "http://org/openroadm/common-attributes"; + prefix org-openroadm-common-attributes; + + import org-openroadm-otn-common-types { + prefix org-openroadm-otn-common-types; + revision-date 2020-03-27; + } + + organization + "Open ROADM MSA"; + contact + "OpenROADM.org"; + description + "YANG definitions of common attributes. + + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + 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 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + + grouping parent-odu-allocation { + description + "parent odu allocation group"; + container parent-odu-allocation { + presence "Explicit assignment of parent ODU trib-slot and trib-port allocation. "; + description + "parent odu allocation"; + leaf trib-port-number { + type uint16 { + range "1 .. 80"; + } + mandatory true; + description + "Assigned tributary port number in parent OPU"; + } + choice trib-slots-choice { + description + "trib slot selection"; + case 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"; + } + } + case opucn { + leaf-list opucn-trib-slots { + type org-openroadm-otn-common-types:opucn-trib-slot-def; + description + "Specify the list of OPUCn 5G tributary slots in the form of + TS #A.B (G.709 Figure 20-9) in the case of provisioning the low + order ODUk to the parent server ODUCn"; + } + } + } + } + } + + grouping deg-threshold { + description + "Deg threshold grouping"; + 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%"; + } + } + + grouping trail-trace-tx { + description + "Trail trace tx grouping"; + 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"; + } + } + + grouping trail-trace-other { + description + "Trail trace other grouping"; + 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 Accepted TTI. Other TTI fields are ignored"; + } + enum DAPI { + description + "Expected DAPI is compared to the Accepted TTI. Other TTI fields are ignored"; + } + enum SAPI-and-DAPI { + description + "Expected SAPI and Expected DAPI are compared to the Accepted TTI. Operator specific TTI field is ignored"; + } + } + default "Disabled"; + description + "tim detect mode leaf"; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-equipment-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-equipment-types.yang new file mode 100644 index 000000000..f5189c314 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-equipment-types.yang @@ -0,0 +1,102 @@ +module org-openroadm-common-equipment-types { + namespace "http://org/openroadm/common-equipment-types"; + prefix org-openroadm-common-equipment-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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + typedef optic-types { + type enumeration { + enum gray { + value 1; + } + enum dwdm { + value 2; + } + } + } + + typedef equipment-type-enum { + type enumeration { + enum other { + value 1; + } + enum powerSupply { + value 2; + } + enum shelfProcessor { + value 3; + } + enum crossConnect { + value 4; + } + enum fan { + value 5; + } + enum accessPanel { + value 6; + } + enum circuitPack { + value 7; + } + } + } + + 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 'other'"; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-link-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-link-types.yang new file mode 100644 index 000000000..25bc8fbb0 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-link-types.yang @@ -0,0 +1,95 @@ +module org-openroadm-common-link-types { + namespace "http://org/openroadm/common-link-types"; + prefix org-openroadm-common-link-types; + + organization + "Open ROADM MSA"; + contact + "OpenROADM.org"; + description + "YANG definitions of common link types. + + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + typedef power-dBm { + type decimal64 { + fraction-digits 2; + } + units "dBm"; + description + "Power value in dBm."; + } + + typedef ratio-dB { + type decimal64 { + fraction-digits 3; + } + units "dB"; + description + "Power ratio in dB."; + } + + typedef fiber-pmd { + type decimal64 { + fraction-digits 2; + } + units "ps/(km[1/2])"; + description + "Polarization Mode Dispersion expressed in ps/km(1/2)."; + } + + typedef optical-control-mode { + type enumeration { + enum power { + value 1; + } + enum gainLoss { + value 2; + } + enum off { + value 3; + } + } + description + "Optical Control Mode: identifies specific algorithm related to power management and general optical control."; + reference + "openroadm.org: Open ROADM MSA Specification."; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-node-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-node-types.yang new file mode 100644 index 000000000..d8a914ba0 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-node-types.yang @@ -0,0 +1,69 @@ +module org-openroadm-common-node-types { + namespace "http://org/openroadm/common-node-types"; + prefix org-openroadm-common-node-types; + + organization + "Open ROADM MSA"; + contact + "OpenROADM.org"; + description + "YANG definitions of common node types. + + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + typedef node-id-type { + type string { + length "7..63"; + pattern '([a-zA-Z][a-zA-Z0-9-]{5,61}[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 identifier for a device."; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-optical-channel-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-optical-channel-types.yang new file mode 100644 index 000000000..3fc027bb3 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-optical-channel-types.yang @@ -0,0 +1,297 @@ +module org-openroadm-common-optical-channel-types { + namespace "http://org/openroadm/common-optical-channel-types"; + prefix org-openroadm-common-optical-channel-types; + + organization + "Open ROADM MSA"; + contact + "OpenROADM.org"; + description + "YANG definitions of common optical channel types. + + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-05-30 { + description + "Version 3.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + identity optical-rate-identity { + description + "base for otsi and och idenity"; + } + + identity och-rate-identity { + base optical-rate-identity; + description + "A unique och rate identification"; + } + + identity otsi-rate-identity { + base optical-rate-identity; + description + "A unique OTSi rate identification"; + } + + identity foic-identity { + description + "A unique FOICx.k identification (G.709.3 FlexO-LR and + G.709.1 FlexO-SR)"; + } + + identity foic1.2 { + base foic-identity; + description + "Applicable to the FlexO type defined in G.Sup58"; + } + + identity foic1.4 { + base foic-identity; + description + "Applicable to the FlexO type defined in G.709.1 and G.709.3"; + } + + identity foic2.4 { + base foic-identity; + description + "Applicable to the FlexO type defined in G.709.1"; + } + + identity foic2.8 { + base foic-identity; + description + "Applicable to the FlexO type defined in G.Sup58"; + } + + identity foic3.6 { + base foic-identity; + description + "Applicable to the FlexO type defined in future"; + } + + identity foic4.8 { + base foic-identity; + description + "Applicable to the FlexO type defined in G.709.1"; + } + + identity foic4.16 { + base foic-identity; + description + "Applicable to the FlexO type defined in G.Sup58"; + } + + identity R400G-otsi { + base otsi-rate-identity; + description + "Applicable instance for otsi rate identity"; + } + + identity R300G-otsi { + base otsi-rate-identity; + description + "Applicable instance for otsi rate identity"; + } + + identity R200G-otsi { + base otsi-rate-identity; + description + "Applicable instance for otsi rate identity"; + } + + identity R200G { + base och-rate-identity; + description + "Identity for 200G Rate"; + } + + identity R100G-otsi { + base otsi-rate-identity; + description + "Applicable instance for otsi rate identity"; + } + + identity R100G { + base och-rate-identity; + description + "Identity for 100G Rate"; + } + + identity R56G-foic-otsi { + base otsi-rate-identity; + description + "Applicable instance for otsi rate identity"; + } + + identity R28G-foic-otsi { + base otsi-rate-identity; + description + "Applicable instance for otsi rate identity"; + } + + 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 frequency-THz { + type decimal64 { + fraction-digits 8; + } + units "THz"; + description + "Frequency value in THz."; + } + + typedef frequency-GHz { + type decimal64 { + fraction-digits 5; + } + units "GHz"; + description + "Frequency value in GHz."; + } + + typedef wavelength-duplication-type { + 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."; + } + 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."; + } + } + 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 modulation-format { + type enumeration { + enum bpsk { + value 0; + description + "binary phase-shift keying"; + } + enum dc-dp-bpsk { + value 1; + description + "DC dual-polarization binary phase-shift keying"; + } + enum qpsk { + value 2; + description + "quadrature phase-shift keying"; + } + enum dp-qpsk { + value 3; + description + "dual-polarization binary phase-shift keying"; + } + enum qam16 { + value 4; + description + "quadrature amplitude modulation 16"; + } + enum dp-qam16 { + value 5; + description + "dual-polarization quadrature amplitude modulation 16"; + } + enum dc-dp-qam16 { + value 6; + description + "DC dual-polarization quadrature amplitude modulation 16"; + } + enum qam8 { + value 7; + description + "quadrature amplitude modulation 8"; + } + enum dp-qam8 { + value 8; + description + "dual-polarization quadrature amplitude modulation 8"; + } + enum dc-dp-qam8 { + value 9; + description + "DC dual-polarization quadrature amplitude modulation 8"; + } + } + description + "Modulation format"; + } + + typedef provision-mode-type { + type enumeration { + enum explicit; + enum profile; + } + description + "Provision Mode Type On Optical Channel"; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-state-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-state-types.yang new file mode 100644 index 000000000..901a01372 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-state-types.yang @@ -0,0 +1,113 @@ +module org-openroadm-common-state-types { + namespace "http://org/openroadm/common-state-types"; + prefix org-openroadm-common-state-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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + typedef lifecycle-state { + type enumeration { + enum deployed { + value 1; + } + enum planned { + value 2; + } + enum maintenance { + value 3; + } + enum deploying { + value 4; + } + enum undeploying { + value 5; + } + enum undeployed { + value 6; + } + enum proposed { + value 7; + } + enum draft { + value 8; + } + enum deploy-failed { + value 9; + } + enum undeploy-failed { + value 10; + } + enum deployed-augmented { + value 11; + } + enum deployed-updating { + value 12; + } + } + description + "Lifecycle state."; + } + + typedef state { + type enumeration { + enum inService { + value 1; + } + enum outOfService { + value 2; + } + enum degraded { + value 3; + } + } + description + "State that indicates whether the resource is able to provide fulfill its role - carry traffic, etc."; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-types.yang new file mode 100644 index 000000000..e35b4543f --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-common-types.yang @@ -0,0 +1,427 @@ +module org-openroadm-common-types { + namespace "http://org/openroadm/common-types"; + prefix org-openroadm-common-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, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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 activate-notification-type { + type enumeration { + enum activate { + value 1; + description + "software or database activation"; + } + enum commit { + value 2; + description + "commit the software or database. + For software activate, this event can happen in the following scenarios: + 1) immediately when user issue sw-activate command without validationTimer + or if the validationTimer is specified as 00-00-00; + 2) when user issue cancel-validation-timer before it expires and with accept=true. + For database activate, this event can occur in the following scenarios: + 1) immediately when user issue db-activate command without rollBackTimer + or if the rollBackTimer is specified as 00-00-00; + 2) when user issue cancel-rollback-timer before it expires and with accept=true."; + } + enum cancel { + value 3; + description + "cancel the database or software activation operation. + For software activate, this event can happen in the following cases: + 1) when the validationTimer expires; + 2) when the user issues cancel-validation-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 { + type enumeration { + enum Successful { + value 1; + } + enum Failed { + value 2; + } + } + description + "status of RPC "; + } + + typedef extended-rpc-status { + type enumeration { + enum Successful { + value 1; + } + enum Failed { + value 2; + } + enum In-progress { + value 3; + } + } + description + "status of RPC "; + } + + typedef openroadm-version-type { + type enumeration { + enum 1.0 { + value 1; + description + "value for 1.0"; + } + enum 2.0 { + value 2; + description + "value for 2.0"; + } + enum 2.1 { + value 3; + description + "value for 2.1"; + } + enum 2.2 { + value 4; + description + "value for 2.2"; + } + enum 3.0 { + value 5; + description + "value for 3.0"; + } + enum 3.1 { + value 6; + description + "value for 3.1"; + } + enum 4.0 { + value 7; + description + "value for 4.0"; + } + enum 2.2.1 { + value 8; + description + "value for 2.2.1"; + } + enum 4.1 { + value 9; + description + "value for 4.1"; + } + enum 3.1.1 { + value 10; + description + "value for 3.1.1"; + } + enum 5.0 { + value 11; + description + "value for 5.0"; + } + enum 5.1 { + value 12; + description + "value for 5.1"; + } + enum 6.0 { + value 13; + description + "value for 6.0"; + } + enum 6.1 { + value 14; + description + "value for 6.1"; + } + enum 7.0 { + value 15; + description + "value for 7.0"; + } + enum 7.1 { + value 16; + description + "value for 7.1"; + } + } + description + "OpenROADM version enum type"; + } + + 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 eth-rate-and-burst-size { + description + "Grouping of ethernet committed rate and burst size."; + leaf committed-info-rate { + type uint32; + mandatory true; + description + "Committed Information Rate (CIR), unit in Mbps. For example, 1250 Mbps"; + } + leaf committed-burst-size { + type uint16; + mandatory true; + description + "Committed Burst Size, unit in 1KB (K Byte). + Range 16 | 32 | 64 | 128 | 512 | 1024. Default: 16"; + } + } + + identity otn-protection-type { + description + "OTN base protection identity from which + specific protection types are derived."; + } + + 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"; + } + + + + + + + // + // Identities for FEC -- used for Device and Service models + // + + // Base Identity + identity fec-identity { + description + "A unique FEC identification"; + } + + // FEC Off (duplications for backwards compatibility) + identity off-fec { + status deprecated; + base fec-identity; + description + "FEC Off"; + } + identity off { + base fec-identity; + description + "FEC Off"; + } + + // Staircase FEC (duplications for backwards compatibility) + identity sc-fec { + status deprecated; + base fec-identity; + description + "Staircase FEC identification"; + } + identity scfec { + base fec-identity; + description + "Staircase FEC identification"; + } + + // Reed Solomon FEC (duplication for backwards compatibility) + identity rs-fec { + status deprecated; + base fec-identity; + description + "Reed Solomon FEC identification"; + } + identity rsfec { + base fec-identity; + description + "Reed Solomon FEC identification"; + } + + // OpenROADM FEC (duplication for backwards compatibility) + identity o-fec { + status deprecated; + base fec-identity; + description + "OpenROADM FEC identification"; + } + identity ofec { + base fec-identity; + description + "OpenROADM FEC identification"; + } + + // G.975.1 I.4 + identity efec { + base fec-identity; + description + "G.975.1 I.4"; + } + + // G.975.1 I.7 + identity ufec { + base fec-identity; + description + "G.975.1 I.7"; + } + + // Soft Decision FEC + identity sdfec { + base fec-identity; + description + "Soft Decision FEC"; + } + + // Clariphy SDFEC + identity sdfeca1 { + base fec-identity; + description + "Clariphy SDFEC"; + } + + // SDFEC with SCFED + identity sdfecb1 { + base fec-identity; + description + "SDFEC with SCFEC"; + } + + + grouping fec-grouping { + leaf fec { + type identityref { + base org-openroadm-common-types:fec-identity; + } + description + "FEC / Forward Error Correction"; + } + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device-types.yang new file mode 100644 index 000000000..89087d940 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device-types.yang @@ -0,0 +1,151 @@ +module org-openroadm-device-types { + namespace "http://org/openroadm/device-types"; + prefix org-openroadm-device-types; + + organization + "Open ROADM MSA"; + contact + "OpenROADM.org"; + description + "YANG definitions of device types. + + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + + typedef node-types { + type enumeration { + enum rdm { + value 1; + } + enum xpdr { + value 2; + } + enum ila { + value 3; + } + enum extplug { + value 4; + } + } + description + "Identifier for node type + 1. rdm for ROADM + 2. xpdr for Transponder, Regen + 3. ila for in-line amplifier + 4. extplug for external pluggable"; + } + + typedef xpdr-node-types { + type enumeration { + enum tpdr { + value 1; + } + 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 + 3. OTN switchponder + 4. Regenerator + 5. Regenerator based on unidirectional model"; + } + + typedef port-qual { + type enumeration { + enum roadm-internal { + value 1; + } + enum roadm-external { + value 2; + } + enum xpdr-network { + value 3; + } + enum xpdr-client { + value 4; + } + enum otdr { + value 5; + } + enum switch-network { + value 6; + } + enum switch-client { + value 7; + } + enum ila-external { + value 8; + } + enum ila-internal { + value 9; + } + } + } + + 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; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device.yang new file mode 100644 index 000000000..5e690f5a5 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-device.yang @@ -0,0 +1,2608 @@ +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 2020-05-29; + } + import org-openroadm-common-alarm-pm-types { + prefix org-openroadm-common-alarm-pm-types; + revision-date 2019-11-29; + } + import org-openroadm-common-equipment-types { + prefix org-openroadm-common-equipment-types; + revision-date 2019-11-29; + } + import org-openroadm-common-state-types { + prefix org-openroadm-common-state-types; + revision-date 2019-11-29; + } + import org-openroadm-common-amplifier-types { + prefix org-openroadm-common-amplifier-types; + revision-date 2019-11-29; + } + import org-openroadm-common-link-types { + prefix org-openroadm-common-link-types; + revision-date 2019-11-29; + } + import org-openroadm-common-node-types { + prefix org-openroadm-common-node-types; + revision-date 2019-11-29; + } + import org-openroadm-common-optical-channel-types { + prefix org-openroadm-common-optical-channel-types; + revision-date 2020-05-29; + } + import org-openroadm-device-types { + prefix org-openroadm-device-types; + revision-date 2019-11-29; + } + import org-openroadm-resource-types { + prefix org-openroadm-resource-types; + revision-date 2019-11-29; + } + import org-openroadm-physical-types { + prefix org-openroadm-physical-types; + revision-date 2019-11-29; + } + import org-openroadm-user-mgmt { + prefix org-openroadm-user-mgmt; + revision-date 2019-11-29; + } + import org-openroadm-port-types { + prefix org-openroadm-port-types; + revision-date 2020-03-27; + } + import org-openroadm-interfaces { + prefix org-openroadm-interfaces; + revision-date 2019-11-29; + } + import org-openroadm-swdl { + prefix org-openroadm-swdl; + revision-date 2020-05-29; + } + import org-openroadm-equipment-states-types { + prefix org-openroadm-equipment-states-types; + revision-date 2019-11-29; + } + import org-openroadm-switching-pool-types { + prefix org-openroadm-switching-pool-types; + revision-date 2019-11-29; + } + import org-openroadm-optical-operational-interfaces { + prefix org-openroadm-optical-operational-interfaces; + revision-date 2020-05-29; + } + import org-openroadm-otn-common-types { + prefix org-openroadm-otn-common-types; + revision-date 2020-03-27; + } + + 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, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-05-30 { + description + "Version 3.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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"; + } + + identity connection-direction-identity { + description + "Bidrectional capable, or Bi and Unidirectional capable"; + } + + identity connection-direction_bi { + base connection-direction-identity; + description + "Bidrectional capable"; + } + + identity connection-direction_bi_and_uni { + base connection-direction-identity; + description + "Bi and Unidirectional capable"; + } + + typedef interface-ref { + type leafref { + path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name"; + } + description + "This type is used by data models that need to reference + configured interfaces."; + } + + 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-node-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-device-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 software-build { + type string; + config false; + description + "Software build version"; + } + leaf openroadm-version { + type org-openroadm-common-types:openroadm-version-type; + 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+ "; + } + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of the device node. Whether it is planned, deployed, in maintenance, etc."; + } + 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; + status obsolete; + description + "(Deprecated) Slot is empty and expected type is provisioned"; + } + enum empty-prov-mismatch { + value 3; + status obsolete; + description + "(Deprecated) 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"; + } + enum empty-prov { + value 7; + description + "Slot is empty and provisioned"; + } + } + } + } + + grouping shelves { + list shelves { + key "shelf-name"; + uses shelf; + } + } + + grouping user-description-grp { + description + "user description group"; + leaf user-description { + type string; + description + "user provided description"; + } + } + + 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 lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of shelf. Whether it is planned, deployed, in maintenance, etc."; + } + leaf administrative-state { + type org-openroadm-equipment-states-types:admin-states; + mandatory true; + 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 is-physical { + type boolean; + config false; + mandatory true; + description + "is the entity physical or logical"; + } + leaf is-passive { + type boolean; + config false; + mandatory true; + description + "is the entity passive and not actively managed by the device; + e.g., no physical inventory or plug-in notification supported"; + } + leaf faceplate-label { + type string; + config false; + mandatory true; + description + "label on the faceplace silk screening"; + } + uses user-description-grp; + 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 boot { + type boolean; + description + "Flag to indicate boot loader or unprotected firmware update required"; + } + 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 boot { + type boolean; + description + "Flag to indicate boot loader or unprotected firmware update required"; + } + 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 lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of circuit-pack. Whether it is planned, deployed, in maintenance, etc."; + } + leaf administrative-state { + type org-openroadm-equipment-states-types:admin-states; + mandatory true; + 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-equipment-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; + config false; + mandatory true; + description + "True if circuitpack is pluggable optics"; + } + leaf is-physical { + type boolean; + config false; + mandatory true; + description + "is the entity physical or logical"; + } + leaf is-passive { + type boolean; + config false; + mandatory true; + description + "is the entity passive and not actively managed by the device; + e.g., no physical inventory or plug-in notification supported"; + } + leaf faceplate-label { + type string; + config false; + mandatory true; + description + "label on the faceplace silk screening"; + } + uses user-description-grp; + 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-alarm-pm-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-link-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-link-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 mc-capabilities-grp { + description + "Media channel capabilities grouping"; + leaf-list mc-capability-profile-name { + type leafref { + path "/org-openroadm-device/mc-capability-profile/profile-name"; + } + config false; + description + "Media channel capabilities"; + } + } + + grouping degree { + leaf degree-number { + type uint16; + description + "Degree number should be greater than zero and not greater than max-degrees"; + } + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of degree. Whether it is planned, deployed, in maintenance, etc."; + } + 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-grp; + } + + 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-amplifier-types:amplifier-types; + config false; + mandatory true; + description + "Amplifier type"; + } + leaf control-mode { + type org-openroadm-common-amplifier-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-amplifier-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-link-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-link-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-link-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-link-types:ratio-dB; + config false; + description + "Used to provide the value output VOA attenuation, optional"; + } + leaf partner-amp { + type leafref { + path "/org-openroadm-device/line-amplifier/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."; + } + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of the amplifier. Whether it is planned, deployed, in maintenance, etc."; + } + } + + 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; + } + leaf is-physical { + type boolean; + description + "is the entity physical or logical"; + } + uses user-description-grp; + 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; + } + } + } + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of the physical link. Whether it is planned, deployed, in maintenance, etc."; + } + } + + 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; + description + "Srg number should be greater than zero and not greater than max-srgs"; + } + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of shared-risk-group. Whether it is planned, deployed, in maintenance, etc."; + } + leaf wavelength-duplication { + type org-openroadm-common-optical-channel-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-grp; + } + + 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-device-types:xpdr-node-types; + mandatory true; + description + "Identifier for xponder-type e.g Transponder, Muxponder"; + } + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of xponder. Whether it is planned, deployed, in maintenance, etc."; + } + 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 supporting-circuit-pack-list-grp { + description + "supporting circuit pack list grouping"; + list supporting-port-list { + key "index"; + description + "supporting port list"; + leaf index { + type uint8; + description + "supporting circuit pack index"; + } + leaf circuit-pack-name { + type leafref { + path "/org-openroadm-device/circuit-packs/circuit-pack-name"; + } + mandatory true; + description + "The supported circuit-pack."; + } + leaf-list port-list { + type leafref { + path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name"; + } + description + "port list"; + } + } + } + + grouping interface-name { + description + "interface name grouping"; + 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 lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of interface. Whether it is planned, deployed, in maintenance, etc."; + } + leaf administrative-state { + type org-openroadm-equipment-states-types:admin-states; + mandatory true; + } + leaf operational-state { + type org-openroadm-common-state-types:state; + config false; + mandatory true; + } + leaf circuit-id { + type string { + length "0..45"; + } + description + "circuit identifier/user label, + can be used in alarm correlation and/or connection management "; + } + uses supporting-port-name; + leaf-list supporting-interface-list { + type leafref { + path "/org-openroadm-device/interface/name"; + } + description + "supporting interface list"; + } + } + } + + 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"; + } + uses supporting-circuit-pack-list-grp; + leaf port-type { + type string; + description + "Type of the pluggable or fixed port."; + } + leaf port-qual { + type org-openroadm-device-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-alarm-pm-types:direction; + config false; + mandatory true; + description + "Whether port is uni (tx/rx) or bi-directional and"; + } + leaf is-physical { + type boolean; + config false; + mandatory true; + description + "is the entity physical or logical"; + } + leaf faceplate-label { + type string; + config false; + mandatory true; + description + "label on the faceplace silk screening"; + } + uses user-description-grp; + leaf circuit-id { + type string { + length "0..45"; + } + description + "circuit identifier/user label, + can be used in alarm correlation and/or connection management "; + } + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of port. Whether it is planned, deployed, in maintenance, etc."; + } + 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-state-types:state; + config false; + mandatory true; + description + "Operational state of a 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. Implementations must provide the list of interfaces for port that has interfaces provisioned on that port."; + uses interface-name; + } + uses mc-capabilities-grp; + } + + grouping odu-mux-hierarchy-grp { + description + "ODU mux hierarchy group"; + list mux-capability { + key "stage-number ho-odu-type ho-odu-payload-type"; + description + "low order ODU TCM direction capability"; + leaf stage-number { + type uint8 { + range "1 .. 2"; + } + description + "stage number"; + } + leaf ho-odu-type { + type identityref { + base org-openroadm-otn-common-types:odu-rate-identity; + } + description + "High order ODU type"; + } + 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; + } + description + "Supported low order ODU type"; + } + leaf lo-odu-proactive-DMp { + type boolean; + description + "low 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 + "low 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 org-openroadm-common-types:tcm-direction-capability-type; + description + "Supported tcm direction capability for low order ODU associated with the port."; + } + } + } + + identity flexo-modulation-format-identity { + description + "Flexo modulation format identification"; + } + + grouping flexo-grp { + description + "Flexo group"; + 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."; + } + + uses org-openroadm-common-types:fec-grouping { + status deprecated; + description + "Flexo FEC / Forward Error Correction"; + } + + leaf otsi-rate { + type identityref { + base org-openroadm-common-optical-channel-types:otsi-rate-identity; + } + mandatory true; + description + "Flexo rate"; + } + leaf otsi-modulation-format { + type identityref { + base flexo-modulation-format-identity; + } + description + "Flexo modulation format"; + } + leaf otsi-width { + type uint16; + description + "OTSI width"; + } + leaf operational-mode-id { + type string; + mandatory true; + description + "Optical profile operational mode identifier"; + } + } + + grouping otsigroup-capability-grp { + description + "Otsigroup group capability"; + leaf if-cap-type { + type identityref { + base org-openroadm-port-types:supported-if-capability; + } + description + "Interface type/hierarchy/rate supported on this Otsi port. For example, if-n-otu4-n-odu4 and if-otucn-oducn"; + } + choice otu-rate { + description + "To specify the supported rate in the case of OTUCn or NxOTU4"; + case otucn { + leaf otucn-n-rate { + type uint16; + description + "Specify the N associated with OTUCn, e.g. N = 2,3,4 for 200G/300G/400G respectively"; + } + } + case nxotu4 { + leaf supported-n-otu4 { + type uint16; + description + "Specify the number of N in the case of N x OTU4"; + } + } + } + leaf-list foic-type { + type identityref { + base org-openroadm-common-optical-channel-types:foic-identity; + } + description + "FlexO interface type "; + } + leaf otn-capability-profile-name { + type leafref { + path "/org-openroadm-device/otn-capability-profile/profile-name"; + } + description + "OTN capabilities"; + } + leaf otn-odu-mux-hierarchy-profile-name { + type leafref { + path "/org-openroadm-device/otn-odu-mux-hierarchy-profile/profile-name"; + } + description + "OTN ODU Mux hierarchy capabilities"; + } + } + + grouping split-lambda-capability-grp { + description + "Split lambda capability group"; + container logical-port { + leaf circuit-pack-name { + type string; + description + "The circuit pack supporting the logical port"; + } + leaf port-name { + type string; + description + "Port name for logical-port"; + } + description + "Logical port container"; + } + list otsi { + key "circuit-pack-name port-name"; + description + "OTSI list for split lambda"; + leaf circuit-pack-name { + type string; + description + "OTSI circuit pack name"; + } + leaf port-name { + type string; + description + "OTSI port name"; + } + leaf otsi-rate { + type identityref { + base org-openroadm-common-optical-channel-types:otsi-rate-identity; + } + description + "OTSI rate"; + } + leaf-list optical-operational-mode { + type leafref { + path "/org-openroadm-device/optical-operational-mode-profile/profile-name"; + } + description + "Optical operational mode leaf list"; + } + } + leaf-list otsigroup-capability-profile-name { + type leafref { + path "/org-openroadm-device/otsigroup-capability-profile/profile-name"; + } + description + "OTSI group capability mode"; + } + } + + grouping otn-capability-grp { + description + "OTN capability group"; + leaf-list if-protection-capability { + type identityref { + base org-openroadm-common-types: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 org-openroadm-common-types: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."; + } + } + + grouping otn-odu-mux-hierarchy-grp { + description + "ODU mux hierarchy base group"; + list mux-capability { + key "stage-number ho-odu-type ho-odu-payload-type"; + description + "low order ODU TCM direction capability"; + leaf stage-number { + type uint8 { + range "1 .. 2"; + } + description + "stage number"; + } + leaf ho-odu-type { + type identityref { + base org-openroadm-otn-common-types:odu-rate-identity; + } + description + "High order ODU type"; + } + 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; + } + description + "Supported low order ODU type"; + } + leaf lo-odu-proactive-DMp { + type boolean; + description + "low 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 + "low 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 org-openroadm-common-types:tcm-direction-capability-type; + description + "Supported tcm direction capability for low order ODU associated with the port."; + } + } + } + + grouping mux-grp { + 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-odu-rate { + type identityref { + base org-openroadm-otn-common-types:odu-rate-identity; + } + mandatory true; + description + "Network ODU rate"; + } + leaf network-oducn-n-rate { + type uint16; + description + "Network ODUCn rate, eg, network-oducn-n-rate=4 for ODUC4"; + } + 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; + description + "Network high order ODU trib slots"; + } + leaf-list network-ho-odu-opucn-trib-slots { + type org-openroadm-otn-common-types:opucn-trib-slot-def; + description + "Network high order ODU OPU tributary slots"; + } + description + "Mux group grouping"; + } + + 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; + description + "pending software information"; + uses org-openroadm-swdl:sw-bank; + } + container database-info { + config false; + description + "database restore information"; + uses org-openroadm-swdl:database-info-group; + } + uses shelves; + uses circuit-packs; + uses interfaces-grp; + uses protection-groups; + container protocols { + description + "Contains the supported protocols"; + leaf lifecycle-state { + type org-openroadm-common-state-types:lifecycle-state; + description + "Lifecycle State of the protocols. Whether it is planned or deployed, etc."; + } + } + 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-alarm-pm-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-alarm-pm-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; + description + "Blocking/Non-Blocking"; + } + leaf odu-connection-direction-capabilities { + type identityref { + base connection-direction-identity; + } + description + "Bidrectional capable, or Bi and Unidirectional capable"; + } + 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"; + } + } + } + } + list otsigroup-capability-profile { + key "profile-name"; + config false; + description + "OTSI group operational profile"; + leaf profile-name { + type string; + description + "OTSI group profile name"; + } + uses otsigroup-capability-grp; + } + list mc-capability-profile { + key "profile-name"; + config false; + description + "Media channel capability profile list"; + leaf profile-name { + type string; + description + "Media channel profile name"; + } + leaf center-freq-granularity { + type org-openroadm-common-optical-channel-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-edge-freq { + type org-openroadm-common-optical-channel-types:frequency-THz; + config false; + description + "Minimum edge frequency"; + } + leaf max-edge-freq { + type org-openroadm-common-optical-channel-types:frequency-THz; + config false; + description + "Maximum edge frequency"; + } + leaf slot-width-granularity { + type org-openroadm-common-optical-channel-types:frequency-GHz; + default "50"; + config false; + description + "Width of a slot measured in GHz."; + } + 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"; + } + } + list split-lambda-profile { + key "profile-name"; + config false; + description + "OTN capability profile"; + leaf profile-name { + type string; + description + "Split lambda profile name"; + } + uses split-lambda-capability-grp; + } + list otn-odu-mux-hierarchy-profile { + key "profile-name"; + config false; + description + "OTN ODU mux hierarchy profile list"; + leaf profile-name { + type string; + description + "OTN ODU mux hierarchy profile name"; + } + uses otn-odu-mux-hierarchy-grp; + } + list optical-operational-mode-profile { + key "profile-name"; + config false; + description + "Optical operational profile"; + leaf profile-name { + type string; + description + "Optical operational profile name"; + } + uses org-openroadm-optical-operational-interfaces:optical-operational-modes-grp-attr; + } + list otn-capability-profile { + key "profile-name"; + config false; + description + "OTN capability profile"; + leaf profile-name { + type string; + description + "OTN capability profile name"; + } + uses otn-capability-grp; + } + list muxp-profile { + key "profile-name"; + config false; + description + "Muxp profile list"; + leaf profile-name { + type string; + description + "Mux profile name"; + } + uses mux-grp; + } + } + } + + 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-device-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-alarm-pm-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 { + description + "This Notification is sent when the otdr-scan-result is complete or failed."; + uses org-openroadm-common-types:rpc-response-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 datastore has changed."; + } + enum startup { + description + "The 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; +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-equipment-states-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-equipment-states-types.yang new file mode 100644 index 000000000..ccfca1972 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-equipment-states-types.yang @@ -0,0 +1,147 @@ +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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + 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"; + } + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-interfaces.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-interfaces.yang new file mode 100644 index 000000000..618c1e51b --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-interfaces.yang @@ -0,0 +1,181 @@ +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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0"; + } + 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 otsi { + base interface-type; + description + "OTSI interface."; + } + + identity otsi-group { + base interface-type; + description + "OTSI Group interface."; + } + + identity flexo { + base interface-type; + description + "Flexo interface."; + } + + identity flexo-group { + base interface-type; + description + "Flexo Group interface."; + } + + identity openROADMOpticalMultiplex { + base interface-type; + description + "Optical Transport Multiplex type for openROADM"; + } + + identity ppp { + base interface-type; + description + "PPP for IP GNE."; + } + + identity gcc { + base interface-type; + description + "ITU-T G.709 GCC."; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-optical-operational-interfaces.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-optical-operational-interfaces.yang new file mode 100644 index 000000000..bcaff1589 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-optical-operational-interfaces.yang @@ -0,0 +1,92 @@ +module org-openroadm-optical-operational-interfaces { + namespace "http://org/openroadm/optical-operational-interfaces"; + prefix org-openroadm-optical-operational-interfaces; + + import org-openroadm-common-optical-channel-types { + prefix org-openroadm-common-optical-channel-types; + revision-date 2020-05-29; + } + + organization + "Open ROADM MSA"; + contact + "OpenROADM.org"; + description + "YANG definitions for device flexible optical transport network group interfaces. + + Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2018, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + + grouping optical-operational-modes-grp-attr { + description + "optical operational modes attribute grouping"; + leaf spectral-width { + type org-openroadm-common-optical-channel-types:frequency-GHz; + units "GHz"; + description + "The required minimum signal spectral width of signal at -22 dbm."; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-otn-common-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-otn-common-types.yang new file mode 100644 index 000000000..0eb123b1f --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-otn-common-types.yang @@ -0,0 +1,352 @@ +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, + 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 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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 OTUCn { + base otu-rate-identity; + description + "Identity for an OTUCn"; + } + + 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 ODUCn { + base odu-rate-identity; + description + "Identity for an ODUCn"; + } + + 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 + "ODUFlex for CBR client signals (G.709)"; + } + + identity ODUflex-cbr-identity { + description + "Service type for ODUflex (CBR)"; + } + + identity ODUflex-cbr-25G { + base ODUflex-cbr-identity; + description + "ODUFlex for CBR client signals 25G (G.709 17.13.1)"; + } + + identity ODUflex-cbr-200G { + base ODUflex-cbr-identity; + description + "ODUFlex for CBR client signals 200G (G.709 17.13.2)"; + } + + identity ODUflex-cbr-400G { + base ODUflex-cbr-identity; + description + "ODUFlex for CBR client signals 400G (G.709 17.13.2)"; + } + + identity ODUflex-imp { + base odu-rate-identity; + description + "ODUFlex for IMP (Idle insertion Mapping Procedure) mapped client signals (G.709)"; + } + + identity ODUflex-flexe { + base odu-rate-identity; + description + "ODUflex for FlexE-aware client signals (G.709)"; + } + + identity ODUflex-gfp { + base odu-rate-identity; + description + "ODUflex for GFP-F mapped client signals (G.709)"; + } + + identity odtu-type-identity { + description + "A unique identification for the MSI odtu type."; + } + + identity ODTUCn.ts { + base odtu-type-identity; + description + "ODTUCn.ts - OPUCn MSI type (G.709 clause 20.2)"; + } + + 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 ODTU4.ts { + base odtu-type-identity; + description + "ODTU4.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"; + } + + typedef opucn-trib-slot-def { + type string; + description + "OPUCn trib slot in the form of 'A.B' with + A = 1..n + B = 1..20"; + } + + typedef tcm-direction-enum { + type enumeration { + enum up-tcm { + description + "TCM termination direction faces the switch fabric."; + } + enum down-tcm { + description + "TCM termination direction faces the facility"; + } + } + description + "Enumeration type for TCM direction"; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-physical-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-physical-types.yang new file mode 100644 index 000000000..236093707 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-physical-types.yang @@ -0,0 +1,153 @@ +module org-openroadm-physical-types { + namespace "http://org/openroadm/physical/types"; + prefix org-openroadm-physical-types; + + import org-openroadm-common-state-types { + prefix org-openroadm-common-state-types; + revision-date 2019-11-29; + } + 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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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-state-types:state; + config false; + mandatory true; + description + "Operational state of the physical resource"; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm-types.yang new file mode 100644 index 000000000..287cd4519 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm-types.yang @@ -0,0 +1,709 @@ +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, + 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 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + 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 + "Severely 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 + "Minimum 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."; + } + enum partialRateDiscard { + value 83; + description + "Discarded packet as a result of policing or rate limiting for subrate ethernet."; + } + enum erroredSecondsTCM1-up { + value 84; + description + "errored Seconds Count on TCM1 up direction."; + } + enum erroredSecondsTCM2-up { + value 85; + description + "errored Seconds Count on TCM2 up direction."; + } + enum erroredSecondsTCM3-up { + value 86; + description + "errored Seconds Count on TCM3 up direction."; + } + enum erroredSecondsTCM4-up { + value 87; + description + "errored Seconds Count on TCM4 up direction."; + } + enum erroredSecondsTCM5-up { + value 88; + description + "errored Seconds Count on TCM5 up direction."; + } + enum erroredSecondsTCM6-up { + value 89; + description + "errored Seconds Count on TCM6 up direction."; + } + enum severelyErroredSecondsTCM1-up { + value 90; + description + "severely Errored Seconds Count on TCM1 up direction."; + } + enum severelyErroredSecondsTCM2-up { + value 91; + description + "severely Errored Seconds Count on TCM2 up direction."; + } + enum severelyErroredSecondsTCM3-up { + value 92; + description + "severely Errored Seconds Count on TCM3 up direction."; + } + enum severelyErroredSecondsTCM4-up { + value 93; + description + "severely Errored Seconds Count on TCM4 up direction."; + } + enum severelyErroredSecondsTCM5-up { + value 94; + description + "severely Errored Seconds Count on TCM5 up direction."; + } + enum severelyErroredSecondsTCM6-up { + value 95; + description + "severely Errored Seconds Count on TCM6 up direction."; + } + enum unavailableSecondsTCM1-up { + value 96; + description + "unavailable Seconds Count on TCM1 up direction."; + } + enum unavailableSecondsTCM2-up { + value 97; + description + "unavailable Seconds Count on TCM2 up direction."; + } + enum unavailableSecondsTCM3-up { + value 98; + description + "unavailable Seconds Count on TCM3 up direction."; + } + enum unavailableSecondsTCM4-up { + value 99; + description + "unavailable Seconds Count on TCM4 up direction."; + } + enum unavailableSecondsTCM5-up { + value 100; + description + "unavailable Seconds Count on TCM5 up direction."; + } + enum unavailableSecondsTCM6-up { + value 101; + description + "unavailable Seconds Count on TCM6 up direction."; + } + enum erroredSecondsTCM1-down { + value 102; + description + "errored Seconds Count on TCM1 down direction."; + } + enum erroredSecondsTCM2-down { + value 103; + description + "errored Seconds Count on TCM2 down direction."; + } + enum erroredSecondsTCM3-down { + value 104; + description + "errored Seconds Count on TCM3 down direction."; + } + enum erroredSecondsTCM4-down { + value 105; + description + "errored Seconds Count on TCM4 down direction."; + } + enum erroredSecondsTCM5-down { + value 106; + description + "errored Seconds Count on TCM5 down direction."; + } + enum erroredSecondsTCM6-down { + value 107; + description + "errored Seconds Count on TCM6 down direction."; + } + enum severelyErroredSecondsTCM1-down { + value 108; + description + "severely Errored Seconds Count on TCM1 down direction."; + } + enum severelyErroredSecondsTCM2-down { + value 109; + description + "severely Errored Seconds Count on TCM2 down direction."; + } + enum severelyErroredSecondsTCM3-down { + value 110; + description + "severely Errored Seconds Count on TCM3 down direction."; + } + enum severelyErroredSecondsTCM4-down { + value 111; + description + "severely Errored Seconds Count on TCM4 down direction."; + } + enum severelyErroredSecondsTCM5-down { + value 112; + description + "severely Errored Seconds Count on TCM5 down direction."; + } + enum severelyErroredSecondsTCM6-down { + value 113; + description + "severely Errored Seconds Count on TCM6 down direction."; + } + enum unavailableSecondsTCM1-down { + value 114; + description + "unavailable Seconds Count on TCM1 down direction."; + } + enum unavailableSecondsTCM2-down { + value 115; + description + "unavailable Seconds Count on TCM2 down direction."; + } + enum unavailableSecondsTCM3-down { + value 116; + description + "unavailable Seconds Count on TCM3 down direction."; + } + enum unavailableSecondsTCM4-down { + value 117; + description + "unavailable Seconds Count on TCM4 down direction."; + } + enum unavailableSecondsTCM5-down { + value 118; + description + "unavailable Seconds Count on TCM5 down direction."; + } + enum unavailableSecondsTCM6-down { + value 119; + description + "unavailable Seconds Count on TCM6 down direction."; + } + enum fecCorrectedCodewords { + value 120; + description + "FEC Corrected Codewords Counter"; + } + enum fecUncorrectedCodewords { + value 121; + description + "FEC Uncorrected Codewords Counter"; + } + enum fecSymbolErrors { + value 122; + description + "FEC Symbol Error Counter"; + } + enum localFaultSeconds { + value 123; + description + "Local Fault Seconds"; + } + enum remoteFaultSeconds { + value 124; + description + "Remote Fault Seconds"; + } + } + } + + 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. Consists 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"; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm.yang new file mode 100644 index 000000000..44b932827 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-pm.yang @@ -0,0 +1,361 @@ +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 2020-05-29; + } + import org-openroadm-common-alarm-pm-types { + prefix org-openroadm-common-alarm-pm-types; + revision-date 2019-11-29; + } + import org-openroadm-resource { + prefix org-openroadm-resource; + revision-date 2020-05-29; + } + import org-openroadm-resource-types { + prefix org-openroadm-resource-types; + revision-date 2019-11-29; + } + import org-openroadm-pm-types { + prefix org-openroadm-pm-types; + revision-date 2020-03-27; + } + + 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, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-05-30 { + description + "Version 3.1.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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"; + } + + feature historical-pm-retrieval { + description + "The device supports the ability to directly retrieve the historical + PM data from the YANG model."; + } + + 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 start-time { + type yang:date-and-time; + config false; + mandatory true; + description + "Represents the start time of the bin (15m, 24h granularity) or the start of data collection (notApplicable/untimed granularity)."; + } + 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-alarm-pm-types:location; + } + leaf direction { + type org-openroadm-common-alarm-pm-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-alarm-pm-types:location; + } + leaf direction { + type org-openroadm-common-alarm-pm-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"; + } + mandatory true; + 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 minutes PM"; + } + } + output { + uses collect-history-pm-group; + } + } + + notification historical-pm-collect-result { + description + "This Notification is sent when the pm collection is successful 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"; + description + "List of current PM entries"; + uses current-pm-group; + } + } + container historical-pm-list { + if-feature "historical-pm-retrieval"; + config false; + description + "List of historical PM"; + list historical-pm-entry { + key "pm-resource-type pm-resource-type-extension pm-resource-instance"; + description + "List of historical PM entries"; + uses historical-pm-group; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-port-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-port-types.yang new file mode 100644 index 000000000..ce0bc8679 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-port-types.yang @@ -0,0 +1,440 @@ +module org-openroadm-port-types { + namespace "http://org/openroadm/port/types"; + prefix org-openroadm-port-types; + + import org-openroadm-common-link-types { + prefix org-openroadm-common-link-types; + revision-date 2019-11-29; + } + + 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, + 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 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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-200GE { + base supported-if-capability; + } + + identity if-400GE { + base supported-if-capability; + } + + identity if-OMS { + base supported-if-capability; + } + + identity if-OTS { + base supported-if-capability; + } + + identity if-OTS-OMS-MC-NMC { + base supported-if-capability; + } + + identity if-NMC { + 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-OTUCn-ODUCn { + base supported-if-capability; + } + + identity if-otsi-flexo-flexogroup { + base supported-if-capability; + } + + identity if-otsi-otsigroup { + base supported-if-capability; + } + + identity if-n-OTU4-ODU4 { + base supported-if-capability; + } + + identity if-otsi-otucn-oducn { + base supported-if-capability; + status obsolete; + } + + 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-10GE-oduflexgfp { + base supported-if-capability; + } + + identity if-25GE-oduflexcbr { + base supported-if-capability; + } + + identity if-40GE-ODU3 { + base supported-if-capability; + } + + identity if-40GE-oduflexgfp { + base supported-if-capability; + } + + identity if-100GE-ODU4 { + base supported-if-capability; + } + + identity if-100GE-oduflexgfp { + base supported-if-capability; + } + + identity if-200GE-oduflexcbr { + base supported-if-capability; + } + + identity if-400GE-odufleximp { + base supported-if-capability; + } + + identity if-400GE-oduflexcbr { + 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; + } + + identity pluggable-identifiers-identity { + description + "Pluggable identifiers type"; + } + + identity SFP { + base pluggable-identifiers-identity; + } + + identity SFP-plus { + base pluggable-identifiers-identity; + } + + identity SFP28 { + base pluggable-identifiers-identity; + } + + identity SFP-DD { + base pluggable-identifiers-identity; + } + + identity DWDM-SFP { + base pluggable-identifiers-identity; + } + + identity DWDM-SFP-plus { + base pluggable-identifiers-identity; + } + + identity QSFP { + base pluggable-identifiers-identity; + } + + identity QSFP-plus { + base pluggable-identifiers-identity; + } + + identity QSFP28 { + base pluggable-identifiers-identity; + } + + identity QSFP28-DD { + base pluggable-identifiers-identity; + } + + identity QSFP-DD { + base pluggable-identifiers-identity; + } + + identity micro-QSFP { + base pluggable-identifiers-identity; + } + + identity OSFP { + base pluggable-identifiers-identity; + } + + identity CFP { + base pluggable-identifiers-identity; + } + + identity CFP2 { + base pluggable-identifiers-identity; + } + + identity CFP4 { + base pluggable-identifiers-identity; + } + + identity CFP8 { + base pluggable-identifiers-identity; + } + + identity CFP2-ACO { + base pluggable-identifiers-identity; + } + + identity CFP2-DCO { + base pluggable-identifiers-identity; + } + + identity XFP { + base pluggable-identifiers-identity; + } + + identity SFP56 { + base pluggable-identifiers-identity; + } + + identity QSFP56 { + base pluggable-identifiers-identity; + } + + identity QSFP56-DD { + base pluggable-identifiers-identity; + } + + identity SFP-other { + base pluggable-identifiers-identity; + } + + identity SFP-unspecified { + base pluggable-identifiers-identity; + } + + identity pluggable-type-other { + base pluggable-identifiers-identity; + } + + identity pluggable-type-unspecified { + base pluggable-identifiers-identity; + } + + 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."; + } + + typedef port-module-types { + type enumeration { + enum 100GBASE-LR4 { + value 1; + } + enum CWDM-4 { + value 2; + } + } + description + "Pluggable modue types."; + } + + grouping common-port { + leaf port-power-capability-min-rx { + type org-openroadm-common-link-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-link-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-link-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-link-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; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-probable-cause.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-probable-cause.yang new file mode 100644 index 000000000..b327742c7 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-probable-cause.yang @@ -0,0 +1,890 @@ +module org-openroadm-probable-cause { + namespace "http://org/openroadm/probableCause"; + prefix org-openroadm-probable-cause; + + import org-openroadm-common-alarm-pm-types { + prefix org-openroadm-common-alarm-pm-types; + revision-date 2019-11-29; + } + + 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, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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 Power Degraded"; + } + enum automaticLaserShutdown { + value 7; + description + "Automatic Laser Shutdown"; + } + 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"; + } + enum lossOfSignalPayload { + value 270; + description + "Loss Of Signal Payload"; + reference + "G.798 6.2.1.2 dLOS-P, 16.8.2 OTSi/FlexO_A_Sk"; + } + enum lossOfLaneAlignment { + value 271; + description + "Loss Of Lane Alignment"; + reference + "G.798 15.3.1.2 FlexO-n/OTUCn_A_Sk that dLOL if the alignment process is in OLA state; + 16.7.2 (OTSi/FlexO-1-SC_A_Sk) (G.709.3) & 16.8.2 (OTSiG/FlexO_A_Sk) (G.709.1) + that dLOL based on the FEC alignment state diagram"; + } + enum groupIdMismatch { + value 272; + description + "Group Id Mismatch"; + reference + "G.798 dGIDM in Annex B.1.1.2.1; G.798 15.3.1.2 FlexO-n/OTUCn_A_Sk"; + } + enum flexoMapMismatch { + value 273; + description + "FlexO Map Mismatch"; + reference + "G.798 dFMM in Annex B.1.1.2.2; G.798 15.3.1.2 FlexO-n/OTUCn_A_Sk"; + } + enum powerOutOfSpecificationLow { + value 274; + } + enum gfpLossOfFrameDelineation { + value 275; + description + "GFP loss of frame delineation (dLFD G.806:6.2.5.2) is raised when the frame delineation process (clause 6.3.1 of [ITU-T G.7041]) is not in the 'SYNC' state"; + } + enum cmfLossOfSignal { + value 276; + description + "GFP client signal fail (dCSF G.806:6.2.6.4.1) is raised when a GFP frame with correct tHEC, with aPTI = '100' and a valid UPI code 0x01(G.7041: Table 6-4) is received"; + } + enum cmfLossOfSync { + value 277; + description + "GFP client signal fail (dCSF G.806:6.2.6.4.1) is raised when a GFP frame with correct tHEC, with aPTI = '100' and a valid UPI code 0x02(G.7041: Table 6-4) is received"; + } + enum cmfForwardDefectIndication { + value 278; + description + "GFP client signal fail (dCSF G.806:6.2.6.4.1) is raised when a GFP frame with correct tHEC, with aPTI = '100' and a valid UPI code 0x04(G.7041: Table 6-4) is received"; + } + enum cmfReverseDefectIndication { + value 279; + description + "GFP client signal fail (dCSF G.806:6.2.6.4.1) is raised when a GFP frame with correct tHEC, with aPTI = '100' and a valid UPI code 0x05(G.7041: Table 6-4) is received"; + } + enum localDegradedSER { + value 280; + description + "Local Degraded SER"; + reference + "IEEE 802.3-2018 Section 45.2.3.60.1, IEEE 802.3-2018 Section 119"; + } + enum remoteDegradedSER { + value 281; + description + "Remote Degraded SER"; + reference + "IEEE 802.3-2018 Section 45.2.3.60.2, IEEE 802.3-2018 Section 119"; + } + enum fecDegradedSER { + value 282; + description + "PCS FEC Degrade SER"; + reference + "IEEE 802.3-2018 Section 119"; + } + enum farEndFaultIndication { + value 283; + description + "Far End Fault Indication"; + reference + "IEEE 802.3-2018 Section 24.3.2.1"; + } + } + description + "probable cause group"; + } + + grouping probable-cause { + leaf cause { + type probable-cause-enum; + mandatory true; + } + leaf extension { + type string; + mandatory false; + } + leaf direction { + type org-openroadm-common-alarm-pm-types:direction; + mandatory true; + description + "Direction indication of the alarm."; + } + leaf location { + type org-openroadm-common-alarm-pm-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."; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource-types.yang new file mode 100644 index 000000000..1a5bd66dd --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource-types.yang @@ -0,0 +1,374 @@ +module org-openroadm-resource-types { + namespace "http://org/openroadm/resource/types"; + prefix org-openroadm-resource-types; + + import org-openroadm-common-node-types { + prefix org-openroadm-common-node-types; + revision-date 2019-11-29; + } + + 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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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 existing 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 highly volatile. "; + } + enum resourceDeletion { + value 3; + description + "An existing 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-node-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"; + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource.yang new file mode 100644 index 000000000..d8c2b4245 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-resource.yang @@ -0,0 +1,366 @@ +module org-openroadm-resource { + namespace "http://org/openroadm/resource"; + prefix org-openroadm-resource; + + import org-openroadm-interfaces { + prefix org-openroadm-interfaces; + revision-date 2019-11-29; + } + import org-openroadm-otn-common-types { + prefix org-openroadm-otn-common-types; + revision-date 2020-03-27; + } + import org-openroadm-common-optical-channel-types { + prefix org-openroadm-common-optical-channel-types; + revision-date 2020-05-29; + } + import org-openroadm-resource-types { + prefix org-openroadm-resource-types; + revision-date 2019-11-29; + } + + 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, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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 eth-attributes { + leaf speed { + type uint32; + description + "Set speed of the interface, unit mbps. + This is for ETH facility. "; + } + } + + 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-optical-channel-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-optical-channel-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"; + } + } + + grouping nmc-ctp-attributes { + description + "Network Media Channel attributes"; + leaf frequency { + type org-openroadm-common-optical-channel-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-optical-channel-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 och-attributes { + description + "Optical Channel attributes"; + leaf rate { + type identityref { + base org-openroadm-common-optical-channel-types:och-rate-identity; + } + description + "rate"; + } + leaf frequency { + type org-openroadm-common-optical-channel-types:frequency-THz; + description + "Center Frequency in THz."; + } + leaf width { + type org-openroadm-common-optical-channel-types:frequency-GHz; + config false; + description + "Frequency width in GHz."; + } + leaf modulation-format { + type org-openroadm-common-optical-channel-types:modulation-format; + description + "Modulation format"; + } + } + + 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"; + } + container parent-odu-allocation { + description + "parent odu allocation"; + leaf trib-port-number { + type uint16 { + range "1 .. 80"; + } + 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 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"; + } + } + + grouping resource-reporting { + leaf type { + type identityref { + base org-openroadm-interfaces:interface-type; + } + mandatory true; + description + "The type of the interface."; + } + container ethernet { + when "../type = 'ethernetCsmacd'"; + description + "Ethernet Interfaces"; + uses eth-attributes; + } + container mc-ttp { + when "../type = 'mediaChannelTrailTerminationPoint'"; + description + "Media Channel Trail Termination Point (MC-TTP)"; + uses mc-ttp-attributes; + } + container nmc-ctp { + when "../type = 'networkMediaChannelConnectionTerminationPoint'"; + description + "Network Media Channel Connection Termination Point (NMC-CTP)"; + uses nmc-ctp-attributes; + } + container och { + when "../type = 'opticalChannel'"; + description + "Optical Channel (OCh): + Models the optical channel interfaces for an Optical White Box."; + uses och-attributes; + } + container odu { + when "../type = 'otnOdu'"; + presence "Attribute Nodes for Optical Data Unit (ODU)"; + description + "Optical Channel Data Unit (ODU)"; + uses odu-attributes; + } + container otu { + when "../type = 'otnOtu'"; + description + "Optical Channel Transport Unit (OTU)"; + uses otu-attributes; + } + } + + grouping resource { + description + "This resource identifier is intended to provide a generic identifier + 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/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-swdl.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-swdl.yang new file mode 100644 index 000000000..dfdc8b3a2 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-swdl.yang @@ -0,0 +1,215 @@ +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 2020-05-29; + } + + 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, + 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 2020-05-29 { + description + "Version 7.1.0"; + } + revision 2020-03-27 { + description + "Version 7.0.0"; + } + revision 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2019-09-27 { + description + "Version 6.0.0"; + } + revision 2019-05-31 { + description + "Version 5.1.0"; + } + revision 2019-03-29 { + description + "Version 5.0.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + revision 2018-09-28 { + description + "Version 4.0.0"; + } + revision 2018-03-30 { + description + "Version 3.0.0"; + } + 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 { + description + "software bank group"; + 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"; + } + } + + grouping database-info-group { + description + "database info group"; + leaf last-restored-time { + type yang:date-and-time; + description + "last restored time for the database, or the time that the database was created, whichever is later"; + } + leaf rollback-timer { + type string { + pattern '(([0-1][0-9]|2[0-3])-([0-5][0-9])-([0-5][0-9]))'; + } + description + "value of rollback 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; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-switching-pool-types.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-switching-pool-types.yang new file mode 100644 index 000000000..a698a3ffd --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-switching-pool-types.yang @@ -0,0 +1,63 @@ +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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + 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"; + } + } + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-user-mgmt.yang b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-user-mgmt.yang new file mode 100644 index 000000000..846250f2a --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/main/yang/org-openroadm-user-mgmt.yang @@ -0,0 +1,161 @@ +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, + 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 2019-11-29 { + description + "Version 6.1.0"; + } + revision 2018-11-30 { + description + "Version 4.1.0"; + } + 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/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java new file mode 100644 index 000000000..1fb39864a --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestChangeNotificationListener.java @@ -0,0 +1,92 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.Arrays; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmChangeNotificationListener; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.EditBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; + +public class TestChangeNotificationListener { + + private static final String NODEID = "node1"; + + @Test + public void test() { + + NetconfAccessor netconfAccessor = mock(NetconfAccessor.class); + DataProvider databaseService = mock(DataProvider.class); + WebsocketManagerService notificationService = mock(WebsocketManagerService.class); + OpenroadmChangeNotificationListener notifListener = + new OpenroadmChangeNotificationListener(netconfAccessor, databaseService, notificationService); + when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); + Iterable pathArguments = Arrays.asList(new PathArgument() { + + @Override + public int compareTo(PathArgument arg0) { + return 0; + } + + @Override + public Class getType() { + return DataObject.class; + } + }); + InstanceIdentifier target = InstanceIdentifier.create(pathArguments); + + notifListener.onNetconfConfigChange(createNotification(EditOperationType.Create, target)); + EventlogEntity event = new EventlogBuilder().setNodeId(NODEID) + .setNewValue(String.valueOf(EditOperationType.Create)).setObjectId(target.toString()).build(); + verify(databaseService).writeEventLog(event); + + } + + /** + * @param type + * @return + */ + private static NetconfConfigChange createNotification(EditOperationType type, InstanceIdentifier target) { + NetconfConfigChange change = mock(NetconfConfigChange.class); + + @SuppressWarnings("null") + final @NonNull List edits = Arrays.asList(new EditBuilder().setOperation(type).setTarget(target).build()); + when(change.nonnullEdit()).thenReturn(edits); + return change; + } +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java new file mode 100644 index 000000000..e9d58b486 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestDeviceManagerOpenRoadmImpl.java @@ -0,0 +1,54 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.mock; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.DeviceManagerOpenroadmImpl; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; + +public class TestDeviceManagerOpenRoadmImpl { + DeviceManagerOpenroadmImpl devMgrOpenRdmImpl; + NetconfNetworkElementService netcnfNtwrkElmntSrvc; + + @Before + public void init() { + netcnfNtwrkElmntSrvc = mock(NetconfNetworkElementService.class); + devMgrOpenRdmImpl = new DeviceManagerOpenroadmImpl(); + } + + @Test + public void test() throws Exception { + devMgrOpenRdmImpl.setNetconfNetworkElementService(netcnfNtwrkElmntSrvc); + assertNotNull(devMgrOpenRdmImpl); + + } + + @After + public void cleanUp() throws Exception { + devMgrOpenRdmImpl.close(); + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java new file mode 100644 index 000000000..674c9d0de --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java @@ -0,0 +1,110 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import java.io.IOException; +import org.eclipse.jdt.annotation.NonNull; +import org.junit.BeforeClass; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmFaultNotificationListener; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.AlarmNotification; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.Severity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.alarm.ProbableCause; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.alarm.ProbableCauseBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.alarm.Resource; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.alarm.ResourceBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev191129.NodeIdType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.probablecause.rev200529.ProbableCauseEnum; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.Device; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.DeviceBuilder; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; + +public class TestOpenRoadmAlarmNotification { + private static final String myCircuitId = "Test_Id"; + private static final String myId = "Alarm_Id"; + DateAndTime myRaiseTime = new DateAndTime("2020-02-25T10:08:06.7Z"); + ProbableCause myProbableCause = + new ProbableCauseBuilder().setCause(ProbableCauseEnum.AutomaticLaserShutdown).build(); + Device device = new DeviceBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).build(); + org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.CircuitPack resVal = + new org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.resource.resource.CircuitPackBuilder() + .setCircuitPackName("Slot-0-Port-A").build(); + org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.Resource affectedResource = + new org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.ResourceBuilder().setResource(resVal).build(); + Resource myResource = new ResourceBuilder().setResource(affectedResource).setDevice(device).build(); + + + static DeviceManagerServiceProvider serviceProvider; + static @NonNull FaultService faultService; + static AlarmNotification notification; + Severity severity; + static NetconfBindingAccessor accessor; + static WebsocketManagerService notificationService; + static NodeId nNodeId = new NodeId("nSky"); + @BeforeClass + public static void init() throws InterruptedException, IOException { + + accessor = mock(NetconfBindingAccessor.class); + serviceProvider = mock(DeviceManagerServiceProvider.class); + faultService = mock(FaultService.class); + notificationService = mock(WebsocketManagerService.class); + } + + + + @Test + public void testNotification() { + severity = Severity.Critical; + when(accessor.getNodeId()).thenReturn(nNodeId); + when(serviceProvider.getFaultService()).thenReturn(faultService); + when(serviceProvider.getWebsocketService()).thenReturn(notificationService); + OpenroadmFaultNotificationListener alarmListener = + new OpenroadmFaultNotificationListener(accessor, serviceProvider); + notification = mock(AlarmNotification.class); + + when(notification.getId()).thenReturn(myId); + when(notification.getCircuitId()).thenReturn(myCircuitId); + when(notification.getRaiseTime()).thenReturn(myRaiseTime); + when(notification.getProbableCause()).thenReturn(myProbableCause); + when(notification.getResource()).thenReturn(myResource); + when(notification.getSeverity()).thenReturn(severity); + alarmListener.onAlarmNotification(notification); + System.out.println(notification.getId()); + assertEquals(myId, notification.getId()); + assertEquals(myCircuitId, notification.getCircuitId()); + assertEquals(myRaiseTime, notification.getRaiseTime()); + assertEquals(myProbableCause, notification.getProbableCause()); + assertEquals(myResource, notification.getResource()); + assertEquals(severity, notification.getSeverity()); + + + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java new file mode 100644 index 000000000..c3ef7d9ba --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmDeviceChangeNotification.java @@ -0,0 +1,120 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.Arrays; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.NetconfTimeStamp; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.types.NetconfTimeStampImpl; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmDeviceChangeNotificationListener; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev200529.RpcStatus; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.ChangeNotification; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.CreateTechInfoNotification; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.CreateTechInfoNotificationBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.change.notification.Edit; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.change.notification.EditBuilder; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; + + + +public class TestOpenRoadmDeviceChangeNotification { + private static final String NODEID = "Roadm1"; + private NetconfAccessor netconfAccessor = mock(NetconfAccessor.class); + private DataProvider databaseService = mock(DataProvider.class); + WebsocketManagerService notificationService = mock(WebsocketManagerService.class); + private OpenroadmDeviceChangeNotificationListener deviceChangeListener = + new OpenroadmDeviceChangeNotificationListener(netconfAccessor, databaseService, notificationService); + private static final NetconfTimeStamp ncTimeConverter = NetconfTimeStampImpl.getConverter(); + + @Test + public void testOnChangeNotification() { + + when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); + Iterable pathArguments = Arrays.asList(new PathArgument() { + + @Override + public int compareTo(PathArgument arg0) { + return 0; + } + + @Override + public Class getType() { + return DataObject.class; + } + }); + InstanceIdentifier target = InstanceIdentifier.create(pathArguments); + + deviceChangeListener.onChangeNotification(createNotification(EditOperationType.Create, target)); + EventlogEntity event = + new EventlogBuilder().setNodeId(NODEID).setNewValue(String.valueOf(EditOperationType.Create)) + .setObjectId(target.getPathArguments().toString()).setCounter(1) + .setAttributeName(target.getTargetType().getName()).setSourceType(SourceType.Netconf).build(); + verify(databaseService).writeEventLog(event); + + } + + @Test + public void testOnCreateTechInfoNotification() { + when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); + deviceChangeListener.onCreateTechInfoNotification(createTechInfoNotification()); + verify(databaseService).writeEventLog(any(EventlogEntity.class)); + } + + /** + * @param type + * @return + */ + private static ChangeNotification createNotification(EditOperationType type, InstanceIdentifier target) { + ChangeNotification change = mock(ChangeNotification.class); + + @SuppressWarnings("null") + final @NonNull List edits = Arrays.asList(new EditBuilder().setOperation(type).setTarget(target).build()); + when(change.nonnullEdit()).thenReturn(edits); + return change; + } + + private static CreateTechInfoNotification createTechInfoNotification() { + CreateTechInfoNotificationBuilder techInfoNotificationBuilder = new CreateTechInfoNotificationBuilder(); + techInfoNotificationBuilder.setLogFileName("shjkdjld/EHJkk").setShelfId("dsjhdukdgkzw") + .setStatus(RpcStatus.Successful).setStatusMessage("TestSuccessful"); + return techInfoNotificationBuilder.build(); + + } + + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java new file mode 100644 index 000000000..22c9c11dd --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmInventory.java @@ -0,0 +1,144 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmInventoryInput; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev191129.NodeIdType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.LifecycleState; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev200529.OpenroadmVersionType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Info; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.InfoBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint8; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestOpenRoadmInventory { + private static final Logger LOG = LoggerFactory.getLogger(OpenroadmInventoryInput.class); + private NetconfAccessor accessor = mock(NetconfAccessor.class); + private long value1 = 1; + private IpAddress ipAddress = new IpAddress(new Ipv4Address("127.0.0.11")); + private NodeId nodeId = new NodeId("RoadmA2"); + private Info info = new InfoBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).setClli("NodeB") + .setSerialId("0002").setModel("model2").setVendor("VendorA").setCurrentIpAddress(ipAddress) + .setCurrentIpAddress(ipAddress).setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20"))) + .setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20"))).setNodeType(NodeTypes.Rdm) + .setCurrentDatetime(new DateAndTime("2017-10-22T15:23:43Z")).setSoftwareVersion("swversion1234") + .setPrefixLength(Uint8.valueOf(28)).setMaxDegrees(Uint16.valueOf(2)).setMaxSrgs(Uint16.valueOf(3)) + .setMaxNumBin15minHistoricalPm(Uint16.valueOf(32)).setMaxNumBin24hourHistoricalPm(Uint16.valueOf(7)) + .setOpenroadmVersion(OpenroadmVersionType._20).build(); + + private OrgOpenroadmDevice device = mock(OrgOpenroadmDevice.class);; + private Shelves shelf = mock(Shelves.class); + private Interface interfaces = mock(Interface.class); + private CircuitPacks cp = mock(CircuitPacks.class); + private Xponder xpdr = mock(Xponder.class); + OpenroadmInventoryInput roadmInventory = new OpenroadmInventoryInput(accessor, device); + + @Test + public void TestDevice() { + when(accessor.getNodeId()).thenReturn(nodeId); + when(device.getInfo()).thenReturn(info); + + roadmInventory.getInventoryData(Uint32.valueOf(value1)); + assertEquals(info, device.getInfo()); + + } + + @Test + public void TestShelves() { + when(accessor.getNodeId()).thenReturn(nodeId); + when(device.getInfo()).thenReturn(info); + when(shelf.getShelfPosition()).thenReturn("10"); + when(shelf.getOperationalState()).thenReturn(State.InService); + when(shelf.getSerialId()).thenReturn("nodeid-1"); + when(shelf.getShelfName()).thenReturn("Shelf1"); + when(shelf.getShelfType()).thenReturn("Shelf"); + when(shelf.getClei()).thenReturn("1234567890"); + when(shelf.getVendor()).thenReturn("vendorA"); + when(shelf.getModel()).thenReturn("1"); + when(shelf.getHardwareVersion()).thenReturn("0.1"); + when(shelf.getManufactureDate()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z")); + assertNotNull(roadmInventory.getShelvesInventory(shelf, Uint32.valueOf(value1 + 1))); + + LOG.info("Shelves test completed"); + + } + + @Test + public void TestCircuitPacks() { + when(accessor.getNodeId()).thenReturn(nodeId); + when(cp.getCircuitPackName()).thenReturn("1/0"); + when(cp.getVendor()).thenReturn("VendorA"); + when(cp.getModel()).thenReturn("Model1"); + when(cp.getSerialId()).thenReturn("46277sgh6"); + when(cp.getClei()).thenReturn("136268785"); + when(cp.getHardwareVersion()).thenReturn("0.1"); + when(cp.getType()).thenReturn("WSS"); + when(cp.getProductCode()).thenReturn("oooooo"); + when(cp.getCircuitPackMode()).thenReturn("inServiceMode"); + when(device.getInfo()).thenReturn(info); + assertNotNull(roadmInventory.getCircuitPackInventory(cp, Uint32.valueOf(value1 + 1))); + + } + + @Test + public void TestInterfaces() { + when(accessor.getNodeId()).thenReturn(nodeId); + when(interfaces.getName()).thenReturn("1GE-interface-1"); + when(interfaces.getDescription()).thenReturn("Ethernet Interface"); + when(interfaces.getSupportingCircuitPackName()).thenReturn("1/0"); + when(device.getInfo()).thenReturn(info); + assertNotNull(roadmInventory.getInterfacesInventory(interfaces, Uint32.valueOf(value1 + 2))); + } + + @Test + public void TestXponder() { + when(xpdr.getXpdrNumber()).thenReturn(Uint16.valueOf(1)); + when(xpdr.getXpdrType()).thenReturn(XpdrNodeTypes.Mpdr); + when(xpdr.getLifecycleState()).thenReturn(LifecycleState.Deployed); + when(accessor.getNodeId()).thenReturn(nodeId); + when(device.getInfo()).thenReturn(info); + assertNotNull(roadmInventory.getXponderInventory(xpdr, Uint32.valueOf(value1 + 1))); + + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java new file mode 100644 index 000000000..9304356e6 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElement.java @@ -0,0 +1,310 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.eclipse.jdt.annotation.Nullable; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmInventoryInput; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmNetworkElement; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.ActiveAlarmList; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.Severity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.active.alarm.list.ActiveAlarms; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.active.alarm.list.ActiveAlarmsKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.alarm.ProbableCauseBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev200529.alarm.ResourceBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev191129.NodeIdType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.LifecycleState; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev200529.OpenroadmVersionType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.pack.ParentCircuitPack; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacks; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.circuit.packs.CircuitPacksKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.Interface; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.interfaces.grp.InterfaceKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Info; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.InfoBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.Xponder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.XponderKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelf.Slots; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelf.SlotsKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.Shelves; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.shelves.ShelvesKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.NodeTypes; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.HistoricalPmList; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPm; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPmKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.list.HistoricalPmEntry; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.list.HistoricalPmEntryKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.val.group.Measurement; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.val.group.MeasurementKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmDataType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmGranularity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmNamesEnum; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.Validity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.probablecause.rev200529.ProbableCauseEnum; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev200529.resource.DeviceBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev191129.ResourceTypeEnum; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint32; +import org.opendaylight.yangtools.yang.common.Uint64; +import org.opendaylight.yangtools.yang.common.Uint8; + +public class TestOpenRoadmNetworkElement { + + NetconfBindingAccessor accessor = mock(NetconfBindingAccessor.class); + DeviceManagerServiceProvider serviceProvider = mock(DeviceManagerServiceProvider.class); + DataProvider dataprovider = mock(DataProvider.class); + Capabilities capabilities = mock(Capabilities.class); + TransactionUtils transactionUtils = mock(TransactionUtils.class); + DataBroker dataBroker = mock(DataBroker.class); + FaultService faultService = mock(FaultService.class); + OrgOpenroadmDevice device; + OpenroadmInventoryInput inventoryData; + long level = 1; + private Shelves shelf = mock(Shelves.class); + private @Nullable Map shelfList; + private CircuitPacks cp, cp1, cp2, cp3; + private Interface interfaces = mock(Interface.class); + private Xponder xpdr = mock(Xponder.class); + private IpAddress ipAddress = new IpAddress(new Ipv4Address("127.0.0.11")); + private Info info = new InfoBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).setClli("NodeB") + .setSerialId("0002").setModel("model2").setVendor("VendorA").setCurrentIpAddress(ipAddress) + .setCurrentIpAddress(ipAddress).setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20"))) + .setCurrentDefaultGateway(new IpAddress(new Ipv4Address("127.0.0.20"))).setNodeType(NodeTypes.Rdm) + .setCurrentDatetime(new DateAndTime("2017-10-22T15:23:43Z")).setSoftwareVersion("swversion1234") + .setCurrentPrefixLength(Uint8.valueOf(45)).setMaxDegrees(Uint16.valueOf(56)).setMaxSrgs(Uint16.valueOf(251)) + .setMaxNumBin15minHistoricalPm(Uint16.valueOf(324)).setMaxNumBin24hourHistoricalPm(Uint16.valueOf(142)) + .setOpenroadmVersion(OpenroadmVersionType._20).build(); + private ActiveAlarmList alarmList = mock(ActiveAlarmList.class); + private ActiveAlarms activeAlarms = mock(ActiveAlarms.class); + private HistoricalPmList pmDataList = mock(HistoricalPmList.class); + private HistoricalPm historicalPm = mock(HistoricalPm.class); + + @Before + public void init() { + when(accessor.getCapabilites()).thenReturn(capabilities); + when(serviceProvider.getFaultService()).thenReturn(faultService); + when(serviceProvider.getDataProvider()).thenReturn(dataprovider); + NodeId nNodeId = new NodeId("RoadmA"); + when(accessor.getNodeId()).thenReturn(nNodeId); + when(accessor.getDataBroker()).thenReturn(dataBroker); + when(accessor.getTransactionUtils()).thenReturn(transactionUtils); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)).thenReturn(true); + final Class openRoadmDev = OrgOpenroadmDevice.class; + // Reading data from device + InstanceIdentifier deviceId = InstanceIdentifier.create(openRoadmDev); + device = mock(OrgOpenroadmDevice.class); + when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + deviceId)).thenReturn(device); + + when(device.getInfo()).thenReturn(info); + inventoryData = new OpenroadmInventoryInput(accessor, device); + // Reading the shelfs data; + when(shelf.getShelfPosition()).thenReturn("10"); + when(shelf.getOperationalState()).thenReturn(State.InService); + when(shelf.getSerialId()).thenReturn("nodeid-1"); + when(shelf.getShelfName()).thenReturn("Shelf1"); + when(shelf.getShelfType()).thenReturn("Shelf"); + when(shelf.getClei()).thenReturn("1234567890"); + when(shelf.getVendor()).thenReturn("vendorA"); + when(shelf.getModel()).thenReturn("1"); + when(shelf.getHardwareVersion()).thenReturn("0.1"); + when(shelf.getManufactureDate()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z")); + @Nullable + Map slotList = null; + Slots slots = mock(Slots.class); + when(slots.getLabel()).thenReturn("Slot56746"); + when(slots.getSlotName()).thenReturn("slotofRoadmA"); + when(slots.getProvisionedCircuitPack()).thenReturn("1/0"); + slotList = new HashMap<>(); + slotList.put(slots.key(), slots); + when(shelf.getSlots()).thenReturn(slotList); + shelfList = new HashMap<>(); + shelfList.put(shelf.key(), shelf); + when(device.getShelves()).thenReturn(shelfList); + + // Reading data from CircuitPacks + cp = mock(CircuitPacks.class); + when(cp.getCircuitPackName()).thenReturn("1/0"); + when(cp.getVendor()).thenReturn("VendorA"); + when(cp.getModel()).thenReturn("Model1"); + when(cp.getSerialId()).thenReturn("46277sgh6"); + when(cp.getClei()).thenReturn("136268785"); + when(cp.getHardwareVersion()).thenReturn("0.1"); + when(cp.getType()).thenReturn("WSS"); + when(cp.getProductCode()).thenReturn("oooooo"); + when(cp.getCircuitPackMode()).thenReturn("inServiceMode"); + + ParentCircuitPack parentCp = mock(ParentCircuitPack.class); + when(parentCp.getCircuitPackName()).thenReturn("1/0"); + when(parentCp.getCpSlotName()).thenReturn("Slot1"); + cp1 = mock(CircuitPacks.class); + when(cp1.getCircuitPackName()).thenReturn("1/0 EThernet"); + when(cp1.getVendor()).thenReturn("VendorA"); + when(cp1.getModel()).thenReturn("Model1678"); + when(cp1.getSerialId()).thenReturn("4627dgs7sgh6"); + when(cp1.getClei()).thenReturn("1362d68785"); + when(cp1.getHardwareVersion()).thenReturn("0.1"); + when(cp1.getType()).thenReturn("EthPlug"); + when(cp1.getProductCode()).thenReturn("oooooo"); + when(cp1.getCircuitPackMode()).thenReturn("inServiceMode"); + when(cp1.getParentCircuitPack()).thenReturn(parentCp); + + cp2 = mock(CircuitPacks.class); + when(cp2.getCircuitPackName()).thenReturn("2/0"); + when(cp2.getVendor()).thenReturn("VendorA"); + when(cp2.getModel()).thenReturn("Model1678"); + when(cp2.getSerialId()).thenReturn("4sads7sgh6"); + when(cp2.getClei()).thenReturn("1wew362d68785"); + when(cp2.getHardwareVersion()).thenReturn("0.1"); + when(cp2.getType()).thenReturn("WSS"); + when(cp2.getProductCode()).thenReturn("osooooo"); + when(cp2.getCircuitPackMode()).thenReturn("inServiceMode"); + + cp3 = mock(CircuitPacks.class); + when(parentCp.getCircuitPackName()).thenReturn("2/0"); + when(parentCp.getCpSlotName()).thenReturn("Slot1"); + when(cp3.getCircuitPackName()).thenReturn("2/0 OCS"); + when(cp3.getVendor()).thenReturn("VendorA"); + when(cp3.getModel()).thenReturn("Model1678"); + when(cp3.getSerialId()).thenReturn("dswsads7sgh6"); + when(cp3.getClei()).thenReturn("1ew62d68785"); + when(cp3.getHardwareVersion()).thenReturn("0.1"); + when(cp3.getType()).thenReturn("OCS Plug"); + when(cp3.getProductCode()).thenReturn("osooooo"); + when(cp3.getCircuitPackMode()).thenReturn("inServiceMode"); + when(cp3.getParentCircuitPack()).thenReturn(parentCp); + @Nullable + Map cpList = new HashMap<>(); + cpList.put(cp.key(), cp); + cpList.put(cp1.key(), cp1); + cpList.put(cp2.key(), cp2); + cpList.put(cp3.key(), cp3); + when(device.getCircuitPacks()).thenReturn(cpList); + + // Reading Interface Data + when(interfaces.getName()).thenReturn("1GE-interface-1"); + when(interfaces.getDescription()).thenReturn("Ethernet Interface"); + when(interfaces.getSupportingCircuitPackName()).thenReturn("1/0 EThernet"); + @Nullable + Map interfacesList = new HashMap<>(); + interfacesList.put(interfaces.key(), interfaces); + when(device.getInterface()).thenReturn(interfacesList); + + // Reading Xponder Data + when(xpdr.getXpdrNumber()).thenReturn(Uint16.valueOf(1)); + when(xpdr.getXpdrType()).thenReturn(XpdrNodeTypes.Mpdr); + when(xpdr.getLifecycleState()).thenReturn(LifecycleState.Deployed); + @Nullable + Map xpnderList = new HashMap<>(); + xpnderList.put(xpdr.key(), xpdr); + when(device.getXponder()).thenReturn(xpnderList); + + // Read initial Alarm data + final Class classAlarm = ActiveAlarmList.class; + InstanceIdentifier alarmDataIid = InstanceIdentifier.builder(classAlarm).build(); + when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + alarmDataIid)).thenReturn(alarmList); + when(activeAlarms.getId()).thenReturn("Alarm1"); + when(activeAlarms.getCircuitId()).thenReturn("1/0"); + when(activeAlarms.getRaiseTime()).thenReturn(new DateAndTime("2017-10-22T15:23:43Z")); + when(activeAlarms.getSeverity()).thenReturn(Severity.Critical); + when(activeAlarms.getProbableCause()) + .thenReturn(new ProbableCauseBuilder().setCause(ProbableCauseEnum.AutomaticLaserShutdown).build()); + when(activeAlarms.getAdditionalDetail()).thenReturn("LaserShutdown"); + when(activeAlarms.getResource()).thenReturn(new ResourceBuilder() + .setDevice(new DeviceBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).build()).build()); + @Nullable + Map activeAlarmlist = new HashMap<>(); + activeAlarmlist.put(activeAlarms.key(), activeAlarms); + when(alarmList.getActiveAlarms()).thenReturn(activeAlarmlist); + + // Read PM Data + final Class pmDataClass = HistoricalPmList.class; + InstanceIdentifier pmDataIid = InstanceIdentifier.builder(pmDataClass).build(); + when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + pmDataIid)).thenReturn(pmDataList); + + Measurement measurement = mock(Measurement.class); + PmDataType pmDataType = mock(PmDataType.class); + when(pmDataType.getUint64()).thenReturn(Uint64.valueOf(2425425)); + when(measurement.getBinNumber()).thenReturn(Uint16.valueOf(1452)); + when(measurement.getCompletionTime()).thenReturn(new DateAndTime("2018-10-22T15:23:43Z")); + when(measurement.getGranularity()).thenReturn(PmGranularity._24Hour); + when(measurement.getPmParameterUnit()).thenReturn("6824545199534863756"); + when(measurement.getPmParameterValue()).thenReturn(pmDataType); + when(measurement.getValidity()).thenReturn(Validity.Partial); + + @Nullable + Map measurementList = new HashMap<>(); + measurementList.put(measurement.key(), measurement); + when(historicalPm.getMeasurement()).thenReturn(measurementList); + when(historicalPm.getType()).thenReturn(PmNamesEnum.ErroredSeconds); + when(historicalPm.getExtension()).thenReturn("OpticalPowerOutput"); + @Nullable + Map historicalPmList = new HashMap<>(); + historicalPmList.put(historicalPm.key(), historicalPm); + HistoricalPmEntry histPmEntry = mock(HistoricalPmEntry.class); + when(histPmEntry.getHistoricalPm()).thenReturn(historicalPmList); + when(histPmEntry.getPmResourceType()).thenReturn(ResourceTypeEnum.CircuitPack); + @Nullable + Map histPmList = new HashMap<>(); + histPmList.put(histPmEntry.key(), histPmEntry); + when(pmDataList.getHistoricalPmEntry()).thenReturn(histPmList); + + } + + + + @Ignore + @Test + public void test() { + OpenroadmNetworkElement optionalNe = new OpenroadmNetworkElement(accessor, serviceProvider); + optionalNe.initialReadFromNetworkElement(); + verify(dataprovider).writeInventory(accessor.getNodeId().getValue(), + Arrays.asList(inventoryData.getInventoryData(Uint32.valueOf(1)))); + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java new file mode 100644 index 000000000..bcf2bf71f --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmNetworkElementFactory.java @@ -0,0 +1,101 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import java.io.IOException; +import java.util.Optional; +import org.junit.After; +import org.junit.BeforeClass; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmNetworkElementFactory; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.OrgOpenroadmDevice; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; + +public class TestOpenRoadmNetworkElementFactory { + + private static NetconfBindingAccessor accessor; + private static DeviceManagerServiceProvider serviceProvider; + private static Capabilities capabilities; + private static TransactionUtils transactionUtils; + private static DataBroker dataBroker; + + @BeforeClass + public static void init() throws InterruptedException, IOException { + accessor = mock(NetconfBindingAccessor.class); + capabilities = mock(Capabilities.class); + dataBroker = mock(DataBroker.class); + transactionUtils = mock(TransactionUtils.class); + serviceProvider = mock(DeviceManagerServiceProvider.class); + when(accessor.getNodeId()).thenReturn(new NodeId("RoadmA2")); + when(accessor.getCapabilites()).thenReturn(capabilities); + when(accessor.getDataBroker()).thenReturn(dataBroker); + when(accessor.getTransactionUtils()).thenReturn(transactionUtils); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(accessor)); + when(serviceProvider.getDataProvider()).thenReturn(null); + + final Class openRoadmDev = OrgOpenroadmDevice.class; + InstanceIdentifier deviceId = InstanceIdentifier.create(openRoadmDev); + when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + deviceId)).thenReturn(mock(OrgOpenroadmDevice.class)); + + when(accessor.getTransactionUtils()).thenReturn(mock(TransactionUtils.class)); + } + + @Test + public void testCapabiltiesAvailable1() { + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)).thenReturn(true); + OpenroadmNetworkElementFactory factory = new OpenroadmNetworkElementFactory(); + assertTrue((factory.create(accessor, serviceProvider)).isPresent()); + } + + @Test + public void testCapabiltiesAvailable2() { + when(accessor.getCapabilites().isSupportingNamespaceAndRevision("http://org/openroadm/device", "2018-10-19")) + .thenReturn(true); + OpenroadmNetworkElementFactory factory = new OpenroadmNetworkElementFactory(); + assertTrue((factory.create(accessor, serviceProvider)).isPresent()); + } + + @Test + public void testCapabiltiesNotAvailable() throws Exception { + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(OrgOpenroadmDevice.QNAME)).thenReturn(false); + OpenroadmNetworkElementFactory factory = new OpenroadmNetworkElementFactory(); + assertFalse(factory.create(accessor, serviceProvider).isPresent()); + } + + @After + public void cleanUp() throws Exception { + + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java new file mode 100644 index 000000000..cb58410fe --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmPMDataBuilder.java @@ -0,0 +1,221 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.PmDataBuilderOpenRoadm; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; +import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Direction; +import org.opendaylight.yang.gen.v1.http.org.openroadm.common.alarm.pm.types.rev191129.Location; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.HistoricalPmList; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPm; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPmBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.group.HistoricalPmKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.list.HistoricalPmEntry; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.list.HistoricalPmEntryBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.list.HistoricalPmEntryKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.val.group.Measurement; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.val.group.MeasurementBuilder; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.rev200529.historical.pm.val.group.MeasurementKey; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmDataType; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmGranularity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.PmNamesEnum; +import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev200327.Validity; +import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev191129.ResourceTypeEnum; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Pmdata15mEntity; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.Celsius; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.units.rev200413.PerformanceMeasurementUnitId; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument; +import org.opendaylight.yangtools.yang.common.Uint16; +import org.opendaylight.yangtools.yang.common.Uint64; + + +public class TestOpenRoadmPMDataBuilder { + // variables + // end of variables + private NetconfBindingAccessor acessor = mock(NetconfBindingAccessor.class); + private DataBroker dataBroker = mock(DataBroker.class); + private TransactionUtils transactionUtils = mock(TransactionUtils.class); + // String nodeId = "RdmA"; + private PmDataBuilderOpenRoadm pmDataBuilderORoadm; + private NodeId nodeId = new NodeId("RoadmA"); + private HistoricalPmList historicalPmDatalist = mock(HistoricalPmList.class); + private HistoricalPm historicalPm = mock(HistoricalPm.class); + private PmDataType pmDataType = new PmDataType(Uint64.valueOf(67508)); + private MeasurementBuilder measurementBuilder = new MeasurementBuilder(); + private HistoricalPmBuilder historicalPmBuilder = new HistoricalPmBuilder(); + private HistoricalPmEntryBuilder historicalPmEntryBuiler = new HistoricalPmEntryBuilder(); + private List> performanceMeasUnitList = + new ArrayList>(); + private Map measurementData = new HashMap(); + private Map historicalPMCollection = new HashMap(); + private Map historicalPmEntryCollection = + new HashMap(); + + + + // public methods + @Before + public void init() { + when(acessor.getDataBroker()).thenReturn(dataBroker); + when(acessor.getTransactionUtils()).thenReturn(transactionUtils); + + + + } + + @Test + public void testGetPmData() { + when(acessor.getNodeId()).thenReturn(nodeId); + pmDataBuilderORoadm = new PmDataBuilderOpenRoadm(acessor); + + final Class pmDataClass = HistoricalPmList.class; + InstanceIdentifier pmDataListId = InstanceIdentifier.builder(pmDataClass).build(); + when(acessor.getTransactionUtils().readData(acessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, + pmDataListId)).thenReturn(historicalPmDatalist); + + assertEquals(historicalPmDatalist,pmDataBuilderORoadm.getPmData(acessor)); + + } + + @Test + public void testBuildPmDataEntity() { + when(acessor.getNodeId()).thenReturn(nodeId); + pmDataBuilderORoadm = new PmDataBuilderOpenRoadm(acessor); + + performanceMeasUnitList.add(Celsius.class); + measurementBuilder.setBinNumber(Uint16.valueOf(24657)) + .setCompletionTime(new DateAndTime("2020-10-22T15:23:43Z")).setGranularity(PmGranularity._24Hour) + .setPmParameterUnit("dBm").setPmParameterValue(pmDataType).setValidity(Validity.Suspect); + + measurementData.put(measurementBuilder.key(), measurementBuilder.build()); + historicalPmBuilder.setType(PmNamesEnum.SeverelyErroredSeconds).setDirection(Direction.Bidirectional) + .setExtension("sajhsiwiduwugdhegdeuz").setLocation(Location.NearEnd).setMeasurement(measurementData); + when(historicalPm.getMeasurement()).thenReturn(measurementData); + + historicalPMCollection.put(historicalPmBuilder.key(), historicalPmBuilder.build()); + PathArgument pa =new PathArgument() { + + @Override + public int compareTo(PathArgument o) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public @NonNull Class getType() { + // TODO Auto-generated method stub + return Pmdata15mEntity.class; + } + }; + historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa))) + .setPmResourceTypeExtension("dshjdekjdewkk") + .setPmResourceType(ResourceTypeEnum.CircuitPack).setHistoricalPm(historicalPMCollection); + + historicalPmEntryCollection.put(historicalPmEntryBuiler.key(), historicalPmEntryBuiler.build()); + when(historicalPmDatalist.getHistoricalPmEntry()).thenReturn(historicalPmEntryCollection); + + assertNotNull(pmDataBuilderORoadm.buildPmDataEntity(historicalPmDatalist)); + } + @Test + public void testBuildPmDataEntity1() { + when(acessor.getNodeId()).thenReturn(nodeId); + pmDataBuilderORoadm = new PmDataBuilderOpenRoadm(acessor); + + performanceMeasUnitList.add(Celsius.class); + measurementBuilder.setBinNumber(Uint16.valueOf(24657)) + .setCompletionTime(new DateAndTime("2020-10-22T15:23:43Z")).setGranularity(PmGranularity._15min) + .setPmParameterUnit("celsius").setPmParameterValue(pmDataType).setValidity(Validity.Suspect); + + measurementData.put(measurementBuilder.key(), measurementBuilder.build()); + historicalPmBuilder.setType(PmNamesEnum.ErroredSeconds).setDirection(Direction.Rx) + .setExtension("sajhsiwiduwugdhegdeuz").setLocation(Location.FarEnd).setMeasurement(measurementData); + when(historicalPm.getMeasurement()).thenReturn(measurementData); + PathArgument pa =new PathArgument() { + + @Override + public int compareTo(PathArgument o) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public Class getType() { + // TODO Auto-generated method stub + return Pmdata15mEntity.class; + } + }; + historicalPMCollection.put(historicalPmBuilder.key(), historicalPmBuilder.build()); + historicalPmEntryBuiler.setPmResourceInstance(InstanceIdentifier.create(Arrays.asList(pa))) + .setPmResourceTypeExtension("dshjdekjdewkk") + .setPmResourceType(ResourceTypeEnum.Device).setHistoricalPm(historicalPMCollection); + + historicalPmEntryCollection.put(historicalPmEntryBuiler.key(), historicalPmEntryBuiler.build()); + when(historicalPmDatalist.getHistoricalPmEntry()).thenReturn(historicalPmEntryCollection); + + assertNotNull(pmDataBuilderORoadm.buildPmDataEntity(historicalPmDatalist)); + } + // end of public methods + + + // constants + // end of constants + + // variables + // end of variables + + // constructors + // end of constructors + + // getters and setters + // end of getters and setters + + // private methods + // end of private methods + + + // end of public methods + + // static methods + // end of static methods + + // private classes + // end of private classes +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenroadmNetworkElementBase.java b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenroadmNetworkElementBase.java new file mode 100644 index 000000000..e3ebac605 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenroadmNetworkElementBase.java @@ -0,0 +1,62 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. + * All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.test; + +import static org.junit.Assert.assertNotNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm71.impl.OpenroadmNetworkElementBase; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; +public class TestOpenroadmNetworkElementBase { + // variables + private NetconfBindingAccessor netconfAccessor = mock(NetconfBindingAccessor.class); + private DeviceManagerServiceProvider deviceManagerSvcProvider = mock(DeviceManagerServiceProvider.class); + private DataProvider databaseService = mock(DataProvider.class); + private NodeId nodeId = new NodeId("RoadmA"); + private OpenroadmNetworkElementBase openRoadmNetElementBase = new OpenroadmNetworkElementBase(netconfAccessor,deviceManagerSvcProvider); + // end of variables + + // public methods + @Before + public void init() { + + when(netconfAccessor.getNodeId()).thenReturn(nodeId); + + } + + @Test + public void testGetNodeId() { + assertNotNull(openRoadmNetElementBase.getNodeId()); + + } + + @Test + public void testGetDeviceType() { + assertNotNull(openRoadmNetElementBase.getDeviceType()); + } + +} diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 000000000..ca6ee9cea --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/simplelogger.properties b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..9af26dc96 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/openroadm71/provider/src/test/resources/simplelogger.properties @@ -0,0 +1,61 @@ +# +# ============LICENSE_START======================================================= +# ONAP : ccsdk features +# ================================================================================ +# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END======================================================= +# +# + +# SLF4J's SimpleLogger configuration file +# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err. + +# Default logging detail level for all instances of SimpleLogger. +# Must be one of ("trace", "debug", "info", "warn", or "error"). +# If not specified, defaults to "info". +org.slf4j.simpleLogger.defaultLogLevel=info + +# Logging detail level for a SimpleLogger instance named "xxx.yyy.zzz". +# Must be one of ("trace", "debug", "info", "warn", or "error"). +# If not specified, the default logging detail level is used. +# org.slf4j.simpleLogger.log.xxx.yyy=debug +org.slf4j.simpleLogger.log.org.onap.ccsdk.features.sdnr.wt.devicemanager=info +org.slf4j.simpleLogger.log.org.onap.ccsdk.features.sdnr.wt.devicemanager.test=debug +org.slf4j.simpleLogger.log.org.onap.ccsdk.features.sdnr.wt.database=debug +org.slf4j.simpleLogger.log.org.onap.ccsdk.features.sdnr.wt.devicemanager.archiveservice=info +org.slf4j.simpleLogger.log.org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes.Resources=info +org.slf4j.simpleLogger.log.org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.container=info + +# Set to true if you want the current date and time to be included in output messages. +# Default is false, and will output the number of milliseconds elapsed since startup. +#org.slf4j.simpleLogger.showDateTime=false + +# The date and time format to be used in the output messages. +# The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat. +# If the format is not specified or is invalid, the default format is used. +# The default format is yyyy-MM-dd HH:mm:ss:SSS Z. +#org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z + +# Set to true if you want to output the current thread name. +# Defaults to true. +#org.slf4j.simpleLogger.showThreadName=true + +# Set to true if you want the Logger instance name to be included in output messages. +# Defaults to true. +#org.slf4j.simpleLogger.showLogName=true + +# Set to true if you want the last component of the name to be included in output messages. +# Defaults to false. +#org.slf4j.simpleLogger.showShortLogName=false -- cgit 1.2.3-korg