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