Adding nemo engine.
[nemo.git] / nemo-impl / src / main / yang / generic-virtual-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-virtual-network {\r
10     yang-version 1;\r
11 \r
12     namespace "urn:opendaylight:params:xml:ns:yang:generic:virtual:network";\r
13     prefix "generic-vn";\r
14 \r
15     import nemo-engine-common {prefix nemo-engine-common;}\r
16     import generic-physical-network {prefix generic-pn;}\r
17     import nemo-common {prefix nemo-common;}\r
18     import ietf-inet-types {\r
19         prefix inet;\r
20         revision-date 2010-09-24;\r
21     }\r
22     import ietf-yang-types {\r
23         prefix yang;\r
24         revision-date 2010-09-24;\r
25     }\r
26 \r
27     revision "2015-10-10" {\r
28         description\r
29             "Initial revision.";\r
30     }\r
31 \r
32     grouping virtual-port-instance {\r
33         description\r
34             "Represents a virtual port instance and it's metadata.";\r
35 \r
36         leaf port-id {\r
37             description\r
38                 "A unique ID for a virtual port.";\r
39             type nemo-engine-common:virtual-port-id;\r
40             mandatory true;\r
41         }\r
42 \r
43         leaf port-type {\r
44             description\r
45                 "The type of a virtual port.";\r
46             type enumeration {\r
47                 enum external {\r
48                     description\r
49                         "The virtual port is connected to a external host\r
50                          or network device.";\r
51                 }\r
52                 enum internal {\r
53                     description\r
54                         "The virtual port is connected to a virtual node.";\r
55                 }\r
56             }\r
57             mandatory true;\r
58         }\r
59 \r
60         leaf bandwidth {\r
61             description\r
62                 "The bandwidth capacity of a virtual port.\r
63                  The unit is kbps.";\r
64             type uint32;\r
65             units kbps;\r
66         }\r
67 \r
68         container external-mac-addresses {\r
69             description\r
70                 "A list of external mac addresses in the layer2 network\r
71                  that connects to the virtual port.";\r
72 \r
73             leaf-list external-mac-address {\r
74                 type yang:mac-address;\r
75             }\r
76         }\r
77 \r
78         container external-ip-prefixes {\r
79             description\r
80                 "A list of external ip prefixes in the layer3 network\r
81                  that connects to the virtual port.";\r
82 \r
83             leaf-list external-ip-prefix {\r
84                 type inet:ip-prefix;\r
85             }\r
86         }\r
87 \r
88         list physical-resource-requirement {\r
89             description\r
90                 "A list of physical port attribute requirements\r
91                  for selecting physical port resource.";\r
92 \r
93             key "attribute-name";\r
94             uses generic-pn:attribute-instance;\r
95 \r
96             leaf attribute-match-pattern {\r
97                 description\r
98                     "The match pattern for an attribute instance.\r
99                      It represents the arithmetic logic.";\r
100                 type enumeration {\r
101                     enum less-than;\r
102                     enum not-less-than;\r
103                     enum equal;\r
104                     enum not-equal;\r
105                     enum greater-than;\r
106                     enum not-greater-than;\r
107                     enum between;\r
108                 }\r
109             }\r
110         }\r
111     }\r
112 \r
113     grouping virtual-node-instance {\r
114         description\r
115             "Represents a virtual node instance and it's metadata.";\r
116 \r
117         leaf node-id {\r
118             description\r
119                 "A unique ID for a virtual node.";\r
120             type nemo-engine-common:virtual-node-id;\r
121             mandatory true;\r
122         }\r
123 \r
124         leaf node-type {\r
125             description\r
126                 "The type of a virtual node.";\r
127             type enumeration {\r
128                 enum vswitch;\r
129                 enum vrouter;\r
130                 enum vfirewall;\r
131                 enum vloadbalancer;\r
132             }\r
133         }\r
134 \r
135         list virtual-port {\r
136             description\r
137                 "A list of ports of a virtual node.";\r
138 \r
139             key "port-id";\r
140             uses virtual-port-instance;\r
141         }\r
142 \r
143         list physical-resource-requirement {\r
144             description\r
145                 "A list of physical node attribute requirements\r
146                  for selecting physical node resource.";\r
147 \r
148             key "attribute-name";\r
149             uses generic-pn:attribute-instance;\r
150 \r
151             leaf attribute-match-pattern {\r
152                 description\r
153                     "The match pattern for an attribute instance.\r
154                      It represents the arithmetic logic.";\r
155                 type enumeration {\r
156                     enum less-than;\r
157                     enum not-less-than;\r
158                     enum equal;\r
159                     enum not-equal;\r
160                     enum greater-than;\r
161                     enum not-greater-than;\r
162                     enum between;\r
163                 }\r
164             }\r
165         }\r
166     }\r
167 \r
168     grouping virtual-link-instance {\r
169         description\r
170             "Represents a virtual link instance and it's metadata.";\r
171 \r
172         leaf link-id {\r
173             description\r
174                 "A unique ID for a virtual link.";\r
175             type nemo-engine-common:virtual-link-id;\r
176             mandatory true;\r
177         }\r
178 \r
179         leaf src-node-id {\r
180             description\r
181                 "A unique ID for the source virtual node.";\r
182             type nemo-engine-common:virtual-node-id;\r
183         }\r
184 \r
185         leaf src-port-id {\r
186             description\r
187                 "A unique ID for the source virtual port.";\r
188             type nemo-engine-common:virtual-port-id;\r
189         }\r
190 \r
191         leaf dest-node-id {\r
192             description\r
193                 "A unique ID for the destination virtual node.";\r
194             type nemo-engine-common:virtual-node-id;\r
195         }\r
196 \r
197         leaf dest-port-id {\r
198             description\r
199                 "A unique ID for the destination virtual port.";\r
200             type nemo-engine-common:virtual-port-id;\r
201         }\r
202 \r
203         leaf metric {\r
204             description\r
205                 "The routing metric is used by routing computation.";\r
206             type uint32;\r
207         }\r
208 \r
209         leaf bandwidth {\r
210             description\r
211                 "The bandwidth capacity of a virtual link.\r
212                  The unit is kbps.";\r
213             type uint32;\r
214             units kbps;\r
215         }\r
216 \r
217         leaf delay {\r
218             description\r
219                 "The packet transfer delay of a virtual link.\r
220                  The unit is millisecond.";\r
221             type uint32;\r
222             units millisecond;\r
223         }\r
224 \r
225         leaf delay-requirement {\r
226             description\r
227                 "The packet transfer delay requirement which\r
228                  is specified by the user and used in the virtual\r
229                  network mapping.";\r
230             type uint32;\r
231             units millisecond;\r
232         }\r
233     }\r
234 \r
235     grouping virtual-path-instance {\r
236         description\r
237             "Represents a virtual path instance and it's metadata.";\r
238 \r
239         leaf path-id {\r
240             description\r
241                 "A unique ID for a virtual path.";\r
242             type nemo-engine-common:virtual-path-id;\r
243             mandatory true;\r
244         }\r
245 \r
246         list virtual-link {\r
247             description\r
248                 "A list of virtual links which compose the virtual path.";\r
249 \r
250             key "link-id";\r
251             leaf link-id {\r
252                 description\r
253                     "A unique ID for the virtual link.";\r
254                 type nemo-engine-common:virtual-link-id;\r
255             }\r
256 \r
257             leaf order {\r
258                 description\r
259                     "Specify the order of the virtual link instance\r
260                      in a sequence list.";\r
261                 type uint32;\r
262             }\r
263         }\r
264 \r
265         leaf metric {\r
266             description\r
267                 "The routing metric of a virtual path.";\r
268             type uint32;\r
269         }\r
270 \r
271         leaf bandwidth {\r
272             description\r
273                 "The bandwidth capacity of a virtual path.\r
274                  The unit is kbps.";\r
275             type uint32;\r
276             units kbps;\r
277         }\r
278 \r
279         leaf delay {\r
280             description\r
281                 "The packet transfer delay of a virtual path.\r
282                  The unit is millisecond.";\r
283             type uint32;\r
284             units millisecond;\r
285         }\r
286     }\r
287 \r
288     grouping virtual-route-instance {\r
289         description\r
290             "Represents a route instance in the virtual network.";\r
291 \r
292         leaf src-node-id {\r
293             description\r
294                 "A unique ID for the source virtual node.";\r
295             type nemo-engine-common:virtual-node-id;\r
296         }\r
297 \r
298         leaf dest-node-id {\r
299             description\r
300                 "A unique ID for the destination virtual node.";\r
301             type nemo-engine-common:virtual-node-id;\r
302         }\r
303 \r
304         leaf path-id {\r
305             description\r
306                 "A unique ID for the virtual path.";\r
307             type nemo-engine-common:virtual-path-id;\r
308         }\r
309     }\r
310 \r
311     grouping virtual-arp-instance {\r
312         description\r
313             "Represents a arp instance in the virtual network.";\r
314 \r
315         leaf ip-address {\r
316             description\r
317                 "Represents the ip address for an ARP entry.";\r
318             type inet:ip-address;\r
319         }\r
320 \r
321         leaf mac-address {\r
322             description\r
323                 "Represents the mac address for an ARP entry.";\r
324             type yang:mac-address;\r
325         }\r
326 \r
327         leaf node-id {\r
328             description\r
329                 "A unique ID for the virtual node that connects to\r
330                  the host corresponding to the ARP entry.";\r
331             type nemo-engine-common:virtual-node-id;\r
332         }\r
333 \r
334         leaf port-id {\r
335             description\r
336                 "A unique ID for the virtual port that connects to\r
337                  the host corresponding to the ARP entry.";\r
338             type nemo-engine-common:virtual-port-id;\r
339         }\r
340     }\r
341 \r
342     container virtual-networks {\r
343         description\r
344             "Contains all virtual networks that the NEMO engine maintains.";\r
345 \r
346         list virtual-network {\r
347             description\r
348                 "A virtual network which a user created.";\r
349 \r
350             key "network-id";\r
351             leaf network-id {\r
352                 description\r
353                     "A unique ID for a virtual network.";\r
354                 type nemo-engine-common:virtual-network-id;\r
355             }\r
356 \r
357             leaf user-id {\r
358                 description\r
359                     "The user ID for the virtual network.";\r
360                 type nemo-common:user-id;\r
361             }\r
362 \r
363             container virtual-nodes {\r
364                 list virtual-node {\r
365                     description\r
366                         "All virtual nodes in the virtual network.";\r
367 \r
368                     key "node-id";\r
369                     uses virtual-node-instance;\r
370                 }\r
371             }\r
372 \r
373             container virtual-links {\r
374                 list virtual-link {\r
375                     description\r
376                         "All virtual links in the virtual network.";\r
377 \r
378                     key "link-id";\r
379                     uses virtual-link-instance;\r
380                 }\r
381             }\r
382 \r
383             container virtual-paths {\r
384                 list virtual-path {\r
385                     description\r
386                         "All virtual paths in the virtual network.";\r
387 \r
388                     key "path-id";\r
389                     uses virtual-path-instance;\r
390                 }\r
391             }\r
392 \r
393             container virtual-routes {\r
394                 list virtual-route {\r
395                     description\r
396                         "All virtual routes in the virtual network.";\r
397 \r
398                     key "src-node-id dest-node-id";\r
399                     uses virtual-route-instance;\r
400                 }\r
401             }\r
402 \r
403             container virtual-arps {\r
404                 list virtual-arp {\r
405                     description\r
406                         "All virtual ARP entries in the virtual network.";\r
407 \r
408                     key "ip-address";\r
409                     uses virtual-arp-instance;\r
410                 }\r
411             }\r
412         }\r
413     }\r
414 }\r