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