Add NETCONF CallHome via TLS feature.
[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   import nts-common {
10     prefix ntsc;
11   }
12
13   organization
14     "O-RAN-SC";
15   contact
16     " Web: <https://wiki.o-ran-sc.org/display/SIM/SIM>
17         Editors:
18         Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com>
19         Adrian Lita <mailto:adrian.lita@highstreet-technologies.com>
20         Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>";
21   description
22     "This module contains YANG definitions for the Network Topology Simulator - Manager.";
23
24   revision 2021-06-08 {
25     description
26       "Moved NTS_PROTOCOL_TYPE_BASE identities to nts-common.";
27     reference
28       "O-RAN-SC SIM project";
29   }
30   revision 2021-03-26 {
31     description
32       "Added NTS_PROTOCOL_TYPE_BASE identities and changed instance/networking container; also added multi-base port support.";
33     reference
34       "O-RAN-SC SIM project";
35   }
36   revision 2021-02-15 {
37     description
38       "Added notifications for sending feedback.";
39     reference
40       "O-RAN-SC SIM project";
41   }
42   revision 2021-01-20 {
43     description
44       "Added available-network-functions.";
45     reference
46       "O-RAN-SC SIM project";
47   }
48   revision 2020-11-30 {
49     description
50       "Cleared revision for nts-common import.";
51     reference
52       "O-RAN-SC SIM project";
53   }
54   revision 2020-10-06 {
55     description
56       "Initial revision for the Network Topology Simulator - Next Generation";
57     reference
58       "O-RAN-SC SIM project";
59   }
60
61   typedef percent {
62     type decimal64 {
63       fraction-digits 2;
64       range "0 .. 100";
65     }
66     description
67       "Percentage";
68   }
69
70   grouping instance-g {
71     description
72       "An instance of a network function which is running. The equivalent on the host machine is a docker container.";
73     leaf name {
74       type string;
75       description
76         "The name of the running instance. It is the same as the docker container name which exposes this network function.";
77     }
78     leaf is-mounted {
79       type boolean;
80       description
81         "Whether the instance is mounted or not to a controller.";
82     }
83     container networking {
84       description
85         "Groups the details about networking information.";
86       leaf docker-ip {
87         type inet:ip-address;
88         description
89           "The IP address of the docker container implementing the network function instance.";
90       }
91       list docker-ports {
92         key "port";
93         description
94           "The ports which are exposed inside the docker container implementing the network function instance.";
95         leaf port {
96           type inet:port-number;
97           description
98             "Port number.";
99         }
100         leaf protocol {
101           type identityref {
102             base ntsc:NTS_PROTOCOL_TYPE_BASE;
103           }
104           description
105             "Protocol attached to current port.";
106         }
107       }
108       leaf host-ip {
109         type inet:ip-address;
110         description
111           "The Host machine IP address pointing to the docker container implementing the network function instance.";
112       }
113       list host-ports {
114         key "port";
115         description
116           "The Host machine ports mapped to the docker container implementing the network function instance.";
117         leaf port {
118           type inet:port-number;
119           description
120             "Port number.";
121         }
122         leaf protocol {
123           type identityref {
124             base ntsc:NTS_PROTOCOL_TYPE_BASE;
125           }
126           description
127             "Protocol attached to current port.";
128         }
129       }
130     }
131   }
132
133   grouping network-function-g {
134     description
135       "Contains all the details of a simulated device.";
136     leaf function-type {
137       type identityref {
138         base ntsc:NTS_FUNCTION_TYPE_BASE;
139       }
140       description
141         "Type of network function to be simulated.";
142     }
143     leaf started-instances {
144       type uint16;
145       mandatory true;
146       description
147         "How many instances of this type are started.";
148     }
149     leaf mounted-instances {
150       type uint16;
151       must '. <= ../started-instances' {
152         error-message "The number of mounted instances cannot be greater that the number of started instances.";
153       }
154       mandatory true;
155       description
156         "How many instances of this type are mounted in the SDN Controller.";
157     }
158     uses ntsc:mount-point-details-g;
159     leaf docker-instance-name {
160       type string;
161       mandatory true;
162       description
163         "The prefix of each docker container being started.";
164     }
165     leaf docker-version-tag {
166       type string;
167       mandatory true;
168       description
169         "The version tag of the docker image to be started.";
170     }
171     leaf docker-repository {
172       type string;
173       mandatory true;
174       description
175         "The prefix containing the docker repository information, if needed.";
176     }
177     uses ntsc:faults-g;
178     uses ntsc:netconf-config-g;
179     uses ntsc:ves-config-g;
180     container instances {
181       config false;
182       description
183         "Groups details about instances which are running.";
184       list instance {
185         key "name";
186         description
187           "Describes a running instance.";
188         uses ntsc:mount-point-details-g;
189         uses instance-g;
190       }
191     }
192   }
193
194   grouping simulation-information-g {
195     description
196       "Groups information about the simulation status.";
197     container ports {
198       config false;
199       description
200         "Contains information on ports used.";
201       leaf netconf-ssh-port {
202         type inet:port-number;
203         description
204           "The base Host machine port from where the simulation can allocate ports incrementally for NETCONF SSH protocol.";
205       }
206       leaf netconf-tls-port {
207         type inet:port-number;
208         description
209           "The base Host machine port from where the simulation can allocate ports incrementally for NETCONF TLS protocol.";
210       }
211       leaf transport-ftp-port {
212         type inet:port-number;
213         description
214           "The base Host machine port from where the simulation can allocate ports incrementally for FTP protocol.";
215       }
216       leaf transport-sftp-port {
217         type inet:port-number;
218         description
219           "The base Host machine port from where the simulation can allocate ports incrementally for SFTP protocol.";
220       }
221     }
222     leaf ssh-connections {
223       type uint8;
224       config false;
225       description
226         "The number of SSH Endpoints each network function instance exposes.";
227     }
228     leaf tls-connections {
229       type uint8;
230       config false;
231       description
232         "The number of TLS Endpoints each network function instance exposes.";
233     }
234     leaf cpu-usage {
235       type percent;
236       config false;
237       description
238         "Specifies the CPU load generated by the simulation.";
239     }
240     leaf mem-usage {
241       type uint32;
242       config false;
243       description
244         "Specifies the RAM in MB used by the simulation.";
245     }
246     leaf last-operation-status {
247       type string;
248       config false;
249       description
250         "Specifies the status of the most recent operation performed by the Manager.";
251     }
252   }
253
254   grouping network-function-image-g {
255     description
256       "Groups details about a NF docker image.";
257     leaf function-type {
258       type identityref {
259         base ntsc:NTS_FUNCTION_TYPE_BASE;
260       }
261       config false;
262       description
263         "Type of network function to be simulated.";
264     }
265     leaf docker-image-name {
266       type string;
267       config false;
268       mandatory true;
269       description
270         "The prefix of each docker container being started.";
271     }
272     leaf docker-version-tag {
273       type string;
274       config false;
275       mandatory true;
276       description
277         "The version tag of the docker image to be started.";
278     }
279     leaf docker-repository {
280       type string;
281       config false;
282       mandatory true;
283       description
284         "The prefix containing the docker repository information, if needed.";
285     }
286   }
287
288   notification instance-changed {
289     description
290       "Sent by the Manager every time something occurs in any of the simulated NF instances.";
291     leaf change-status {
292       type string;
293       mandatory true;
294       description
295         "The status of the change which was executed to the NF instance.";
296     }
297     leaf function-type {
298       type identityref {
299         base ntsc:NTS_FUNCTION_TYPE_BASE;
300       }
301       mandatory true;
302       description
303         "Type of the NF instance.";
304     }
305     uses instance-g {
306       refine "name" {
307         mandatory true;
308       }
309     }
310   }
311
312   notification operation-status-changed {
313     description
314       "Sent by the Manager every time a user operation is finished.";
315     leaf operation-status {
316       type string;
317       mandatory true;
318       description
319         "The status of the operation which was executed by the Manager.";
320     }
321     leaf error-message {
322       type string;
323       description
324         "Detailed error message from the Manager.";
325     }
326   }
327
328   container simulation {
329     presence "Enables simulation configuration.";
330     description
331       "Root level container which controls the NTS.";
332     container available-images {
333       config false;
334       description
335         "Container which encompasses all NF docker images available on the host machine.";
336       list network-function-image {
337         description
338           "List containing available network function docker images and their respective details.";
339         uses network-function-image-g;
340       }
341     }
342     container network-functions {
343       presence "Enables NF configuration.";
344       description
345         "Container which encompasses all simulated network functions.";
346       list network-function {
347         key "function-type";
348         unique "docker-instance-name";
349         description
350           "List containing different simulated network function types and their details.";
351         uses network-function-g;
352       }
353     }
354     container sdn-controller {
355       presence "Enables SDN Controller detail configuration.";
356       description
357         "Groups details about the SDN Controller.";
358       uses ntsc:controller-g;
359     }
360     container ves-endpoint {
361       presence "Enables VES endpoint detail configuration.";
362       description
363         "Groups details about the VES Collector endpoint.";
364       uses ntsc:ves-endpoint-g;
365     }
366     uses simulation-information-g;
367   }
368 }