From 879acbfe12b637bc32a5632f5c20bd2a09378e15 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Tue, 1 Feb 2022 13:19:55 +0530 Subject: Update adapter-manager devicemanager Include latest yang files Issue-ID: CCSDK-3578 Change-Id: I39e2acd096df1a1a3ade7965486fa75e21cd27d1 Signed-off-by: Ravi Pendurty --- .../impl/AdapterManagerNetworkElementFactory.java | 32 +- .../impl/NotificationListenerImpl.java | 57 +++ .../adaptermanager/impl/NtsNetworkElement.java | 36 +- .../provider/src/main/yang/nts-common.yang | 380 ---------------- .../src/main/yang/nts-common@2021-06-08.yang | 447 ++++++++++++++++++ .../main/yang/nts-commscope-pac@2020-11-30.yang | 57 +++ .../main/yang/nts-development-pac@2021-05-05.yang | 55 +++ .../src/main/yang/nts-kumu-pac@2020-11-30.yang | 41 ++ .../provider/src/main/yang/nts-manager.yang | 403 ----------------- .../src/main/yang/nts-manager@2021-06-08.yang | 406 +++++++++++++++++ .../src/main/yang/nts-mavenir-pac@2020-11-30.yang | 49 ++ .../main/yang/nts-network-function@2021-06-18.yang | 497 +++++++++++++++++++++ .../src/main/yang/nts-o-ran-fh-pac@2021-05-05.yang | 47 ++ .../src/main/yang/nts-o-ran-o1-pac@2021-05-05.yang | 35 ++ .../src/main/yang/nts-onf-pac@2020-11-30.yang | 49 ++ .../main/yang/nts-openroadm-pac@2020-11-30.yang | 49 ++ .../src/main/yang/nts-x-ran-pac@2020-11-30.yang | 41 ++ .../src/main/yang/nts-yes-pac@2020-11-30.yang | 41 ++ .../test/TestAdapterManagerNetworkElement.java | 7 +- .../TestAdapterManagerNetworkElementFactory.java | 13 +- 20 files changed, 1938 insertions(+), 804 deletions(-) create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NotificationListenerImpl.java delete mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common@2021-06-08.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-commscope-pac@2020-11-30.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-development-pac@2021-05-05.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-kumu-pac@2020-11-30.yang delete mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager@2021-06-08.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-mavenir-pac@2020-11-30.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-network-function@2021-06-18.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-fh-pac@2021-05-05.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-o1-pac@2021-05-05.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-onf-pac@2020-11-30.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-openroadm-pac@2020-11-30.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-x-ran-pac@2020-11-30.yang create mode 100644 sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-yes-pac@2020-11-30.yang (limited to 'sdnr/wt') diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java index c9930eaf5..02314c978 100644 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java @@ -1,5 +1,5 @@ /* - * ============LICENSE_START======================================================================== +* ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved. @@ -22,22 +22,42 @@ 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.Capabilities; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.network.topology.simulator.rev191025.SimulatorStatus; -import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210326.simulation.NetworkFunctions; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.simulation.NetworkFunctions; +import org.opendaylight.yangtools.yang.common.QName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * YANG Specs: + * urn:o-ran-sc:params:xml:ns:yang:nts:manager?revision=2021-06-08)nts-manager + * + */ public class AdapterManagerNetworkElementFactory implements NetworkElementFactory { private static final Logger log = LoggerFactory.getLogger(AdapterManagerNetworkElementFactory.class); + private static QName ROOTKEY=NetworkFunctions.QNAME; + @Override public Optional create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) { - if (acessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME) || acessor.getCapabilites().isSupportingNamespace(NetworkFunctions.QNAME)) { - log.info("Create device {} ", NtsNetworkElement.class.getName()); - return Optional.of(new NtsNetworkElement(acessor, serviceProvider.getDataProvider())); + showLogInfo(); + Capabilities capabilities = acessor.getCapabilites(); + if (capabilities.isSupportingNamespaceAndRevision(ROOTKEY)) { + Optional bindingAccessor = acessor.getNetconfBindingAccessor(); + if (bindingAccessor.isPresent()) { + log.info("Create device {} ", NtsNetworkElement.class.getName()); + return Optional.of(new NtsNetworkElement(bindingAccessor.get(), serviceProvider)); + } } + log.debug("No accessor for mountpoint {} {}", acessor.getNodeId(), capabilities); return Optional.empty(); } + + private void showLogInfo() { + log.debug("{} searching for {}", AdapterManagerNetworkElementFactory.class.getSimpleName(), + Capabilities.getNamespaceAndRevisionAsString(ROOTKEY)); + } } diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NotificationListenerImpl.java b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NotificationListenerImpl.java new file mode 100644 index 000000000..6be6a6508 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NotificationListenerImpl.java @@ -0,0 +1,57 @@ +/* + * ============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.adaptermanager.impl; + +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.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.InstanceChanged; +import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.NtsManagerListener; +import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.OperationStatusChanged; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NotificationListenerImpl implements NtsManagerListener { + + private static final Logger log = LoggerFactory.getLogger(NotificationListenerImpl.class); + private final NetconfBindingAccessor netconfAccessor; + private final DeviceManagerServiceProvider serviceProvider; + + public NotificationListenerImpl(NetconfBindingAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) { + this.netconfAccessor = netconfAccess; + this.serviceProvider = serviceProvider; + } + + @Override + public void onInstanceChanged(InstanceChanged notification) { + log.debug("Got event of type :: InstanceChanged"); + this.serviceProvider.getWebsocketService().sendNotification(notification, netconfAccessor.getNodeId(), + InstanceChanged.QNAME); + } + + @Override + public void onOperationStatusChanged(OperationStatusChanged notification) { + log.debug("Got event of type :: OperationStatusChanged"); + this.serviceProvider.getWebsocketService().sendNotification(notification, netconfAccessor.getNodeId(), + OperationStatusChanged.QNAME); + } + +} diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NtsNetworkElement.java b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NtsNetworkElement.java index d73d82412..74eb8d010 100644 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NtsNetworkElement.java +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/NtsNetworkElement.java @@ -18,12 +18,17 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.impl; import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; 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; +import org.opendaylight.yangtools.concepts.ListenerRegistration; +import org.opendaylight.yangtools.yang.binding.NotificationListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -35,19 +40,28 @@ public class NtsNetworkElement implements NetworkElement { private static final Logger LOG = LoggerFactory.getLogger(NtsNetworkElement.class); - private final NetconfAccessor netconfAccessor; + private final NetconfBindingAccessor netconfAccessor; @SuppressWarnings("unused") private final DataProvider databaseService; + private final NotificationListenerImpl notificationListener; - NtsNetworkElement(NetconfAccessor netconfAccess, DataProvider databaseService) { + private @NonNull ListenerRegistration listenerRegistrationresult; + + NtsNetworkElement(NetconfBindingAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) { LOG.info("Create {}", NtsNetworkElement.class.getSimpleName()); this.netconfAccessor = netconfAccess; - this.databaseService = databaseService; + this.databaseService = serviceProvider.getDataProvider(); + this.notificationListener = new NotificationListenerImpl(netconfAccess,serviceProvider); + this.listenerRegistrationresult = null; } @Override - public void deregister() {} + public void deregister() { + if(this.listenerRegistrationresult!=null) { + this.listenerRegistrationresult.close(); + } + } @Override public NodeId getNodeId() { @@ -60,10 +74,20 @@ public class NtsNetworkElement implements NetworkElement { } @Override - public void warmstart() {} + public void warmstart() { + } @Override - public void register() {} + public void register() { + if (netconfAccessor.isNotificationsRFC5277Supported()) { + listenerRegistrationresult = netconfAccessor.doRegisterNotificationListener(this.notificationListener); + // Register default (NETCONF) stream + netconfAccessor.registerNotificationsStream(); + LOG.debug("registered for notifications"); + } else { + LOG.warn("unable to register for notifications. RFC5277 not supported"); + } + } @Override public NetworkElementDeviceType getDeviceType() { diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common.yang deleted file mode 100644 index 86d7b3e8a..000000000 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common.yang +++ /dev/null @@ -1,380 +0,0 @@ -module nts-common { - yang-version 1.1; - namespace "urn:o-ran-sc:params:xml:ns:yang:nts:common"; - prefix ntsc; - - import ietf-inet-types { - prefix inet; - } - - organization - "O-RAN-SC"; - contact - " Web: - Editors: - Alex Stancu - Adrian Lita - Martin Skorupski "; - description - "This module contains common yang definitions YANG definitions for the Network Topology Simulator."; - - revision 2021-03-26 { - description - "Added controller-protocol."; - reference - "O-RAN-SC SIM project"; - } - revision 2021-02-15 { - description - "Added presence to configuration containers."; - reference - "O-RAN-SC SIM project"; - } - revision 2020-11-20 { - description - "Add feature-type for the Web cut through feature."; - reference - "O-RAN-SC SIM project"; - } - revision 2020-10-22 { - description - "Add feature-type for the NETCONF Call Home feature."; - reference - "O-RAN-SC SIM project"; - } - revision 2020-10-13 { - description - "Add feature-type typedef containing the features that can be activated in the Network Function."; - reference - "O-RAN-SC SIM project"; - } - revision 2020-09-07 { - description - "Initial revision for the Network Topology Simulator - Next Generation common types."; - reference - "O-RAN-SC SIM project"; - } - - feature faults-status { - description - "This means that the server supports reporting back the number of faults that were generated"; - } - - identity NTS_FUNCTION_TYPE_BASE { - description - "The reference of each identity represents the name of the associated docker image."; - } - - typedef authentication-method-type { - type enumeration { - enum no-auth { - description - "no security (http)"; - } - enum cert-only { - description - "auth by certificate (https)"; - } - enum basic-auth { - description - "auth by basic auth username and password (https)"; - } - enum cert-basic-auth { - description - "auth by certificate and basic auth username / password (https)"; - } - } - description - "The authentication method for VES messaging."; - } - - typedef feature-type { - type bits { - bit ves-file-ready { - position 0; - description - "Controls the ves-file-ready feature."; - } - bit ves-heartbeat { - position 1; - description - "Controls the ves-heartbeat feature."; - } - bit ves-pnf-registration { - position 2; - description - "Controls the ves-pnf-registration feature."; - } - bit manual-notification-generation { - position 3; - description - "Controls the manual notification generation feature."; - } - bit netconf-call-home { - position 4; - description - "Controls the NETCONF Call Home feature."; - } - bit web-cut-through { - position 5; - description - "Controls the Web Cut Through feature."; - } - } - description - "Describes the features that can be enabled/disabled in the Network Function."; - } - - grouping mount-point-details-g { - description - "Groups details about mount point"; - leaf mount-point-addressing-method { - type enumeration { - enum host-mapping { - description - "Uses IP and port mapped to the host machine to address the nework function."; - } - enum docker-mapping { - description - "Uses Docker IP and port to address the nework function."; - } - } - default "docker-mapping"; - description - "Specifies how to address the simulated network function: via the host machine or via docker."; - } - } - - grouping fault-delay-period-g { - description - "For reusing the same fault-delay-period."; - list fault-delay-list { - key "index"; - ordered-by user; - description - "The list defining the pattern for generating events."; - leaf index { - type uint16; - description - "The index of the list."; - } - leaf delay-period { - type uint16; - units "s"; - description - "The amount of seconds before the next event."; - } - } - } - - grouping fault-count-g { - description - "Grouping for counting the fault events, grouped by severity."; - container fault-count { - if-feature "faults-status"; - config false; - description - "Container which groups the number of fault events, by severity."; - leaf normal { - type uint32; - description - "Number of normal (non-alarmed) events."; - } - leaf warning { - type uint32; - description - "Number of warning events."; - } - leaf minor { - type uint32; - description - "Number of minor events."; - } - leaf major { - type uint32; - description - "Number of major events."; - } - leaf critical { - type uint32; - description - "Number of critical events."; - } - } - } - - grouping faults-g { - description - "Grouping for fault generation"; - container fault-generation { - presence "Enables fault generation configuration."; - description - "Groups the fault generation configuration and status."; - uses fault-delay-period-g; - uses fault-count-g; - } - } - - grouping faults-enabled-g { - description - "Groups the enabling of faults."; - leaf faults-enabled { - type boolean; - description - "For enabling the fault generation."; - } - } - - grouping netconf-config-g { - description - "Groups the configuration and status of NETCONF Fault notifications."; - container netconf { - presence "Enables NETCONF configuration."; - description - "Container for describing the NETCONF details."; - uses faults-enabled-g; - leaf call-home { - type boolean; - description - "For enabling the NETCONF Call Home feature. If set to 'true', each simulated device, when booting up, will try to Call Home to the SDN Controller."; - } - } - } - - grouping ves-config-g { - description - "Groups the configuration and status of VES Fault notifications."; - container ves { - presence "Enables VES configuration."; - description - "Container for describing the VES details."; - uses faults-enabled-g; - leaf pnf-registration { - type boolean; - description - "For enabling the PNF Registration messages. If set to 'true', each simulated device, when booting up, will send a PNF Registration message to the VES Collector."; - } - leaf heartbeat-period { - type uint16; - description - "The number of seconds between VES heartbeat messages."; - } - } - } - - grouping controller-g { - description - "Groups information about the SDN Controller."; - leaf controller-protocol { - type enumeration { - enum http { - description - "HTTP protocol will be used to connect to the VES Collector."; - } - enum https { - description - "HTTPS protocol will be used to connect to the VES Collector."; - } - } - default "https"; - description - "The protocol used for communication with the SDN Controller."; - } - leaf controller-ip { - type inet:ip-address; - description - "The IP address of the SDN Controller."; - } - leaf controller-port { - type inet:port-number; - description - "The port exposed by the SDN Controller."; - } - leaf controller-netconf-call-home-port { - type inet:port-number; - description - "The port exposed by the SDN Controller for NETCONF Call Home."; - } - leaf controller-username { - type string; - description - "The username for accessing the SDN Controller."; - } - leaf controller-password { - type string; - description - "The password for accessing the SDN Controller."; - } - } - - grouping ves-endpoint-g { - description - "Groups information about the VES Collector."; - leaf ves-endpoint-protocol { - type enumeration { - enum http { - description - "HTTP protocol will be used to connect to the VES Collector."; - } - enum https { - description - "HTTPS protocol will be used to connect to the VES Collector."; - } - } - default "https"; - description - "The protocol (HTTP / HTTPS) to be used to address the VES Collector."; - } - leaf ves-endpoint-ip { - type inet:ip-address; - description - "The IP address of the VES Collector."; - } - leaf ves-endpoint-port { - type inet:port-number; - description - "The port exposed by the VES Collector."; - } - leaf ves-endpoint-auth-method { - type authentication-method-type; - default "no-auth"; - description - "The type of the authentication to be used with the VES Collector."; - } - leaf ves-endpoint-username { - type string; - description - "The username for accessing the VES Collector."; - } - leaf ves-endpoint-password { - type string; - description - "The password for accessing the VES Collector."; - } - leaf ves-endpoint-certificate { - type string; - description - "The Certificate to be used to authenticate to the VES Collector."; - } - } - - grouping rpc-status-g { - description - "RPC output grouping."; - leaf status { - type enumeration { - enum SUCCESS { - description - "The RPC was successfully invoked."; - } - enum ERROR { - description - "An error was encountered when invoking the RPC."; - } - } - mandatory true; - description - "The status of the RPC."; - } - } -} diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common@2021-06-08.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common@2021-06-08.yang new file mode 100644 index 000000000..24b3a1725 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-common@2021-06-08.yang @@ -0,0 +1,447 @@ +module nts-common { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:common"; + prefix ntsc; + + import ietf-inet-types { + prefix inet; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains common yang definitions YANG definitions for the Network Topology Simulator."; + + revision 2021-06-08 { + description + "Moved NTS_PROTOCOL_TYPE_BASE identities from nts-manager."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-03-26 { + description + "Added controller-protocol."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-02-15 { + description + "Added presence to configuration containers."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-11-20 { + description + "Add feature-type for the Web cut through feature."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-10-22 { + description + "Add feature-type for the NETCONF Call Home feature."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-10-13 { + description + "Add feature-type typedef containing the features that can be activated in the Network Function."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-09-07 { + description + "Initial revision for the Network Topology Simulator - Next Generation common types."; + reference + "O-RAN-SC SIM project"; + } + + feature faults-status { + description + "This means that the server supports reporting back the number of faults that were generated"; + } + + identity NTS_PROTOCOL_TYPE_BASE { + description + "Base identity for protocol."; + } + + identity NTS_PROTOCOL_TYPE_NETCONF_SSH { + base NTS_PROTOCOL_TYPE_BASE; + description + "Identity for NETCONF SSH protocol."; + } + + identity NTS_PROTOCOL_TYPE_NETCONF_TLS { + base NTS_PROTOCOL_TYPE_BASE; + description + "Identity for NETCONF TLS protocol."; + } + + identity NTS_PROTOCOL_TYPE_FTP { + base NTS_PROTOCOL_TYPE_BASE; + description + "Identity for FTP protocol."; + } + + identity NTS_PROTOCOL_TYPE_SFTP { + base NTS_PROTOCOL_TYPE_BASE; + description + "Identity for SFTP protocol."; + } + + identity NTS_PROTOCOL_TYPE_HTTP { + base NTS_PROTOCOL_TYPE_BASE; + description + "Identity for HTTP protocol."; + } + + identity NTS_PROTOCOL_TYPE_HTTPS { + base NTS_PROTOCOL_TYPE_BASE; + description + "Identity for HTTPS protocol."; + } + + identity NTS_FUNCTION_TYPE_BASE { + description + "The reference of each identity represents the name of the associated docker image."; + } + + typedef authentication-method-type { + type enumeration { + enum "no-auth" { + description + "no security (http)"; + } + enum "cert-only" { + description + "auth by certificate (https)"; + } + enum "basic-auth" { + description + "auth by basic auth username and password (https)"; + } + enum "cert-basic-auth" { + description + "auth by certificate and basic auth username / password (https)"; + } + } + description + "The authentication method for VES messaging."; + } + + typedef feature-type { + type bits { + bit ves-file-ready { + position 0; + description + "Controls the ves-file-ready feature."; + } + bit ves-heartbeat { + position 1; + description + "Controls the ves-heartbeat feature."; + } + bit ves-pnf-registration { + position 2; + description + "Controls the ves-pnf-registration feature."; + } + bit manual-notification-generation { + position 3; + description + "Controls the manual notification generation feature."; + } + bit netconf-call-home { + position 4; + description + "Controls the NETCONF Call Home feature."; + } + bit web-cut-through { + position 5; + description + "Controls the Web Cut Through feature."; + } + } + description + "Describes the features that can be enabled/disabled in the Network Function."; + } + + grouping mount-point-details-g { + description + "Groups details about mount point"; + leaf mount-point-addressing-method { + type enumeration { + enum "host-mapping" { + description + "Uses IP and port mapped to the host machine to address the nework function."; + } + enum "docker-mapping" { + description + "Uses Docker IP and port to address the nework function."; + } + } + default "docker-mapping"; + description + "Specifies how to address the simulated network function: via the host machine or via docker."; + } + } + + grouping fault-delay-period-g { + description + "For reusing the same fault-delay-period."; + list fault-delay-list { + key "index"; + ordered-by user; + description + "The list defining the pattern for generating events."; + leaf index { + type uint16; + description + "The index of the list."; + } + + leaf delay-period { + type uint16; + units "s"; + description + "The amount of seconds before the next event."; + } + } + } + + grouping fault-count-g { + description + "Grouping for counting the fault events, grouped by severity."; + container fault-count { + if-feature "faults-status"; + config false; + description + "Container which groups the number of fault events, by severity."; + leaf normal { + type uint32; + description + "Number of normal (non-alarmed) events."; + } + + leaf warning { + type uint32; + description + "Number of warning events."; + } + + leaf minor { + type uint32; + description + "Number of minor events."; + } + + leaf major { + type uint32; + description + "Number of major events."; + } + + leaf critical { + type uint32; + description + "Number of critical events."; + } + } + } + + grouping faults-g { + description + "Grouping for fault generation"; + container fault-generation { + presence "Enables fault generation configuration."; + description + "Groups the fault generation configuration and status."; + uses fault-delay-period-g; + + uses fault-count-g; + } + } + + grouping faults-enabled-g { + description + "Groups the enabling of faults."; + leaf faults-enabled { + type boolean; + description + "For enabling the fault generation."; + } + } + + grouping netconf-config-g { + description + "Groups the configuration and status of NETCONF Fault notifications."; + container netconf { + presence "Enables NETCONF configuration."; + description + "Container for describing the NETCONF details."; + uses faults-enabled-g; + + leaf call-home { + type boolean; + description + "For enabling the NETCONF Call Home feature. If set to 'true', each simulated device, when booting up, will try to Call Home to the SDN Controller."; + } + } + } + + grouping ves-config-g { + description + "Groups the configuration and status of VES Fault notifications."; + container ves { + presence "Enables VES configuration."; + description + "Container for describing the VES details."; + uses faults-enabled-g; + + leaf pnf-registration { + type boolean; + description + "For enabling the PNF Registration messages. If set to 'true', each simulated device, when booting up, will send a PNF Registration message to the VES Collector."; + } + + leaf heartbeat-period { + type uint16; + description + "The number of seconds between VES heartbeat messages."; + } + } + } + + grouping controller-g { + description + "Groups information about the SDN Controller."; + leaf controller-protocol { + type enumeration { + enum "http" { + description + "HTTP protocol will be used to connect to the VES Collector."; + } + enum "https" { + description + "HTTPS protocol will be used to connect to the VES Collector."; + } + } + default "https"; + description + "The protocol used for communication with the SDN Controller."; + } + + leaf controller-ip { + type inet:host; + description + "The IP address of the SDN Controller."; + } + + leaf controller-port { + type inet:port-number; + description + "The port exposed by the SDN Controller."; + } + + leaf controller-netconf-call-home-port { + type inet:port-number; + description + "The port exposed by the SDN Controller for NETCONF Call Home."; + } + + leaf controller-username { + type string; + description + "The username for accessing the SDN Controller."; + } + + leaf controller-password { + type string; + description + "The password for accessing the SDN Controller."; + } + } + + grouping ves-endpoint-g { + description + "Groups information about the VES Collector."; + leaf ves-endpoint-protocol { + type enumeration { + enum "http" { + description + "HTTP protocol will be used to connect to the VES Collector."; + } + enum "https" { + description + "HTTPS protocol will be used to connect to the VES Collector."; + } + } + default "https"; + description + "The protocol (HTTP / HTTPS) to be used to address the VES Collector."; + } + + leaf ves-endpoint-ip { + type inet:host; + description + "The IP address of the VES Collector."; + } + + leaf ves-endpoint-port { + type inet:port-number; + description + "The port exposed by the VES Collector."; + } + + leaf ves-endpoint-auth-method { + type authentication-method-type; + default "no-auth"; + description + "The type of the authentication to be used with the VES Collector."; + } + + leaf ves-endpoint-username { + type string; + description + "The username for accessing the VES Collector."; + } + + leaf ves-endpoint-password { + type string; + description + "The password for accessing the VES Collector."; + } + + leaf ves-endpoint-certificate { + type string; + description + "The Certificate to be used to authenticate to the VES Collector."; + } + } + + grouping rpc-status-g { + description + "RPC output grouping."; + leaf status { + type enumeration { + enum "SUCCESS" { + description + "The RPC was successfully invoked."; + } + enum "ERROR" { + description + "An error was encountered when invoking the RPC."; + } + } + mandatory true; + description + "The status of the RPC."; + } + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-commscope-pac@2020-11-30.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-commscope-pac@2020-11-30.yang new file mode 100644 index 000000000..0e01d4bbe --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-commscope-pac@2020-11-30.yang @@ -0,0 +1,57 @@ +module nts-commscope-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:commscope"; + prefix nts-cscp; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - CommScope extensions."; + + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "CommScope OneCell implementaion."; + } + revision 2020-09-07 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "CommScope OneCell implementaion."; + } + + identity NTS_FUNCTION_TYPE_ONECELL_4_3 { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a CommScope OneCell version 4.3 YANG model."; + reference + "nts-ng-onecell-4-3"; + } + + identity NTS_FUNCTION_TYPE_ONECELL_4_5 { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a CommScope OneCell version 4.5 YANG model."; + reference + "nts-ng-onecell-4-5"; + } + + identity NTS_FUNCTION_TYPE_ONECELL_AUGMENT { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a CommScope OneCell Auugment YANG model."; + reference + "nts-ng-onecell-augment"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-development-pac@2021-05-05.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-development-pac@2021-05-05.yang new file mode 100644 index 000000000..baa5f7749 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-development-pac@2021-05-05.yang @@ -0,0 +1,55 @@ +module nts-development-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:development"; + prefix nts-dev; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - Development extensions."; + + revision 2021-05-05 { + description + "Added sepparate NTS_FUNCTION_TYPE_DEV/SANDBOX types."; + reference + "Development implementation"; + } + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "Development implementation"; + } + revision 2020-10-26 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "Development implementation"; + } + + identity NTS_FUNCTION_TYPE_DEV { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a dev YANG model."; + reference + "nts-ng-dev"; + } + + identity NTS_FUNCTION_TYPE_SANDBOX { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a dev sandbox YANG model."; + reference + "nts-ng-sandbox"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-kumu-pac@2020-11-30.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-kumu-pac@2020-11-30.yang new file mode 100644 index 000000000..a1a73af86 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-kumu-pac@2020-11-30.yang @@ -0,0 +1,41 @@ +module nts-kumu-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:kumu"; + prefix nts-kumu; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - KUMU Networks extensions."; + + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "KUMU Networks implementation"; + } + revision 2020-09-28 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "KUMU Networks implementation"; + } + + identity NTS_FUNCTION_TYPE_KUMU_RELAY { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a Kumu Networks YANG model."; + reference + "nts-ng-kumu"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager.yang deleted file mode 100644 index 5f7bc14cd..000000000 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager.yang +++ /dev/null @@ -1,403 +0,0 @@ -module nts-manager { - yang-version 1.1; - namespace "urn:o-ran-sc:params:xml:ns:yang:nts:manager"; - prefix nts-mng; - - import ietf-inet-types { - prefix inet; - } - import nts-common { - prefix ntsc; - } - - organization - "O-RAN-SC"; - contact - " Web: - Editors: - Alex Stancu - Adrian Lita - Martin Skorupski "; - description - "This module contains YANG definitions for the Network Topology Simulator - Manager."; - - revision 2021-03-26 { - description - "Added NTS_PROTOCOL_TYPE_BASE identities and changed instance/networking container; also added multi-base port support."; - reference - "O-RAN-SC SIM project"; - } - revision 2021-02-15 { - description - "Added notifications for sending feedback."; - reference - "O-RAN-SC SIM project"; - } - revision 2021-01-20 { - description - "Added available-network-functions."; - reference - "O-RAN-SC SIM project"; - } - revision 2020-11-30 { - description - "Cleared revision for nts-common import."; - reference - "O-RAN-SC SIM project"; - } - revision 2020-10-06 { - description - "Initial revision for the Network Topology Simulator - Next Generation"; - reference - "O-RAN-SC SIM project"; - } - - identity NTS_PROTOCOL_TYPE_BASE { - description - "Base identity for protocol."; - } - - identity NTS_PROTOCOL_TYPE_NETCONF_SSH { - base NTS_PROTOCOL_TYPE_BASE; - description - "Identity for NETCONF SSH protocol."; - } - - identity NTS_PROTOCOL_TYPE_NETCONF_TLS { - base NTS_PROTOCOL_TYPE_BASE; - description - "Identity for NETCONF TLS protocol."; - } - - identity NTS_PROTOCOL_TYPE_FTP { - base NTS_PROTOCOL_TYPE_BASE; - description - "Identity for FTP protocol."; - } - - identity NTS_PROTOCOL_TYPE_SFTP { - base NTS_PROTOCOL_TYPE_BASE; - description - "Identity for SFTP protocol."; - } - - identity NTS_PROTOCOL_TYPE_HTTP { - base NTS_PROTOCOL_TYPE_BASE; - description - "Identity for HTTP protocol."; - } - - identity NTS_PROTOCOL_TYPE_HTTPS { - base NTS_PROTOCOL_TYPE_BASE; - description - "Identity for HTTPS protocol."; - } - - typedef percent { - type decimal64 { - fraction-digits 2; - range "0 .. 100"; - } - description - "Percentage"; - } - - grouping instance-g { - description - "An instance of a network function which is running. The equivalent on the host machine is a docker container."; - leaf name { - type string; - description - "The name of the running instance. It is the same as the docker container name which exposes this network function."; - } - leaf is-mounted { - type boolean; - description - "Whether the instance is mounted or not to a controller."; - } - container networking { - description - "Groups the details about networking information."; - leaf docker-ip { - type inet:ip-address; - description - "The IP address of the docker container implementing the network function instance."; - } - list docker-ports { - key "port"; - description - "The ports which are exposed inside the docker container implementing the network function instance."; - leaf port { - type inet:port-number; - description - "Port number."; - } - leaf protocol { - type identityref { - base NTS_PROTOCOL_TYPE_BASE; - } - description - "Protocol attached to current port."; - } - } - leaf host-ip { - type inet:ip-address; - description - "The Host machine IP address pointing to the docker container implementing the network function instance."; - } - list host-ports { - key "port"; - description - "The Host machine ports mapped to the docker container implementing the network function instance."; - leaf port { - type inet:port-number; - description - "Port number."; - } - leaf protocol { - type identityref { - base NTS_PROTOCOL_TYPE_BASE; - } - description - "Protocol attached to current port."; - } - } - } - } - - grouping network-function-g { - description - "Contains all the details of a simulated device."; - leaf function-type { - type identityref { - base ntsc:NTS_FUNCTION_TYPE_BASE; - } - description - "Type of network function to be simulated."; - } - leaf started-instances { - type uint16; - mandatory true; - description - "How many instances of this type are started."; - } - leaf mounted-instances { - type uint16; - must '. <= ../started-instances' { - error-message "The number of mounted instances cannot be greater that the number of started instances."; - } - mandatory true; - description - "How many instances of this type are mounted in the SDN Controller."; - } - uses ntsc:mount-point-details-g; - leaf docker-instance-name { - type string; - mandatory true; - description - "The prefix of each docker container being started."; - } - leaf docker-version-tag { - type string; - mandatory true; - description - "The version tag of the docker image to be started."; - } - leaf docker-repository { - type string; - mandatory true; - description - "The prefix containing the docker repository information, if needed."; - } - uses ntsc:faults-g; - uses ntsc:netconf-config-g; - uses ntsc:ves-config-g; - container instances { - config false; - description - "Groups details about instances which are running."; - list instance { - key "name"; - description - "Describes a running instance."; - uses ntsc:mount-point-details-g; - uses instance-g; - } - } - } - - grouping simulation-information-g { - description - "Groups information about the simulation status."; - container ports { - config false; - description - "Contains information on ports used."; - leaf netconf-ssh-port { - type inet:port-number; - description - "The base Host machine port from where the simulation can allocate ports incrementally for NETCONF SSH protocol."; - } - leaf netconf-tls-port { - type inet:port-number; - description - "The base Host machine port from where the simulation can allocate ports incrementally for NETCONF TLS protocol."; - } - leaf transport-ftp-port { - type inet:port-number; - description - "The base Host machine port from where the simulation can allocate ports incrementally for FTP protocol."; - } - leaf transport-sftp-port { - type inet:port-number; - description - "The base Host machine port from where the simulation can allocate ports incrementally for SFTP protocol."; - } - } - leaf ssh-connections { - type uint8; - config false; - description - "The number of SSH Endpoints each network function instance exposes."; - } - leaf tls-connections { - type uint8; - config false; - description - "The number of TLS Endpoints each network function instance exposes."; - } - leaf cpu-usage { - type percent; - config false; - description - "Specifies the CPU load generated by the simulation."; - } - leaf mem-usage { - type uint32; - config false; - description - "Specifies the RAM in MB used by the simulation."; - } - leaf last-operation-status { - type string; - config false; - description - "Specifies the status of the most recent operation performed by the Manager."; - } - } - - grouping network-function-image-g { - description - "Groups details about a NF docker image."; - leaf function-type { - type identityref { - base ntsc:NTS_FUNCTION_TYPE_BASE; - } - config false; - description - "Type of network function to be simulated."; - } - leaf docker-image-name { - type string; - config false; - mandatory true; - description - "The prefix of each docker container being started."; - } - leaf docker-version-tag { - type string; - config false; - mandatory true; - description - "The version tag of the docker image to be started."; - } - leaf docker-repository { - type string; - config false; - mandatory true; - description - "The prefix containing the docker repository information, if needed."; - } - } - - notification instance-changed { - description - "Sent by the Manager every time something occurs in any of the simulated NF instances."; - leaf change-status { - type string; - mandatory true; - description - "The status of the change which was executed to the NF instance."; - } - leaf function-type { - type identityref { - base ntsc:NTS_FUNCTION_TYPE_BASE; - } - mandatory true; - description - "Type of the NF instance."; - } - uses instance-g { - refine "name" { - mandatory true; - } - } - } - - notification operation-status-changed { - description - "Sent by the Manager every time a user operation is finished."; - leaf operation-status { - type string; - mandatory true; - description - "The status of the operation which was executed by the Manager."; - } - leaf error-message { - type string; - description - "Detailed error message from the Manager."; - } - } - - container simulation { - presence "Enables simulation configuration."; - description - "Root level container which controls the NTS."; - container available-images { - config false; - description - "Container which encompasses all NF docker images available on the host machine."; - list network-function-image { - description - "List containing available network function docker images and their respective details."; - uses network-function-image-g; - } - } - container network-functions { - presence "Enables NF configuration."; - description - "Container which encompasses all simulated network functions."; - list network-function { - key "function-type"; - unique "docker-instance-name"; - description - "List containing different simulated network function types and their details."; - uses network-function-g; - } - } - container sdn-controller { - presence "Enables SDN Controller detail configuration."; - description - "Groups details about the SDN Controller."; - uses ntsc:controller-g; - } - container ves-endpoint { - presence "Enables VES endpoint detail configuration."; - description - "Groups details about the VES Collector endpoint."; - uses ntsc:ves-endpoint-g; - } - uses simulation-information-g; - } -} diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager@2021-06-08.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager@2021-06-08.yang new file mode 100644 index 000000000..69a92d8e1 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-manager@2021-06-08.yang @@ -0,0 +1,406 @@ +module nts-manager { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:manager"; + prefix nts-mng; + + import ietf-inet-types { + prefix inet; + } + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - Manager."; + + revision 2021-06-08 { + description + "Moved NTS_PROTOCOL_TYPE_BASE identities to nts-common."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-03-26 { + description + "Added NTS_PROTOCOL_TYPE_BASE identities and changed instance/networking container; also added multi-base port support."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-02-15 { + description + "Added notifications for sending feedback."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-01-20 { + description + "Added available-network-functions."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-10-06 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "O-RAN-SC SIM project"; + } + + typedef percent { + type decimal64 { + fraction-digits 2; + range "0 .. 100"; + } + description + "Percentage"; + } + + grouping instance-g { + description + "An instance of a network function which is running. The equivalent on the host machine is a docker container."; + leaf name { + type string; + description + "The name of the running instance. It is the same as the docker container name which exposes this network function."; + } + + leaf is-mounted { + type boolean; + description + "Whether the instance is mounted or not to a controller."; + } + + container networking { + description + "Groups the details about networking information."; + leaf docker-ip { + type inet:ip-address; + description + "The IP address of the docker container implementing the network function instance."; + } + + list docker-ports { + key "port"; + description + "The ports which are exposed inside the docker container implementing the network function instance."; + leaf port { + type inet:port-number; + description + "Port number."; + } + + leaf protocol { + type identityref { + base ntsc:NTS_PROTOCOL_TYPE_BASE; + } + description + "Protocol attached to current port."; + } + } + + leaf host-ip { + type inet:ip-address; + description + "The Host machine IP address pointing to the docker container implementing the network function instance."; + } + + list host-ports { + key "port"; + description + "The Host machine ports mapped to the docker container implementing the network function instance."; + leaf port { + type inet:port-number; + description + "Port number."; + } + + leaf protocol { + type identityref { + base ntsc:NTS_PROTOCOL_TYPE_BASE; + } + description + "Protocol attached to current port."; + } + } + } + } + + grouping network-function-g { + description + "Contains all the details of a simulated device."; + leaf function-type { + type identityref { + base ntsc:NTS_FUNCTION_TYPE_BASE; + } + description + "Type of network function to be simulated."; + } + + leaf started-instances { + type uint16; + mandatory true; + description + "How many instances of this type are started."; + } + + leaf mounted-instances { + type uint16; + must ". <= ../started-instances" { + error-message + "The number of mounted instances cannot be greater that the number of started instances."; + } + mandatory true; + description + "How many instances of this type are mounted in the SDN Controller."; + } + + uses ntsc:mount-point-details-g; + + leaf docker-instance-name { + type string; + mandatory true; + description + "The prefix of each docker container being started."; + } + + leaf docker-version-tag { + type string; + mandatory true; + description + "The version tag of the docker image to be started."; + } + + leaf docker-repository { + type string; + mandatory true; + description + "The prefix containing the docker repository information, if needed."; + } + + uses ntsc:faults-g; + + uses ntsc:netconf-config-g; + + uses ntsc:ves-config-g; + + container instances { + config false; + description + "Groups details about instances which are running."; + list instance { + key "name"; + description + "Describes a running instance."; + uses ntsc:mount-point-details-g; + + uses instance-g; + } + } + } + + grouping simulation-information-g { + description + "Groups information about the simulation status."; + container ports { + config false; + description + "Contains information on ports used."; + leaf netconf-ssh-port { + type inet:port-number; + description + "The base Host machine port from where the simulation can allocate ports incrementally for NETCONF SSH protocol."; + } + + leaf netconf-tls-port { + type inet:port-number; + description + "The base Host machine port from where the simulation can allocate ports incrementally for NETCONF TLS protocol."; + } + + leaf transport-ftp-port { + type inet:port-number; + description + "The base Host machine port from where the simulation can allocate ports incrementally for FTP protocol."; + } + + leaf transport-sftp-port { + type inet:port-number; + description + "The base Host machine port from where the simulation can allocate ports incrementally for SFTP protocol."; + } + } + + leaf ssh-connections { + type uint8; + config false; + description + "The number of SSH Endpoints each network function instance exposes."; + } + + leaf tls-connections { + type uint8; + config false; + description + "The number of TLS Endpoints each network function instance exposes."; + } + + leaf cpu-usage { + type percent; + config false; + description + "Specifies the CPU load generated by the simulation."; + } + + leaf mem-usage { + type uint32; + config false; + description + "Specifies the RAM in MB used by the simulation."; + } + + leaf last-operation-status { + type string; + config false; + description + "Specifies the status of the most recent operation performed by the Manager."; + } + } + + grouping network-function-image-g { + description + "Groups details about a NF docker image."; + leaf function-type { + type identityref { + base ntsc:NTS_FUNCTION_TYPE_BASE; + } + config false; + description + "Type of network function to be simulated."; + } + + leaf docker-image-name { + type string; + config false; + mandatory true; + description + "The prefix of each docker container being started."; + } + + leaf docker-version-tag { + type string; + config false; + mandatory true; + description + "The version tag of the docker image to be started."; + } + + leaf docker-repository { + type string; + config false; + mandatory true; + description + "The prefix containing the docker repository information, if needed."; + } + } + + container simulation { + presence "Enables simulation configuration."; + description + "Root level container which controls the NTS."; + container available-images { + config false; + description + "Container which encompasses all NF docker images available on the host machine."; + list network-function-image { + description + "List containing available network function docker images and their respective details."; + uses network-function-image-g; + } + } + + container network-functions { + presence "Enables NF configuration."; + description + "Container which encompasses all simulated network functions."; + list network-function { + key "function-type"; + unique "docker-instance-name"; + description + "List containing different simulated network function types and their details."; + uses network-function-g; + } + } + + container sdn-controller { + presence "Enables SDN Controller detail configuration."; + description + "Groups details about the SDN Controller."; + uses ntsc:controller-g; + } + + container ves-endpoint { + presence "Enables VES endpoint detail configuration."; + description + "Groups details about the VES Collector endpoint."; + uses ntsc:ves-endpoint-g; + } + + uses simulation-information-g; + } + + notification instance-changed { + description + "Sent by the Manager every time something occurs in any of the simulated NF instances."; + leaf change-status { + type string; + mandatory true; + description + "The status of the change which was executed to the NF instance."; + } + + leaf function-type { + type identityref { + base ntsc:NTS_FUNCTION_TYPE_BASE; + } + mandatory true; + description + "Type of the NF instance."; + } + + uses instance-g { + refine "name" { + mandatory true; + } + } + } + + notification operation-status-changed { + description + "Sent by the Manager every time a user operation is finished."; + leaf operation-status { + type string; + mandatory true; + description + "The status of the operation which was executed by the Manager."; + } + + leaf error-message { + type string; + description + "Detailed error message from the Manager."; + } + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-mavenir-pac@2020-11-30.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-mavenir-pac@2020-11-30.yang new file mode 100644 index 000000000..6feccf66a --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-mavenir-pac@2020-11-30.yang @@ -0,0 +1,49 @@ +module nts-mavenir-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:mavenir"; + prefix nts-mvn; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - Mavenir extensions."; + + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "Mavenir implemenation."; + } + revision 2020-09-07 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "Mavenir implemenation."; + } + + identity NTS_FUNCTION_TYPE_MAVENIR_ENBCU { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a Mavenir eNodeB-CU YANG model."; + reference + "nts-ng-mavenir-enbcu"; + } + + identity NTS_FUNCTION_TYPE_MAVENIR_ENBDU { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a Mavenir eNodeB-DU YANG model."; + reference + "nts-ng-mavenir-enbdu"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-network-function@2021-06-18.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-network-function@2021-06-18.yang new file mode 100644 index 000000000..f8e39ef2d --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-network-function@2021-06-18.yang @@ -0,0 +1,497 @@ +module nts-network-function { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:network:function"; + prefix ntsnf; + + import ietf-inet-types { + prefix inet; + } + + import nts-common { + prefix ntsc; + } + + import ietf-yang-types { + prefix yang; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - Network Functions"; + + revision 2021-06-18 { + description + "Added test-list for NETCONF hardware delay emulation."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-06-14 { + description + "Added total loss network emulation RPC and NETCONF write-delay emulation."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-06-08 { + description + "Added more info and NETCONF latency emulation."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-05-17 { + description + "Added support for network emulation."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-03-26 { + description + "Added info container, and expanted feature control mechanism and status."; + reference + "O-RAN-SC SIM project"; + } + revision 2021-03-17 { + description + "Renamed datastore-random-populate RPC to datastore-populate"; + reference + "O-RAN-SC SIM project"; + } + revision 2020-12-11 { + description + "Added function-type to simulated function."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-10-28 { + description + "Add RPC for clearing the fault counters."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-10-13 { + description + "Add RPC for datastore populating and feature control."; + reference + "O-RAN-SC SIM project"; + } + revision 2020-09-07 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "O-RAN-SC SIM project"; + } + + container info { + config false; + description + "Information about NTS application and modules."; + leaf build-time { + type yang:date-and-time; + description + "Build time of NTS application."; + } + + leaf version { + type string; + description + "NTS version of current network-function."; + } + + leaf started-features { + type ntsc:feature-type; + description + "A bit-wise list with currently started features."; + } + + leaf ssh-connections { + type uint8; + config false; + description + "The number of SSH Endpoints the network function instance exposes."; + } + + leaf tls-connections { + type uint8; + config false; + description + "The number of TLS Endpoints the network function instance exposes."; + } + + leaf hostname { + type string; + description + "Current network function hostname."; + } + + list docker-ports { + key "port"; + description + "The ports which are exposed inside the docker container implementing this network function instance."; + leaf port { + type inet:port-number; + description + "Port number."; + } + + leaf protocol { + type identityref { + base ntsc:NTS_PROTOCOL_TYPE_BASE; + } + description + "Protocol attached to current port."; + } + } + } + + container simulation { + description + "Root level container which controls the Network Function."; + container network-function { + description + "Container which encompasses the details of the network function."; + leaf function-type { + type string; + description + "Type of network function that is simulated."; + } + + uses ntsc:mount-point-details-g; + + uses ntsc:faults-g; + + uses ntsc:netconf-config-g; + + uses ntsc:ves-config-g; + } + + container network-emulation { + description + "Container which encompasses the details of the network emulation."; + leaf limit { + type uint16 { + range "16 .. max"; + } + units "packets"; + default "1000"; + description + "Maximum number of packets the qdisc may hold queued at a time."; + } + + container delay { + description + "Adds the chosen delay to the packets outgoing to chosen network interface."; + leaf time { + type uint16; + units "miliseconds (ms)"; + description + "Delay time between packets."; + } + + leaf jitter { + type uint16; + units "miliseconds (ms)"; + description + "Delay jitter."; + } + + leaf correlation { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Delay correlation."; + } + + leaf distribution { + type enumeration { + enum "uniform" { + description + "Uniform delay distribution."; + } + enum "normal" { + description + "Normal delay distribution."; + } + enum "pareto" { + description + "Pareto delay distribution."; + } + enum "paretonormal" { + description + "Paretonormal delay distribution."; + } + } + description + "Delay distribution."; + } + } + + leaf loss { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Adds an independent loss probability to the packets outgoing from the chosen network interface."; + } + + container corruption { + description + "Allows the emulation of random noise introducing an error in a random position for a chosen percent of packets."; + leaf percentage { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Corruption percentage."; + } + + leaf correlation { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Corruption correlation."; + } + } + + container duplication { + description + "Using this option the chosen percent of packets is duplicated before queuing them."; + leaf percentage { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Duplication percentage."; + } + + leaf correlation { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Duplication correlation."; + } + } + + container reordering { + description + "Used together with delay; a percentage of packets are sent immediately (with defined correlation) while the others are delayed (by specified delay)."; + leaf percentage { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Reordering percentage."; + } + + leaf correlation { + type uint8 { + range "0 .. 100"; + } + units "percentage"; + description + "Reordering correlation."; + } + } + + leaf rate { + type uint16; + units "kbits"; + description + "Delay packets based on packet size."; + } + } + + container hardware-emulation { + description + "Container which encompasses the details of hardware emulation."; + container netconf-delay { + description + "Emulates delay on an operational leaf."; + leaf delay { + type uint32; + units "miliseconds (ms)"; + default "0"; + description + "Delay time to be set for get operation on test leaf."; + } + + leaf get-test { + type uint32; + units "miliseconds (ms)"; + config false; + description + "Read to test. Value represents emulated delay."; + } + + leaf edit-test { + type uint32; + units "miliseconds (ms)"; + description + "Writing non-null value will emulate a write-delay."; + } + + list get-test-list { + config false; + description + "Read to test. Returned values are saved from edit-test-list."; + leaf value { + type string; + description + "Values from edit-test-list."; + } + } + + list edit-test-list { + key "value"; + description + "Write to test."; + leaf value { + type string; + description + "Unique values for testing."; + } + } + } + } + + container sdn-controller { + description + "Groups details about the SDN Controller."; + uses ntsc:controller-g; + } + + container ves-endpoint { + description + "Groups details about the VES Collector endpoint."; + uses ntsc:ves-endpoint-g; + } + } + + rpc datastore-populate { + description + "Operation to populate the datastore with data for all the containing YANG models, based on settings in config.json"; + + output { + uses ntsc:rpc-status-g; + } + } + + rpc feature-control { + description + "Operation to control the features in a Network Function."; + input { + leaf start-features { + type ntsc:feature-type; + description + "A bit-wise list with features to be activated."; + } + + leaf stop-features { + type ntsc:feature-type; + description + "A bit-wise list with features to be deactivated."; + } + } + + output { + uses ntsc:rpc-status-g; + } + } + + rpc invoke-notification { + description + "Operation to control the features in a Network Function."; + input { + leaf notification-format { + type enumeration { + enum "xml" { + description + "The notification string is formatted as XML."; + } + enum "json" { + description + "The notification string is formatted as JSON."; + } + } + mandatory true; + description + "The format of the notification string."; + } + + leaf notification-object { + type string; + mandatory true; + description + "A JSON string containing the notification object to be sent by the device."; + } + } + + output { + uses ntsc:rpc-status-g; + } + } + + rpc invoke-ves-pm-file-ready { + description + "Operation to generate a VES notification from a Network Function."; + input { + leaf file-location { + type string; + mandatory true; + description + "A string containing the location of the file on the server."; + } + } + + output { + uses ntsc:rpc-status-g; + } + } + + rpc clear-fault-counters { + description + "Operation to clear the fault counters."; + + output { + uses ntsc:rpc-status-g; + } + } + + rpc emulate-total-loss { + description + "Operation to emulate 100% loss in network packets. Operation will resume after specified timeout."; + input { + leaf timeout { + type uint32; + units "miliseconds (ms)"; + description + "Period after which loss will stop being 100%."; + } + } + + output { + uses ntsc:rpc-status-g; + } + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-fh-pac@2021-05-05.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-fh-pac@2021-05-05.yang new file mode 100644 index 000000000..84eee2f87 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-fh-pac@2021-05-05.yang @@ -0,0 +1,47 @@ +module nts-o-ran-fh-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:o-ran-fh"; + prefix nts-o-ran-fh; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - O-RAN extensions."; + + revision 2021-05-05 { + description + "Changed name to o-ran-fh."; + reference + "O-RAN-FH implementation"; + } + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "O-RAN implementation"; + } + revision 2020-10-26 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "O-RAN implementation"; + } + + identity NTS_FUNCTION_TYPE_O_RAN_FH { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements O-RAN FrontHaul (O1) YANG models."; + reference + "nts-ng-o-ran-fh"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-o1-pac@2021-05-05.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-o1-pac@2021-05-05.yang new file mode 100644 index 000000000..85acd90e1 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-o-ran-o1-pac@2021-05-05.yang @@ -0,0 +1,35 @@ +module nts-o-ran-o1-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:o-ran-o1"; + prefix nts-o-ran-o1; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - O-RAN O1 interface."; + + revision 2021-05-05 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "O-RAN-O1 implementation"; + } + + identity NTS_FUNCTION_TYPE_O_RAN_O1 { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements a O-RAN O1 interface YANG model."; + reference + "nts-ng-o-ran-o1"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-onf-pac@2020-11-30.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-onf-pac@2020-11-30.yang new file mode 100644 index 000000000..96c103191 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-onf-pac@2020-11-30.yang @@ -0,0 +1,49 @@ +module nts-onf-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:onf"; + prefix nts-onf; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - ONF extensions."; + + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "ONF implementation"; + } + revision 2020-10-26 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "ONF implementation"; + } + + identity NTS_FUNCTION_TYPE_ONF_CORE_MODEL_1_2 { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated network function implements ONF Core Model version 1.2 YANG models."; + reference + "nts-ng-onf-core-1-2"; + } + + identity NTS_FUNCTION_TYPE_ONF_CORE_MODEL_1_4 { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated device implements ONF Core Model version 1.4 YANG models."; + reference + "nts-ng-onf-core-1-4"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-openroadm-pac@2020-11-30.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-openroadm-pac@2020-11-30.yang new file mode 100644 index 000000000..185b1de72 --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-openroadm-pac@2020-11-30.yang @@ -0,0 +1,49 @@ +module nts-openroadm-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:openroadm"; + prefix nts-openroadm; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - OpenROADM extensions."; + + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "OpenROADM implementation"; + } + revision 2020-10-26 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "OpenROADM implementation"; + } + + identity NTS_FUNCTION_TYPE_OPENROADM_2_2_1 { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated device implements OpenROADM version 2.2.1 YANG models."; + reference + "nts-ng-openroadm-2.2.1"; + } + + identity NTS_FUNCTION_TYPE_OPENROADM_6_1_0 { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated device implements OpenROADM version 6.1.0 YANG models."; + reference + "nts-ng-openroadm-6.1.0"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-x-ran-pac@2020-11-30.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-x-ran-pac@2020-11-30.yang new file mode 100644 index 000000000..531d51fbe --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-x-ran-pac@2020-11-30.yang @@ -0,0 +1,41 @@ +module nts-x-ran-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:x-ran"; + prefix nts-x-ran; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - X-RAN extensions."; + + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "X-RAN implementation"; + } + revision 2020-10-26 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "X-RAN implementation"; + } + + identity NTS_FUNCTION_TYPE_X_RAN { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated device implements X-RAN YANG models."; + reference + "nts-ng-x-ran"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-yes-pac@2020-11-30.yang b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-yes-pac@2020-11-30.yang new file mode 100644 index 000000000..58b21e6fc --- /dev/null +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/main/yang/nts-yes-pac@2020-11-30.yang @@ -0,0 +1,41 @@ +module nts-yes-pac { + yang-version 1.1; + namespace "urn:o-ran-sc:params:xml:ns:yang:nts:yes"; + prefix nts-yes; + + import nts-common { + prefix ntsc; + } + + organization + "O-RAN-SC"; + contact + " Web: + Editors: + Alex Stancu + Adrian Lita + Martin Skorupski "; + description + "This module contains YANG definitions for the Network Topology Simulator - YES extensions."; + + revision 2020-11-30 { + description + "Cleared revision for nts-common import."; + reference + "YES implementation"; + } + revision 2020-10-26 { + description + "Initial revision for the Network Topology Simulator - Next Generation"; + reference + "YES implementation"; + } + + identity NTS_FUNCTION_TYPE_YES { + base ntsc:NTS_FUNCTION_TYPE_BASE; + description + "The simulated device implements YES YANG models."; + reference + "nts-ng-yes"; + } +} \ No newline at end of file diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java index d067d538f..5b4306093 100644 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java @@ -33,7 +33,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServic 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.yang.gen.v1.urn.onf.params.xml.ns.yang.network.topology.simulator.rev191025.SimulatorStatus; +import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.simulation.NetworkFunctions; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yangtools.yang.common.QName; @@ -55,6 +55,7 @@ public class TestAdapterManagerNetworkElement { when(accessor.getCapabilites()).thenReturn(capabilities); when(accessor.getNodeId()).thenReturn(nNodeId); when(accessor.getTransactionUtils()).thenReturn(mock(TransactionUtils.class)); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(accessor)); DataProvider dataProvider = mock(DataProvider.class); when(serviceProvider.getDataProvider()).thenReturn(dataProvider); @@ -63,10 +64,10 @@ public class TestAdapterManagerNetworkElement { @Test public void test() { Optional adapterManagerNe; - when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(true); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkFunctions.QNAME)).thenReturn(true); AdapterManagerNetworkElementFactory factory = new AdapterManagerNetworkElementFactory(); adapterManagerNe = factory.create(accessor, serviceProvider); - assertTrue(factory.create(accessor, serviceProvider).isPresent()); + assertTrue(adapterManagerNe.isPresent()); adapterManagerNe.get().register(); adapterManagerNe.get().deregister(); adapterManagerNe.get().getAcessor(); diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java index fce5f6b88..9f67e188e 100644 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java @@ -17,10 +17,12 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.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; @@ -28,7 +30,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.impl.Adapter 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.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.network.topology.simulator.rev191025.SimulatorStatus; +import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.simulation.NetworkFunctions; import org.opendaylight.yangtools.yang.common.QName; public class TestAdapterManagerNetworkElementFactory { @@ -45,23 +47,22 @@ public class TestAdapterManagerNetworkElementFactory { serviceProvider = mock(DeviceManagerServiceProvider.class); when(accessor.getCapabilites()).thenReturn(capabilities); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(accessor)); when(serviceProvider.getDataProvider()).thenReturn(null); - - } @Test public void testCreateSimulator() throws Exception { - when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(true); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkFunctions.QNAME)).thenReturn(true); AdapterManagerNetworkElementFactory factory = new AdapterManagerNetworkElementFactory(); assertTrue(factory.create(accessor, serviceProvider).isPresent()); } @Test public void testCreateNone() throws Exception { - when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkFunctions.QNAME)).thenReturn(false); AdapterManagerNetworkElementFactory factory = new AdapterManagerNetworkElementFactory(); - assertTrue(!(factory.create(accessor, serviceProvider).isPresent())); + assertFalse(factory.create(accessor, serviceProvider).isPresent()); } @After -- cgit 1.2.3-korg