Adding nemo engine.
[nemo.git] / nemo-impl / src / main / yang / generic-physical-network.yang
1 /*\r
2  * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 \r
9 module generic-physical-network {\r
10     yang-version 1;\r
11 \r
12     namespace "urn:opendaylight:params:xml:ns:yang:generic:physical:network";\r
13     prefix "generic-pn";\r
14 \r
15     import nemo-engine-common {prefix nemo-engine-common;}\r
16     import ietf-inet-types {\r
17         prefix inet;\r
18         revision-date 2010-09-24;\r
19     }\r
20     import ietf-yang-types {\r
21         prefix yang;\r
22         revision-date 2010-09-24;\r
23     }\r
24 \r
25     description\r
26         "Represents the generic physical network information model.\r
27          Each renderer will collect detailed physical network information\r
28          and fill in this generic model.";\r
29 \r
30     revision "2015-10-10" {\r
31         description\r
32             "Initial revision.";\r
33     }\r
34 \r
35     grouping attribute-definition {\r
36         description\r
37             "Defines an attribute for a physical port or node.";\r
38 \r
39         leaf attribute-name {\r
40             description\r
41                 "A name for the attribute.";\r
42             type nemo-engine-common:attribute-name;\r
43             mandatory true;\r
44         }\r
45 \r
46         leaf attribute-value-type {\r
47             description\r
48                 "The value type for the attribute.";\r
49             type enumeration {\r
50                 enum string;\r
51                 enum int;\r
52                 enum range;\r
53             }\r
54         }\r
55 \r
56         container attribute-match-patterns {\r
57             description\r
58                 "Defines the match patterns of the attribute.";\r
59 \r
60             leaf-list attribute-match-pattern {\r
61                 type enumeration {\r
62                     enum less-than;\r
63                     enum not-less-than;\r
64                     enum equal;\r
65                     enum not-equal;\r
66                     enum greater-than;\r
67                     enum not-greater-than;\r
68                     enum between;\r
69                 }\r
70             }\r
71         }\r
72     }\r
73 \r
74     container physical-port-attribute-definitions {\r
75         description\r
76             "Contains all attribute definitions for the physical port.";\r
77 \r
78         list physical-port-attribute-definition {\r
79             description\r
80                 "An attribute definition for the physical port.";\r
81 \r
82             key "attribute-name";\r
83             uses attribute-definition;\r
84         }\r
85     }\r
86 \r
87     container physical-node-attribute-definitions {\r
88         description\r
89             "Contains all attribute definitions for the physical node.";\r
90 \r
91         list physical-node-attribute-definition {\r
92             description\r
93                 "An attribute definition for the physical node.";\r
94 \r
95             key "attribute-name";\r
96             uses attribute-definition;\r
97         }\r
98     }\r
99 \r
100     grouping attribute-instance {\r
101         description\r
102             "Represents an attribute instance and it's metadata.";\r
103 \r
104         leaf attribute-name {\r
105             description\r
106                 "A name for an attribute instance.";\r
107             type nemo-engine-common:attribute-name;\r
108             mandatory true;\r
109         }\r
110 \r
111         container attribute-value {\r
112             description\r
113                 "The value of the attribute instance.";\r
114 \r
115             leaf string-value {\r
116                 type string;\r
117             }\r
118 \r
119             leaf int-value {\r
120                 type int64;\r
121             }\r
122 \r
123             container range-value {\r
124                 leaf min {\r
125                     type int64;\r
126                     mandatory true;\r
127                 }\r
128 \r
129                 leaf max {\r
130                     type int64;\r
131                     mandatory true;\r
132                 }\r
133             }\r
134         }\r
135     }\r
136 \r
137     grouping physical-port-instance {\r
138         description\r
139             "Represents a physical port instance and it's metadata.";\r
140 \r
141         leaf port-id {\r
142             description\r
143                 "A unique ID for a physical port.";\r
144             type nemo-engine-common:physical-port-id;\r
145             mandatory true;\r
146         }\r
147 \r
148         leaf port-type {\r
149             description\r
150                 "The type of a physical port.";\r
151             type enumeration {\r
152                 enum external {\r
153                     description\r
154                         "The physical port is connected to a external host\r
155                          or network device.";\r
156                 }\r
157                 enum internal {\r
158                     description\r
159                         "The physical port is connected to a physical node.";\r
160                 }\r
161             }\r
162             mandatory true;\r
163         }\r
164 \r
165         leaf mac-address {\r
166             description\r
167                 "The mac address of a physical port.";\r
168             type yang:mac-address;\r
169             mandatory true;\r
170         }\r
171 \r
172         leaf bandwidth {\r
173             description\r
174                 "The bandwidth capacity of a physical port.\r
175                  The unit is kbps.";\r
176             type uint32;\r
177             units kbps;\r
178         }\r
179 \r
180         list attribute {\r
181             description\r
182                 "The list of attributes of a physical port.";\r
183 \r
184             key "attribute-name";\r
185             uses attribute-instance;\r
186         }\r
187     }\r
188 \r
189     grouping physical-node-instance {\r
190         description\r
191             "Represents a physical node instance and it's metadata.";\r
192 \r
193         leaf node-id {\r
194             description\r
195                 "A unique ID for a physical node.";\r
196             type nemo-engine-common:physical-node-id;\r
197             mandatory true;\r
198         }\r
199 \r
200         leaf node-type {\r
201             description\r
202                 "The type of a physical node.";\r
203             type enumeration {\r
204                 enum switch;\r
205                 enum router;\r
206                 enum firewall;\r
207                 enum loadbalancer;\r
208             }\r
209         }\r
210 \r
211         list physical-port {\r
212             description\r
213                 "The list of ports of a physical node.";\r
214 \r
215             key "port-id";\r
216             uses physical-port-instance;\r
217         }\r
218 \r
219         list attribute {\r
220             description\r
221                 "The list of attributes of a physical node.";\r
222 \r
223             key "attribute-name";\r
224             uses attribute-instance;\r
225         }\r
226     }\r
227 \r
228     grouping physical-link-instance {\r
229         description\r
230             "Represents a physical link instance and it's metadata.";\r
231 \r
232         leaf link-id {\r
233             description\r
234                 "A unique ID for a physical link.";\r
235             type nemo-engine-common:physical-link-id;\r
236             mandatory true;\r
237         }\r
238 \r
239         leaf src-node-id {\r
240             description\r
241                 "Represents the ID of the source physical node.";\r
242             type nemo-engine-common:physical-node-id;\r
243         }\r
244 \r
245         leaf src-port-id {\r
246             description\r
247                 "Represents the ID of the source physical port.";\r
248             type nemo-engine-common:physical-port-id;\r
249         }\r
250 \r
251         leaf dest-node-id {\r
252             description\r
253                 "Represents the ID of the destination physical node.";\r
254             type nemo-engine-common:physical-node-id;\r
255         }\r
256 \r
257         leaf dest-port-id {\r
258             description\r
259                 "Represents the ID of the destination physical port.";\r
260             type nemo-engine-common:physical-port-id;\r
261         }\r
262 \r
263         leaf metric {\r
264             description\r
265                 "The routing metric is used by routing computation.";\r
266             type uint32;\r
267         }\r
268 \r
269         leaf bandwidth {\r
270             description\r
271                 "The bandwidth capacity of a physical link.\r
272                  The unit is kbps.";\r
273             type uint32;\r
274             units kbps;\r
275         }\r
276 \r
277         leaf delay {\r
278             description\r
279                 "The packet transfer delay of a physical link.\r
280                  The unit is millisecond.";\r
281             type uint32;\r
282             units millisecond;\r
283         }\r
284 \r
285         leaf loss-rate {\r
286             description\r
287                 "The ratio of total lost packet outcomes to\r
288                  total transmitted packets. The unit is percent.";\r
289             type uint8 {\r
290                 range "0..100";\r
291             }\r
292             units percent;\r
293         }\r
294     }\r
295 \r
296     grouping physical-host-instance {\r
297         description\r
298             "Represents a physical host instance and it's metadata.";\r
299 \r
300         leaf host-id {\r
301             description\r
302                 "A unique ID for a physical host.";\r
303             type nemo-engine-common:physical-host-id;\r
304             mandatory true;\r
305         }\r
306 \r
307         leaf host-name {\r
308             description\r
309                 "A human-readable name for a physical host.";\r
310             type nemo-engine-common:physical-host-name;\r
311         }\r
312 \r
313         leaf mac-address {\r
314             description\r
315                 "The mac address of the host.";\r
316             type yang:mac-address;\r
317             mandatory true;\r
318         }\r
319 \r
320         container ip-addresses {\r
321             description\r
322                 "One or more ip addresses of the host.";\r
323 \r
324             leaf-list ip-address {\r
325                 type inet:ip-address;\r
326                 min-elements 1;\r
327             }\r
328         }\r
329 \r
330         leaf node-id {\r
331             description\r
332                 "A unique ID for the physical node that the host connects to.";\r
333             type nemo-engine-common:physical-node-id;\r
334             mandatory true;\r
335         }\r
336 \r
337         leaf port-id {\r
338             description\r
339                 "A unique ID for the physical port that the host connects to.";\r
340             type nemo-engine-common:physical-port-id;\r
341             mandatory true;\r
342         }\r
343     }\r
344 \r
345     grouping physical-path-instance {\r
346         description\r
347             "Represents a physical tunnel instance and it's metadata.";\r
348 \r
349         leaf path-id {\r
350             description\r
351                 "A unique ID for a physical path.";\r
352             type nemo-engine-common:physical-path-id;\r
353             mandatory true;\r
354         }\r
355 \r
356         list physical-link {\r
357             description\r
358                 "A list of physical links which compose the physical path.";\r
359 \r
360             key "link-id";\r
361             leaf link-id {\r
362                 description\r
363                     "A unique ID for the physical link.";\r
364                 type nemo-engine-common:physical-link-id;\r
365             }\r
366 \r
367             leaf order {\r
368                 description\r
369                     "Specify the order of the physical link instance\r
370                      in a sequence list.";\r
371                 type uint32;\r
372             }\r
373         }\r
374 \r
375         leaf metric {\r
376             description\r
377                 "The routing metric of a physical path.";\r
378             type uint32;\r
379         }\r
380 \r
381         leaf bandwidth {\r
382             description\r
383                 "The bandwidth capacity of a physical path.\r
384                  The unit is kbps.";\r
385             type uint32;\r
386             units kbps;\r
387         }\r
388 \r
389         leaf delay {\r
390             description\r
391                 "The packet transfer delay of a physical path.\r
392                  The unit is millisecond.";\r
393             type uint32;\r
394             units millisecond;\r
395         }\r
396     }\r
397 \r
398     container physical-network {\r
399         description\r
400             "Contains all physical nodes, links and tunnels\r
401              in the underlying network.";\r
402 \r
403         container physical-nodes {\r
404             list physical-node {\r
405                 description\r
406                     "The list of all physical nodes in the underlying network.";\r
407 \r
408                 key "node-id";\r
409                 uses physical-node-instance;\r
410             }\r
411         }\r
412 \r
413         container physical-links {\r
414             list physical-link {\r
415                 description\r
416                     "The list of all physical links in the underlying network.";\r
417 \r
418                 key "link-id";\r
419                 uses physical-link-instance;\r
420             }\r
421         }\r
422 \r
423         container physical-hosts {\r
424             list physical-host {\r
425                 description\r
426                     "The list of all physical hosts in the underlying network.";\r
427 \r
428                 key "host-id";\r
429                 uses physical-host-instance;\r
430             }\r
431         }\r
432 \r
433         container physical-paths {\r
434             list physical-path {\r
435                 description\r
436                     "The list of all physical tunnels in the underlying network.";\r
437 \r
438                 key "path-id";\r
439                 uses physical-path-instance;\r
440             }\r
441         }\r
442     }\r
443 }\r