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