Merge "Bug 140"
[osm/SO.git] / models / plugins / yang / vnfd.yang
1
2 /*
3  * 
4  *   Copyright 2016 RIFT.IO Inc
5  *
6  *   Licensed under the Apache License, Version 2.0 (the "License");
7  *   you may not use this file except in compliance with the License.
8  *   You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *   Unless required by applicable law or agreed to in writing, software
13  *   distributed under the License is distributed on an "AS IS" BASIS,
14  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *   See the License for the specific language governing permissions and
16  *   limitations under the License.
17  *
18  *
19  */
20
21 module vnfd
22 {
23   namespace "urn:ietf:params:xml:ns:yang:nfvo:vnfd";
24   prefix "vnfd";
25
26   import mano-types {
27     prefix "manotypes";
28   }
29
30   import rw-pb-ext {
31     prefix "rwpb";
32   }
33
34   import ietf-yang-types {
35     prefix "yang";
36   }
37
38   import ietf-inet-types {
39     prefix "inet";
40   }
41
42   revision 2015-09-10 {
43     description
44       "Initial revision. This YANG file defines
45        the Virtual Network Function (VNF)";
46     reference
47       "Derived from earlier versions of base YANG files";
48   }
49
50   grouping common-connection-point {
51     leaf name {
52       description "Name of the connection point";
53       type string;
54     }
55
56     leaf id {
57       description "Identifier for the internal connection points";
58       type string;
59     }
60
61     leaf short-name {
62       description "Short name of the connection point";
63       type string;
64     }
65
66     leaf type {
67       description "Type of the connection point.";
68       type manotypes:connection-point-type;
69     }
70     leaf port-security-enabled {
71       description "Enables the port security for the port";
72       type boolean;
73       default true;
74     }
75   }
76
77   grouping virtual-interface {
78     container virtual-interface {
79       description
80           "Container for the virtual interface properties";
81
82       leaf type {
83         description
84             "Specifies the type of virtual interface
85              between VM and host.
86              VIRTIO          : Use the traditional VIRTIO interface.
87              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
88              SR-IOV          : Use SR-IOV interface.
89              E1000           : Emulate E1000 interface.
90              RTL8139         : Emulate RTL8139 interface.
91              PCNET           : Emulate PCNET interface.
92              OM-MGMT         : Used to specify openmano mgmt external-connection type";
93
94         type enumeration {
95           enum OM-MGMT;
96           enum PCI-PASSTHROUGH;
97           enum SR-IOV;
98           enum VIRTIO;
99           enum E1000;
100           enum RTL8139;
101           enum PCNET;
102         }
103         default "VIRTIO";
104       }
105
106       leaf vpci {
107         description
108             "Specifies the virtual PCI address. Expressed in
109              the following format dddd:dd:dd.d. For example
110              0000:00:12.0. This information can be used to
111              pass as metadata during the VM creation.";
112         type string;
113       }
114
115       leaf bandwidth {
116         description
117             "Aggregate bandwidth of the NIC.";
118         type uint64;
119       }
120     }
121   }
122
123   grouping vnfd-descriptor {
124       leaf id {
125         description "Identifier for the VNFD.";
126         type string;
127       }
128
129       leaf name {
130         description "VNFD name.";
131         mandatory true;
132         type string;
133       }
134
135       leaf short-name {
136         description "VNFD short name.";
137         type string;
138       }
139
140       leaf vendor {
141         description "Vendor of the VNFD.";
142         type string;
143       }
144
145       leaf logo {
146         description
147             "Vendor logo for the Virtual Network Function";
148         type string;
149       }
150
151       leaf description {
152         description "Description of the VNFD.";
153         type string;
154       }
155
156       leaf version {
157         description "Version of the VNFD";
158         type string;
159       }
160
161       uses manotypes:vnf-configuration;
162
163       container mgmt-interface {
164         description
165             "Interface over which the VNF is managed.";
166
167         choice endpoint-type {
168           description
169               "Indicates the type of management endpoint.";
170
171           case ip {
172             description
173                 "Specifies the static IP address for managing the VNF.";
174             leaf ip-address {
175               type inet:ip-address;
176             }
177           }
178
179           case vdu-id {
180             description
181                 "Use the default management interface on this VDU.";
182             leaf vdu-id {
183               type leafref {
184                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:id";
185               }
186             }
187           }
188
189           case cp {
190             description
191                 "Use the ip address associated with this connection point.";
192             leaf cp {
193               type leafref {
194                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
195               }
196             }
197           }
198         }
199
200         leaf port {
201           description
202               "Port for the management interface.";
203           type inet:port-number;
204         }
205
206         container dashboard-params {
207           description "Parameters for the VNF dashboard";
208
209           leaf path {
210             description "The HTTP path for the dashboard";
211             type string;
212           }
213
214           leaf https {
215             description "Pick HTTPS instead of HTTP , Default is false";
216             type boolean;
217           }
218
219           leaf port {
220             description "The HTTP port for the dashboard";
221             type inet:port-number;
222           }
223         }
224       }
225
226       list internal-vld {
227         key "id";
228         description
229             "List of Internal Virtual Link Descriptors (VLD).
230             The internal VLD describes the basic topology of
231             the connectivity (e.g. E-LAN, E-Line, E-Tree)
232             between internal VNF components of the system.";
233
234         leaf id {
235           description "Identifier for the VLD";
236           type string;
237         }
238
239         leaf name {
240           description "Name of the internal VLD";
241           type string;
242         }
243
244         leaf short-name {
245           description "Short name of the internal VLD";
246           type string;
247         }
248
249         leaf description {
250           type string;
251         }
252
253         leaf type {
254           type manotypes:virtual-link-type;
255         }
256
257         leaf root-bandwidth {
258           description
259               "For ELAN this is the aggregate bandwidth.";
260           type uint64;
261         }
262
263         leaf leaf-bandwidth {
264           description
265               "For ELAN this is the bandwidth of branches.";
266           type uint64;
267         }
268
269
270         list internal-connection-point {
271           key "id-ref";
272           description "List of internal connection points in this VLD";
273           leaf id-ref {
274             description "reference to the internal connection point id";
275             type leafref {
276               path "../../../vdu/internal-connection-point/id";
277             }
278           }
279         }
280         uses manotypes:provider-network;
281         choice init-params {
282           description "Extra parameters for VLD instantiation";
283
284           case vim-network-ref {
285             leaf vim-network-name {
286               description
287                   "Name of network in VIM account. This is used to indicate
288                     pre-provisioned network name in cloud account.";
289               type string;
290             }
291           }
292
293           case vim-network-profile {
294             leaf ip-profile-ref {
295               description "Named reference to IP-profile object";
296               type string;
297             }
298           }
299
300         }
301       }
302
303       uses manotypes:ip-profile-list;
304
305       list connection-point {
306         key "name";
307         description
308             "List for external connection points. Each VNF has one
309             or more external connection points. As the name
310             implies that external connection points are used for
311             connecting the VNF to other VNFs or to external networks.
312             Each VNF exposes these connection points to the
313             orchestrator. The orchestrator can construct network
314             services by connecting the connection points between
315             different VNFs. The NFVO will use VLDs and VNFFGs at
316             the network service level to construct network services.";
317
318         uses common-connection-point;
319       }
320
321       list vdu {
322         description "List of Virtual Deployment Units";
323         key "id";
324
325         leaf id {
326           description "Unique id for the VDU";
327           type string;
328         }
329
330         leaf name {
331           description "Unique name for the VDU";
332           type string;
333         }
334
335         leaf description {
336             description "Description of the VDU.";
337             type string;
338         }
339
340         leaf count {
341           description "Number of instances of VDU";
342           type uint64;
343         }
344
345         leaf mgmt-vpci {
346           description
347               "Specifies the virtual PCI address. Expressed in
348              the following format dddd:dd:dd.d. For example
349              0000:00:12.0. This information can be used to
350              pass as metadata during the VM creation.";
351           type string;
352         }
353
354         uses manotypes:vm-flavor;
355         uses manotypes:guest-epa;
356         uses manotypes:vswitch-epa;
357         uses manotypes:hypervisor-epa;
358         uses manotypes:host-epa;
359
360         list alarm {
361           key "alarm-id";
362
363           uses manotypes:alarm;
364         }
365
366         uses manotypes:image-properties;
367
368         choice cloud-init-input {
369           description
370             "Indicates how the contents of cloud-init script are provided.
371              There are 2 choices - inline or in a file";
372
373           case inline {
374             leaf cloud-init {
375               description
376                 "Contents of cloud-init script, provided inline, in cloud-config format";
377               type string;
378             }
379           }
380
381           case filename {
382             leaf cloud-init-file {
383               description
384                 "Name of file with contents of cloud-init script in cloud-config format";
385                 type string;
386             }
387           }
388         }
389
390         uses manotypes:supplemental-boot-data;
391
392         list internal-connection-point {
393           key "id";
394           description
395               "List for internal connection points. Each VNFC
396               has zero or more internal connection points.
397               Internal connection points are used for connecting
398               the VNF components internal to the VNF. If a VNF
399               has only one VNFC, it may not have any internal
400               connection points.";
401
402           uses common-connection-point;
403
404           leaf internal-vld-ref {
405             type leafref {
406               path "../../../internal-vld/id";
407             }
408           }
409         }
410
411         list internal-interface {
412           description
413               "List of internal interfaces for the VNF";
414           key name;
415
416           leaf name {
417             description
418                 "Name of internal interface. Note that this
419                 name has only local significance to the VDU.";
420             type string;
421           }
422
423           leaf vdu-internal-connection-point-ref {
424             type leafref {
425               path "../../internal-connection-point/id";
426             }
427           }
428           uses virtual-interface;
429         }
430
431         list external-interface {
432           description
433               "List of external interfaces for the VNF.
434               The external interfaces enable sending
435               traffic to and from VNF.";
436           key name;
437
438           leaf name {
439             description
440                 "Name of the external interface. Note that
441                 this name has only local significance.";
442             type string;
443           }
444
445           leaf vnfd-connection-point-ref {
446             description
447               "Name of the external connection point.";
448             type leafref {
449               path "../../../connection-point/name";
450             }
451           }
452           uses virtual-interface;
453         }
454
455         list volumes {
456           key "name";
457
458           leaf name {
459             description "Name of the disk-volumes, e.g. vda, vdb etc";
460             type string;
461           }
462
463           uses manotypes:volume-info;
464         } 
465       }
466
467       list vdu-dependency {
468         description
469             "List of VDU dependencies.";
470
471         key vdu-source-ref;
472         leaf vdu-source-ref {
473           type leafref {
474             path "../../vdu/id";
475           }
476         }
477
478         leaf vdu-depends-on-ref {
479           description
480               "Reference to the VDU that
481               source VDU depends.";
482           type leafref {
483             path "../../vdu/id";
484           }
485         }
486       }
487
488       leaf service-function-chain {
489         description "Type of node in Service Function Chaining Architecture";
490
491         type enumeration {
492           enum UNAWARE;
493           enum CLASSIFIER;
494           enum SF;
495           enum SFF;
496         }
497         default "UNAWARE";
498       }
499
500       leaf service-function-type {
501         description
502             "Type of Service Function.
503              NOTE: This needs to map with Service Function Type in ODL to
504              support VNFFG. Service Function Type is manadatory param in ODL
505              SFC. This is temporarily set to string for ease of use";
506             type string;
507       }
508
509       uses manotypes:monitoring-param;
510
511       list placement-groups {
512         description "List of placement groups at VNF level";
513
514         key "name";
515         uses manotypes:placement-group-info;
516
517         list member-vdus {
518
519           description
520               "List of VDUs that are part of this placement group";
521           key "member-vdu-ref";
522
523           leaf member-vdu-ref {
524             type leafref {
525               path "../../../vdu/id";
526             }
527           }
528         }
529       }
530   }
531
532   container vnfd-catalog {
533     description
534         "Virtual Network Function Descriptor (VNFD).";
535
536     list vnfd {
537       key "id";
538
539       uses vnfd-descriptor;
540      }
541   }
542 }
543
544 // vim: sw=2