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