summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-adapter-manager/provider/src
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-02-03 15:16:43 +0100
committerDan Timoney <dtimoney@att.com>2021-02-05 22:57:19 +0000
commitf2b7adc8df29246e154011293c7a4afdd242df60 (patch)
tree1ae3829f1b51c030f74c13619d62268b66948269 /sdnr/wt/devicemanager-adapter-manager/provider/src
parent95264d6d078e4d07e147369b007ae2c9791769c8 (diff)
Migrate devicemanager-adapter-manager and devicemanager-onf
Migrate devicemanager-adapter-manager and devicemanager-onf to Aluminium Issue-ID: CCSDK-3133 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: I172bd97c0a79f0ee80bf27326dc39b38e306102a Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-adapter-manager/provider/src')
-rw-r--r--sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java3
-rw-r--r--sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/DeviceManagerAdapterManagerImpl.java2
-rw-r--r--sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-common.yang354
-rw-r--r--sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-manager.yang202
-rw-r--r--sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/mock/NetconfAccessorMock.java31
5 files changed, 589 insertions, 3 deletions
diff --git a/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java
index db9fd94b1..0ed856fb1 100644
--- a/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java
+++ b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/AdapterManagerNetworkElementFactory.java
@@ -24,6 +24,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.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.rev201006.simulation.NetworkFunctions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,7 +34,7 @@ public class AdapterManagerNetworkElementFactory implements NetworkElementFactor
@Override
public Optional<NetworkElement> create(NetconfAccessor acessor, DeviceManagerServiceProvider serviceProvider) {
- if (acessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)) {
+ 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()));
}
diff --git a/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/DeviceManagerAdapterManagerImpl.java b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/DeviceManagerAdapterManagerImpl.java
index 33ad9c0ed..3a7aa8f40 100644
--- a/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/DeviceManagerAdapterManagerImpl.java
+++ b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/impl/DeviceManagerAdapterManagerImpl.java
@@ -48,7 +48,7 @@ public class DeviceManagerAdapterManagerImpl implements AutoCloseable {
LOG.info("Session Initiated start {}", APPLICATION_NAME);
- resAdapterManager = netconfNetworkElementService.registerNetworkElementFactory(new AdapterManagerNetworkElementFactory());
+ resAdapterManager = netconfNetworkElementService.registerBindingNetworkElementFactory(new AdapterManagerNetworkElementFactory());
netconfNetworkElementService.writeToEventLog(APPLICATION_NAME, "startup", "done");
diff --git a/sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-common.yang b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-common.yang
new file mode 100644
index 000000000..ea7e60b91
--- /dev/null
+++ b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-common.yang
@@ -0,0 +1,354 @@
+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: <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 common yang definitions YANG definitions for the Network Topology Simulator.";
+
+ 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";
+ }
+
+ 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.";
+ }
+
+ identity NTS_FUNCTION_TYPE_BASE {
+ description
+ "The reference of each identity represents the name of the associated docker image.";
+ }
+
+ grouping mount-point-details-g {
+ 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.";
+ }
+ description
+ "Groups details about mount point";
+ }
+
+ grouping fault-delay-period-g {
+ list fault-delay-list {
+ key index;
+ ordered-by user;
+ 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.";
+ }
+ description
+ "The list defining the pattern for generating events.";
+ }
+ description
+ "For reusing the same fault-delay-period.";
+ }
+
+ grouping fault-count-g {
+ container fault-count {
+ if-feature faults-status;
+ config false;
+ 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.";
+ }
+ description
+ "Container which groups the number of fault events, by severity.";
+ }
+ description
+ "Grouping for counting the fault events, grouped by severity.";
+ }
+
+ grouping faults-g {
+ container fault-generation {
+ uses fault-delay-period-g;
+ uses fault-count-g;
+ description
+ "Groups the fault generation configuration and status.";
+ }
+ description
+ "Grouping for fault generation";
+ }
+
+ grouping faults-enabled-g {
+ leaf faults-enabled {
+ type boolean;
+ description
+ "For enabling the fault generation.";
+ }
+ description
+ "Groups the enabling of faults.";
+ }
+
+ grouping netconf-config-g {
+ container netconf {
+ 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.";
+ }
+ description
+ "Container for describing the NETCONF details.";
+ }
+ description
+ "Groups the configuration and status of NETCONF Fault notifications.";
+ }
+
+ grouping ves-config-g {
+ container ves {
+ 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.";
+ }
+ description
+ "Container for describing the VES details.";
+ }
+ description
+ "Groups the configuration and status of VES Fault notifications.";
+ }
+
+ grouping controller-g {
+ 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.";
+ }
+ description
+ "Groups information about the SDN Controller.";
+ }
+
+ grouping ves-endpoint-g {
+ 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.";
+ }
+ description
+ "Groups information about the VES Collector.";
+ }
+
+ grouping rpc-status-g {
+ 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.";
+ }
+ description
+ "RPC output grouping.";
+ }
+
+} //end module \ No newline at end of file
diff --git a/sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-manager.yang b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-manager.yang
new file mode 100644
index 000000000..08214d52c
--- /dev/null
+++ b/sdnr/wt/devicemanager-adapter-manager/provider/src/main/yang/nts-manager.yang
@@ -0,0 +1,202 @@
+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;
+ revision-date 2020-11-20;
+ }
+
+ 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 - Manager.";
+
+ 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 {
+ 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.";
+ }
+ container networking {
+ leaf docker-ip {
+ type inet:ip-address;
+ description
+ "The IP address of the docker container implementing the network function instance.";
+ }
+ leaf-list docker-port {
+ type inet:port-number;
+ description
+ "The ports which are exposed inside the docker container implementing the network function instance.";
+ }
+ leaf host-ip {
+ type inet:ip-address;
+ description
+ "The Host machine IP address pointing to the docker container implementing the network function instance.";
+ }
+ leaf-list host-port {
+ type inet:port-number;
+ description
+ "The Host machine ports mapped to the docker container implementing the network function instance.";
+ }
+ description
+ "Groups the details about networking information.";
+ }
+ description
+ "An instance of a network function which is running. The equivalent on the host machine is a docker container.";
+ }
+ grouping network-function-g {
+ 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;
+ list instance {
+ key "name";
+ uses ntsc:mount-point-details-g;
+ uses instance-g;
+ description
+ "Describes a running instance.";
+ }
+ description
+ "Groups details about instances which are running.";
+ }
+ description
+ "Contains all the details of a simulated device.";
+ }
+ grouping simulation-information-g {
+ leaf base-port {
+ type inet:port-number;
+ config false;
+ description
+ "The base Host machine port from where the simulation can allocate ports incrementally.";
+ }
+ 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.";
+ }
+ description
+ "Groups information about the simulation status.";
+ }
+
+ container simulation {
+ container network-functions {
+ list network-function {
+ key "function-type";
+ unique "docker-instance-name";
+ uses network-function-g;
+ description
+ "List containing different simulated network function types and their details.";
+ }
+ description
+ "Container which encompasses all simulated network functions.";
+ }
+ container sdn-controller {
+ uses ntsc:controller-g;
+ description
+ "Groups details about the SDN Controller.";
+ }
+ container ves-endpoint {
+ uses ntsc:ves-endpoint-g;
+ description
+ "Groups details about the VES Collector endpoint.";
+ }
+ uses simulation-information-g;
+ description
+ "Root level container which controls the NTS.";
+ }
+
+
+} //end module \ No newline at end of file
diff --git a/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/mock/NetconfAccessorMock.java b/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/mock/NetconfAccessorMock.java
index 91f5c431b..8a0694087 100644
--- a/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/mock/NetconfAccessorMock.java
+++ b/sdnr/wt/devicemanager-adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/mock/NetconfAccessorMock.java
@@ -19,9 +19,14 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.test.mock;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.List;
+import java.util.Optional;
+
import org.eclipse.jdt.annotation.NonNull;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.MountPoint;
@@ -35,7 +40,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
/**
*/
-public class NetconfAccessorMock implements NetconfAccessor {
+public class NetconfAccessorMock implements NetconfBindingAccessor, NetconfNotifications {
private final NodeId nNodeId;
private final NetconfNode netconfNode;
@@ -109,4 +114,28 @@ public class NetconfAccessorMock implements NetconfAccessor {
return null;
}
+ @Override
+ public Optional<NetconfBindingAccessor> getNetconfBindingAccessor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Optional<NetconfDomAccessor> getNetconfDomAccessor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Optional<NetconfNotifications> getNotificationAccessor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isNotificationsSupported() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}