960aea8d909eda1dcd6a19efc9c4a8cc5a4cea77
[sim/o1-interface.git] / ntsimulator / deploy / base / yang / nts-common.yang
1 module nts-common {
2   yang-version 1.1;
3   namespace "urn:o-ran-sc:params:xml:ns:yang:nts:common";
4   prefix ntsc;
5
6   import ietf-inet-types {
7     prefix inet;
8   }
9
10   organization
11     "O-RAN-SC";
12   contact
13     " Web: <https://wiki.o-ran-sc.org/display/SIM/SIM>
14         Editors:
15         Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com>
16         Adrian Lita <mailto:adrian.lita@highstreet-technologies.com>
17         Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>";
18   description
19     "This module contains common yang definitions YANG definitions for the Network Topology Simulator.";
20
21   revision 2021-06-08 {
22     description
23       "Moved NTS_PROTOCOL_TYPE_BASE identities from nts-manager.";
24     reference
25       "O-RAN-SC SIM project";
26   }
27   revision 2021-03-26 {
28     description
29       "Added controller-protocol.";
30     reference
31       "O-RAN-SC SIM project";
32   }
33   revision 2021-02-15 {
34     description
35       "Added presence to configuration containers.";
36     reference
37       "O-RAN-SC SIM project";
38   }
39   revision 2020-11-20 {
40     description
41       "Add feature-type for the Web cut through feature.";
42     reference
43       "O-RAN-SC SIM project";
44   }
45   revision 2020-10-22 {
46     description
47       "Add feature-type for the NETCONF Call Home feature.";
48     reference
49       "O-RAN-SC SIM project";
50   }
51   revision 2020-10-13 {
52     description
53       "Add feature-type typedef containing the features that can be activated in the Network Function.";
54     reference
55       "O-RAN-SC SIM project";
56   }
57   revision 2020-09-07 {
58     description
59       "Initial revision for the Network Topology Simulator - Next Generation common types.";
60     reference
61       "O-RAN-SC SIM project";
62   }
63
64   identity NTS_PROTOCOL_TYPE_BASE {
65     description
66       "Base identity for protocol.";
67   }
68
69   identity NTS_PROTOCOL_TYPE_NETCONF_SSH {
70     base NTS_PROTOCOL_TYPE_BASE;
71     description
72       "Identity for NETCONF SSH protocol.";
73   }
74
75   identity NTS_PROTOCOL_TYPE_NETCONF_TLS {
76     base NTS_PROTOCOL_TYPE_BASE;
77     description
78       "Identity for NETCONF TLS protocol.";
79   }
80
81   identity NTS_PROTOCOL_TYPE_FTP {
82     base NTS_PROTOCOL_TYPE_BASE;
83     description
84       "Identity for FTP protocol.";
85   }
86
87   identity NTS_PROTOCOL_TYPE_SFTP {
88     base NTS_PROTOCOL_TYPE_BASE;
89     description
90       "Identity for SFTP protocol.";
91   }
92
93   identity NTS_PROTOCOL_TYPE_HTTP {
94     base NTS_PROTOCOL_TYPE_BASE;
95     description
96       "Identity for HTTP protocol.";
97   }
98
99   identity NTS_PROTOCOL_TYPE_HTTPS {
100     base NTS_PROTOCOL_TYPE_BASE;
101     description
102       "Identity for HTTPS protocol.";
103   }
104
105   feature faults-status {
106     description
107       "This means that the server supports reporting back the number of faults that were generated";
108   }
109
110   identity NTS_FUNCTION_TYPE_BASE {
111     description
112       "The reference of each identity represents the name of the associated docker image.";
113   }
114
115   typedef authentication-method-type {
116     type enumeration {
117       enum no-auth {
118         description
119           "no security (http)";
120       }
121       enum cert-only {
122         description
123           "auth by certificate (https)";
124       }
125       enum basic-auth {
126         description
127           "auth by basic auth username and password (https)";
128       }
129       enum cert-basic-auth {
130         description
131           "auth by certificate and basic auth username / password (https)";
132       }
133     }
134     description
135       "The authentication method for VES messaging.";
136   }
137
138   typedef feature-type {
139     type bits {
140       bit ves-file-ready {
141         position 0;
142         description
143           "Controls the ves-file-ready feature.";
144       }
145       bit ves-heartbeat {
146         position 1;
147         description
148           "Controls the ves-heartbeat feature.";
149       }
150       bit ves-pnf-registration {
151         position 2;
152         description
153           "Controls the ves-pnf-registration feature.";
154       }
155       bit manual-notification-generation {
156         position 3;
157         description
158           "Controls the manual notification generation feature.";
159       }
160       bit netconf-call-home {
161         position 4;
162         description
163           "Controls the NETCONF Call Home feature.";
164       }
165       bit web-cut-through {
166         position 5;
167         description
168           "Controls the Web Cut Through feature.";
169       }
170     }
171     description
172       "Describes the features that can be enabled/disabled in the Network Function.";
173   }
174
175   grouping mount-point-details-g {
176     description
177       "Groups details about mount point";
178     leaf mount-point-addressing-method {
179       type enumeration {
180         enum host-mapping {
181           description
182             "Uses IP and port mapped to the host machine to address the nework function.";
183         }
184         enum docker-mapping {
185           description
186             "Uses Docker IP and port to address the nework function.";
187         }
188       }
189       default "docker-mapping";
190       description
191         "Specifies how to address the simulated network function: via the host machine or via docker.";
192     }
193   }
194
195   grouping fault-delay-period-g {
196     description
197       "For reusing the same fault-delay-period.";
198     list fault-delay-list {
199       key "index";
200       ordered-by user;
201       description
202         "The list defining the pattern for generating events.";
203       leaf index {
204         type uint16;
205         description
206           "The index of the list.";
207       }
208       leaf delay-period {
209         type uint16;
210         units "s";
211         description
212           "The amount of seconds before the next event.";
213       }
214     }
215   }
216
217   grouping fault-count-g {
218     description
219       "Grouping for counting the fault events, grouped by severity.";
220     container fault-count {
221       if-feature "faults-status";
222       config false;
223       description
224         "Container which groups the number of fault events, by severity.";
225       leaf normal {
226         type uint32;
227         description
228           "Number of normal (non-alarmed) events.";
229       }
230       leaf warning {
231         type uint32;
232         description
233           "Number of warning events.";
234       }
235       leaf minor {
236         type uint32;
237         description
238           "Number of minor events.";
239       }
240       leaf major {
241         type uint32;
242         description
243           "Number of major events.";
244       }
245       leaf critical {
246         type uint32;
247         description
248           "Number of critical events.";
249       }
250     }
251   }
252
253   grouping faults-g {
254     description
255       "Grouping for fault generation";
256     container fault-generation {
257       presence "Enables fault generation configuration.";
258       description
259         "Groups the fault generation configuration and status.";
260       uses fault-delay-period-g;
261       uses fault-count-g;
262     }
263   }
264
265   grouping faults-enabled-g {
266     description
267       "Groups the enabling of faults.";
268     leaf faults-enabled {
269       type boolean;
270       description
271         "For enabling the fault generation.";
272     }
273   }
274
275   grouping netconf-config-g {
276     description
277       "Groups the configuration and status of NETCONF Fault notifications.";
278     container netconf {
279       presence "Enables NETCONF configuration.";
280       description
281         "Container for describing the NETCONF details.";
282       uses faults-enabled-g;
283       leaf call-home {
284         type boolean;
285         description
286           "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.";
287       }
288     }
289   }
290
291   grouping ves-config-g {
292     description
293       "Groups the configuration and status of VES Fault notifications.";
294     container ves {
295       presence "Enables VES configuration.";
296       description
297         "Container for describing the VES details.";
298       uses faults-enabled-g;
299       leaf pnf-registration {
300         type boolean;
301         description
302           "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.";
303       }
304       leaf heartbeat-period {
305         type uint16;
306         description
307           "The number of seconds between VES heartbeat messages.";
308       }
309     }
310   }
311
312   grouping controller-g {
313     description
314       "Groups information about the SDN Controller.";
315     leaf controller-protocol {
316       type enumeration {
317         enum http {
318           description
319             "HTTP protocol will be used to connect to the VES Collector.";
320         }
321         enum https {
322           description
323             "HTTPS protocol will be used to connect to the VES Collector.";
324         }
325       }
326       default "https";
327       description
328         "The protocol used for communication with the SDN Controller.";
329     }
330     leaf controller-ip {
331       type inet:host;
332       description
333         "The IP address of the SDN Controller.";
334     }
335     leaf controller-port {
336       type inet:port-number;
337       description
338         "The port exposed by the SDN Controller.";
339     }
340     leaf controller-netconf-call-home-port {
341       type inet:port-number;
342       description
343         "The port exposed by the SDN Controller for NETCONF Call Home.";
344     }
345     leaf controller-username {
346       type string;
347       description
348         "The username for accessing the SDN Controller.";
349     }
350     leaf controller-password {
351       type string;
352       description
353         "The password for accessing the SDN Controller.";
354     }
355   }
356
357   grouping ves-endpoint-g {
358     description
359       "Groups information about the VES Collector.";
360     leaf ves-endpoint-protocol {
361       type enumeration {
362         enum http {
363           description
364             "HTTP protocol will be used to connect to the VES Collector.";
365         }
366         enum https {
367           description
368             "HTTPS protocol will be used to connect to the VES Collector.";
369         }
370       }
371       default "https";
372       description
373         "The protocol (HTTP / HTTPS) to be used to address the VES Collector.";
374     }
375     leaf ves-endpoint-ip {
376       type inet:host;
377       description
378         "The IP address of the VES Collector.";
379     }
380     leaf ves-endpoint-port {
381       type inet:port-number;
382       description
383         "The port exposed by the VES Collector.";
384     }
385     leaf ves-endpoint-auth-method {
386       type authentication-method-type;
387       default "no-auth";
388       description
389         "The type of the authentication to be used with the VES Collector.";
390     }
391     leaf ves-endpoint-username {
392       type string;
393       description
394         "The username for accessing the VES Collector.";
395     }
396     leaf ves-endpoint-password {
397       type string;
398       description
399         "The password for accessing the VES Collector.";
400     }
401     leaf ves-endpoint-certificate {
402       type string;
403       description
404         "The Certificate to be used to authenticate to the VES Collector.";
405     }
406   }
407
408   grouping rpc-status-g {
409     description
410       "RPC output grouping.";
411     leaf status {
412       type enumeration {
413         enum SUCCESS {
414           description
415             "The RPC was successfully invoked.";
416         }
417         enum ERROR {
418           description
419             "An error was encountered when invoking the RPC.";
420         }
421       }
422       mandatory true;
423       description
424         "The status of the RPC.";
425     }
426   }
427 }