diff options
18 files changed, 1256 insertions, 122 deletions
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<NetworkElement> 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<NetconfBindingAccessor> 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<NotificationListener> 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@2021-06-08.yang index 86d7b3e8a..24b3a1725 100644 --- 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@2021-06-08.yang @@ -18,6 +18,12 @@ module nts-common { 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."; @@ -60,6 +66,47 @@ module nts-common { "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."; @@ -67,19 +114,19 @@ module nts-common { typedef authentication-method-type { type enumeration { - enum no-auth { + enum "no-auth" { description "no security (http)"; } - enum cert-only { + enum "cert-only" { description "auth by certificate (https)"; } - enum basic-auth { + enum "basic-auth" { description "auth by basic auth username and password (https)"; } - enum cert-basic-auth { + enum "cert-basic-auth" { description "auth by certificate and basic auth username / password (https)"; } @@ -130,11 +177,11 @@ module nts-common { "Groups details about mount point"; leaf mount-point-addressing-method { type enumeration { - enum host-mapping { + enum "host-mapping" { description "Uses IP and port mapped to the host machine to address the nework function."; } - enum docker-mapping { + enum "docker-mapping" { description "Uses Docker IP and port to address the nework function."; } @@ -158,6 +205,7 @@ module nts-common { description "The index of the list."; } + leaf delay-period { type uint16; units "s"; @@ -180,21 +228,25 @@ module nts-common { 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 @@ -211,6 +263,7 @@ module nts-common { description "Groups the fault generation configuration and status."; uses fault-delay-period-g; + uses fault-count-g; } } @@ -233,6 +286,7 @@ module nts-common { description "Container for describing the NETCONF details."; uses faults-enabled-g; + leaf call-home { type boolean; description @@ -249,11 +303,13 @@ module nts-common { 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 @@ -267,11 +323,11 @@ module nts-common { "Groups information about the SDN Controller."; leaf controller-protocol { type enumeration { - enum http { + enum "http" { description "HTTP protocol will be used to connect to the VES Collector."; } - enum https { + enum "https" { description "HTTPS protocol will be used to connect to the VES Collector."; } @@ -280,26 +336,31 @@ module nts-common { description "The protocol used for communication with the SDN Controller."; } + leaf controller-ip { - type inet:ip-address; + 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 @@ -312,11 +373,11 @@ module nts-common { "Groups information about the VES Collector."; leaf ves-endpoint-protocol { type enumeration { - enum http { + enum "http" { description "HTTP protocol will be used to connect to the VES Collector."; } - enum https { + enum "https" { description "HTTPS protocol will be used to connect to the VES Collector."; } @@ -325,32 +386,38 @@ module nts-common { description "The protocol (HTTP / HTTPS) to be used to address the VES Collector."; } + leaf ves-endpoint-ip { - type inet:ip-address; + 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 @@ -363,11 +430,11 @@ module nts-common { "RPC output grouping."; leaf status { type enumeration { - enum SUCCESS { + enum "SUCCESS" { description "The RPC was successfully invoked."; } - enum ERROR { + enum "ERROR" { description "An error was encountered when invoking the RPC."; } @@ -377,4 +444,4 @@ module nts-common { "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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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@2021-06-08.yang index 5f7bc14cd..69a92d8e1 100644 --- 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@2021-06-08.yang @@ -6,6 +6,7 @@ module nts-manager { import ietf-inet-types { prefix inet; } + import nts-common { prefix ntsc; } @@ -21,6 +22,12 @@ module nts-manager { 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."; @@ -52,47 +59,6 @@ module nts-manager { "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; @@ -110,11 +76,13 @@ module nts-manager { 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."; @@ -123,6 +91,7 @@ module nts-manager { description "The IP address of the docker container implementing the network function instance."; } + list docker-ports { key "port"; description @@ -132,19 +101,22 @@ module nts-manager { description "Port number."; } + leaf protocol { type identityref { - base NTS_PROTOCOL_TYPE_BASE; + 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 @@ -154,9 +126,10 @@ module nts-manager { description "Port number."; } + leaf protocol { type identityref { - base NTS_PROTOCOL_TYPE_BASE; + base ntsc:NTS_PROTOCOL_TYPE_BASE; } description "Protocol attached to current port."; @@ -175,43 +148,54 @@ module nts-manager { 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."; + 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 @@ -221,6 +205,7 @@ module nts-manager { description "Describes a running instance."; uses ntsc:mount-point-details-g; + uses instance-g; } } @@ -238,46 +223,54 @@ module nts-manager { 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; @@ -297,6 +290,7 @@ module nts-manager { description "Type of network function to be simulated."; } + leaf docker-image-name { type string; config false; @@ -304,6 +298,7 @@ module nts-manager { description "The prefix of each docker container being started."; } + leaf docker-version-tag { type string; config false; @@ -311,6 +306,7 @@ module nts-manager { description "The version tag of the docker image to be started."; } + leaf docker-repository { type string; config false; @@ -320,46 +316,6 @@ module nts-manager { } } - 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 @@ -374,6 +330,7 @@ module nts-manager { uses network-function-image-g; } } + container network-functions { presence "Enables NF configuration."; description @@ -386,18 +343,64 @@ module nts-manager { 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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: <https://wiki.o-ran-sc.org/display/SIM/SIM> + Editors: + Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com> + Adrian Lita <mailto:adrian.lita@highstreet-technologies.com> + Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>"; + 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<NetworkElement> 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 |