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