Rewrite NTS Framework.
[sim/o1-interface.git] / ntsimulator / deploy / nts-manager / yang / nts-manager.yang
1 module nts-manager {
2   yang-version 1.1;
3   namespace "urn:o-ran-sc:params:xml:ns:yang:nts:manager";
4   prefix nts-mng;
5
6   import ietf-inet-types {
7     prefix inet;
8   }
9
10   import nts-common {
11     prefix ntsc;
12     revision-date 2020-10-22;
13   }
14
15   organization
16     "O-RAN-SC";
17   contact
18     " Web: <https://wiki.o-ran-sc.org/display/SIM/SIM>
19         Editors:  
20         Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com>
21         Adrian Lita <mailto:adrian.lita@highstreet-technologies.com>
22         Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>";
23   description
24     "This module contains YANG definitions for the Network Topology Simulator - Manager.";
25
26   revision 2020-10-06 {
27     description
28       "Initial revision for the Network Topology Simulator - Next Generation";
29     reference
30       "O-RAN-SC SIM project";
31   }
32
33   typedef percent {
34     type decimal64 {
35       fraction-digits 2;
36       range "0 .. 100";
37     }
38     description
39       "Percentage";
40   }
41
42   grouping instance-g {
43       leaf name {
44         type string;
45         description
46           "The name of the running instance. It is the same as the docker container name which exposes this network function.";
47       }
48       container networking {
49           leaf docker-ip {
50               type inet:ip-address;
51               description
52                 "The IP address of the docker container implementing the network function instance.";
53           }
54           leaf-list docker-port {
55               type inet:port-number;
56               description
57                 "The ports which are exposed inside the docker container implementing the network function instance.";
58           }
59           leaf host-ip {
60               type inet:ip-address;
61               description
62                 "The Host machine IP address pointing to the docker container implementing the network function instance.";
63           }
64           leaf-list host-port {
65               type inet:port-number;
66               description
67                 "The Host machine ports mapped to the docker container implementing the network function instance.";
68           }
69           description
70             "Groups the details about networking information.";
71       }
72       description
73         "An instance of a network function which is running. The equivalent on the host machine is a docker container.";
74   }
75   grouping network-function-g {
76       leaf function-type {
77           type identityref {
78               base ntsc:NTS_FUNCTION_TYPE_BASE;
79           }
80           description "Type of network function to be simulated.";
81       }
82       leaf started-instances {
83           type uint16;
84           mandatory true;
85           description
86             "How many instances of this type are started.";
87       }
88       leaf mounted-instances {
89           type uint16;
90           must '. <= ../started-instances' {
91               error-message
92                 "The number of mounted instances cannot be greater that the number of started instances.";
93           }
94           mandatory true;
95           description
96             "How many instances of this type are mounted in the SDN Controller.";
97       }
98
99       uses ntsc:mount-point-details-g;
100
101       leaf docker-instance-name {
102           type string;
103           mandatory true;
104           description
105             "The prefix of each docker container being started.";
106       }
107
108       leaf docker-version-tag {
109           type string;
110           mandatory true;
111           description
112             "The version tag of the docker image to be started.";
113       }
114
115       leaf docker-repository {
116           type string;
117           mandatory true;
118           description
119             "The prefix containing the docker repository information, if needed.";
120       }
121       uses ntsc:faults-g;
122       uses ntsc:netconf-config-g;
123       uses ntsc:ves-config-g;
124       container instances {
125           config false;
126           list instance {
127             key "name";
128             uses ntsc:mount-point-details-g;
129             uses instance-g;            
130             description
131               "Describes a running instance.";
132           }
133           description 
134             "Groups details about instances which are running.";
135       }
136       description
137         "Contains all the details of a simulated device.";
138   }
139   grouping simulation-information-g {
140       leaf base-port {
141           type inet:port-number;
142           config false;
143           description
144             "The base Host machine port from where the simulation can allocate ports incrementally.";
145       }
146       leaf ssh-connections {
147           type uint8;
148           config false;
149           description
150             "The number of SSH Endpoints each network function instance exposes.";
151       }
152       leaf tls-connections {
153           type uint8;
154           config false;
155           description
156             "The number of TLS Endpoints each network function instance exposes.";
157       }
158       leaf cpu-usage {
159         type percent;
160         config false;
161         description
162           "Specifies the CPU load generated by the simulation.";
163       }
164       leaf mem-usage {
165         type uint32;
166         config false;
167         description
168           "Specifies the RAM in MB used by the simulation.";
169       }
170       description
171         "Groups information about the simulation status.";
172   }
173
174   container simulation {
175       container network-functions {
176           list network-function {
177             key "function-type";
178             unique "docker-instance-name";
179             uses network-function-g;
180             description
181               "List containing different simulated network function types and their details.";
182           }
183           description
184             "Container which encompasses all simulated network functions.";
185       }
186       container sdn-controller {
187           uses ntsc:controller-g;
188           description
189             "Groups details about the SDN Controller.";
190       }
191       container ves-endpoint {
192           uses ntsc:ves-endpoint-g;
193           description
194             "Groups details about the VES Collector endpoint.";
195       }
196       uses simulation-information-g;
197       description
198         "Root level container which controls the NTS.";
199   }
200
201
202 } //end module