Merge branch 'v1.0'
[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   }
71
72   grouping virtual-interface {
73     container virtual-interface {
74       description
75           "Container for the virtual interface properties";
76
77       leaf type {
78         description
79             "Specifies the type of virtual interface
80              between VM and host.
81              VIRTIO          : Use the traditional VIRTIO interface.
82              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
83              SR-IOV          : Use SR-IOV interface.
84              E1000           : Emulate E1000 interface.
85              RTL8139         : Emulate RTL8139 interface.
86              PCNET           : Emulate PCNET interface.
87              OM-MGMT         : Used to specify openmano mgmt external-connection type";
88
89         type enumeration {
90           enum OM-MGMT;
91           enum PCI-PASSTHROUGH;
92           enum SR-IOV;
93           enum VIRTIO;
94           enum E1000;
95           enum RTL8139;
96           enum PCNET;
97         }
98         default "VIRTIO";
99       }
100
101       leaf vpci {
102         description
103             "Specifies the virtual PCI address. Expressed in
104              the following format dddd:dd:dd.d. For example
105              0000:00:12.0. This information can be used to
106              pass as metadata during the VM creation.";
107         type string;
108       }
109
110       leaf bandwidth {
111         description
112             "Aggregate bandwidth of the NIC.";
113         type uint64;
114       }
115     }
116   }
117
118   grouping vnfd-descriptor {
119       leaf id {
120         description "Identifier for the VNFD.";
121         type string;
122       }
123
124       leaf name {
125         description "VNFD name.";
126         mandatory true;
127         type string;
128       }
129
130       leaf short-name {
131         description "VNFD short name.";
132         type string;
133       }
134
135       leaf vendor {
136         description "Vendor of the VNFD.";
137         type string;
138       }
139
140       leaf logo {
141         description
142             "Vendor logo for the Virtual Network Function";
143         type string;
144       }
145
146       leaf description {
147         description "Description of the VNFD.";
148         type string;
149       }
150
151       leaf version {
152         description "Version of the VNFD";
153         type string;
154       }
155
156       uses manotypes:vnf-configuration;
157
158       container mgmt-interface {
159         description
160             "Interface over which the VNF is managed.";
161
162         choice endpoint-type {
163           description
164               "Indicates the type of management endpoint.";
165
166           case ip {
167             description
168                 "Specifies the static IP address for managing the VNF.";
169             leaf ip-address {
170               type inet:ip-address;
171             }
172           }
173
174           case vdu-id {
175             description
176                 "Use the default management interface on this VDU.";
177             leaf vdu-id {
178               type leafref {
179                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:id";
180               }
181             }
182           }
183
184           case cp {
185             description
186                 "Use the ip address associated with this connection point.";
187             leaf cp {
188               type leafref {
189                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
190               }
191             }
192           }
193         }
194
195         leaf port {
196           description
197               "Port for the management interface.";
198           type inet:port-number;
199         }
200
201         container dashboard-params {
202           description "Parameters for the VNF dashboard";
203
204           leaf path {
205             description "The HTTP path for the dashboard";
206             type string;
207           }
208
209           leaf https {
210             description "Pick HTTPS instead of HTTP , Default is false";
211             type boolean;
212           }
213
214           leaf port {
215             description "The HTTP port for the dashboard";
216             type inet:port-number;
217           }
218         }
219       }
220
221       list internal-vld {
222         key "id";
223         description
224             "List of Internal Virtual Link Descriptors (VLD).
225             The internal VLD describes the basic topology of
226             the connectivity (e.g. E-LAN, E-Line, E-Tree)
227             between internal VNF components of the system.";
228
229         leaf id {
230           description "Identifier for the VLD";
231           type string;
232         }
233
234         leaf name {
235           description "Name of the internal VLD";
236           type string;
237         }
238
239         leaf short-name {
240           description "Short name of the internal VLD";
241           type string;
242         }
243
244         leaf description {
245           type string;
246         }
247
248         leaf type {
249           type manotypes:virtual-link-type;
250         }
251
252         leaf root-bandwidth {
253           description
254               "For ELAN this is the aggregate bandwidth.";
255           type uint64;
256         }
257
258         leaf leaf-bandwidth {
259           description
260               "For ELAN this is the bandwidth of branches.";
261           type uint64;
262         }
263
264         list internal-connection-point {
265           key "id-ref";
266           description "List of internal connection points in this VLD";
267           leaf id-ref {
268             description "reference to the internal connection point id";
269             type leafref {
270               path "../../../vdu/internal-connection-point/id";
271             }
272           }
273         }
274         uses manotypes:provider-network;
275       }
276
277       list connection-point {
278         key "name";
279         description
280             "List for external connection points. Each VNF has one
281             or more external connection points. As the name
282             implies that external connection points are used for
283             connecting the VNF to other VNFs or to external networks.
284             Each VNF exposes these connection points to the
285             orchestrator. The orchestrator can construct network
286             services by connecting the connection points between
287             different VNFs. The NFVO will use VLDs and VNFFGs at
288             the network service level to construct network services.";
289
290         uses common-connection-point;
291       }
292
293       list vdu {
294         description "List of Virtual Deployment Units";
295         key "id";
296
297         leaf id {
298           description "Unique id for the VDU";
299           type string;
300         }
301
302         leaf name {
303           description "Unique name for the VDU";
304           type string;
305         }
306
307         leaf description {
308             description "Description of the VDU.";
309             type string;
310         }
311
312         leaf count {
313           description "Number of instances of VDU";
314           type uint64;
315         }
316
317         leaf mgmt-vpci {
318           description
319               "Specifies the virtual PCI address. Expressed in
320              the following format dddd:dd:dd.d. For example
321              0000:00:12.0. This information can be used to
322              pass as metadata during the VM creation.";
323           type string;
324         }
325
326         uses manotypes:vm-flavor;
327         uses manotypes:guest-epa;
328         uses manotypes:vswitch-epa;
329         uses manotypes:hypervisor-epa;
330         uses manotypes:host-epa;
331
332         list alarm {
333           key "alarm-id";
334
335           uses manotypes:alarm;
336         }
337
338         uses manotypes:image-properties;
339
340         choice cloud-init-input {
341           description
342             "Indicates how the contents of cloud-init script are provided.
343              There are 2 choices - inline or in a file";
344
345           case inline {
346             leaf cloud-init {
347               description
348                 "Contents of cloud-init script, provided inline, in cloud-config format";
349               type string;
350             }
351           }
352
353           case filename {
354             leaf cloud-init-file {
355               description
356                 "Name of file with contents of cloud-init script in cloud-config format";
357                 type string;
358             }
359           }
360         }
361
362         uses manotypes:custom-boot-data;
363
364         list internal-connection-point {
365           key "id";
366           description
367               "List for internal connection points. Each VNFC
368               has zero or more internal connection points.
369               Internal connection points are used for connecting
370               the VNF components internal to the VNF. If a VNF
371               has only one VNFC, it may not have any internal
372               connection points.";
373
374           uses common-connection-point;
375
376           leaf internal-vld-ref {
377             type leafref {
378               path "../../../internal-vld/id";
379             }
380           }
381         }
382
383         list internal-interface {
384           description
385               "List of internal interfaces for the VNF";
386           key name;
387
388           leaf name {
389             description
390                 "Name of internal interface. Note that this
391                 name has only local significance to the VDU.";
392             type string;
393           }
394
395           leaf vdu-internal-connection-point-ref {
396             type leafref {
397               path "../../internal-connection-point/id";
398             }
399           }
400           uses virtual-interface;
401         }
402
403         list external-interface {
404           description
405               "List of external interfaces for the VNF.
406               The external interfaces enable sending
407               traffic to and from VNF.";
408           key name;
409
410           leaf name {
411             description
412                 "Name of the external interface. Note that
413                 this name has only local significance.";
414             type string;
415           }
416
417           leaf vnfd-connection-point-ref {
418             description
419               "Name of the external connection point.";
420             type leafref {
421               path "../../../connection-point/name";
422             }
423           }
424           uses virtual-interface;
425         }
426
427         list volumes {
428           key "name";
429
430           leaf name {
431             description "Name of the disk-volumes, e.g. vda, vdb etc";
432             type string;
433           }
434
435           uses manotypes:volume-info;
436         } 
437       }
438
439       list vdu-dependency {
440         description
441             "List of VDU dependencies.";
442
443         key vdu-source-ref;
444         leaf vdu-source-ref {
445           type leafref {
446             path "../../vdu/id";
447           }
448         }
449
450         leaf vdu-depends-on-ref {
451           description
452               "Reference to the VDU that
453               source VDU depends.";
454           type leafref {
455             path "../../vdu/id";
456           }
457         }
458       }
459
460       leaf service-function-chain {
461         description "Type of node in Service Function Chaining Architecture";
462
463         type enumeration {
464           enum UNAWARE;
465           enum CLASSIFIER;
466           enum SF;
467           enum SFF;
468         }
469         default "UNAWARE";
470       }
471
472       leaf service-function-type {
473         description
474             "Type of Service Function.
475              NOTE: This needs to map with Service Function Type in ODL to
476              support VNFFG. Service Function Type is manadatory param in ODL
477              SFC. This is temporarily set to string for ease of use";
478             type string;
479       }
480
481       uses manotypes:monitoring-param;
482
483       list placement-groups {
484         description "List of placement groups at VNF level";
485
486         key "name";
487         uses manotypes:placement-group-info;
488
489         list member-vdus {
490
491           description
492               "List of VDUs that are part of this placement group";
493           key "member-vdu-ref";
494
495           leaf member-vdu-ref {
496             type leafref {
497               path "../../../vdu/id";
498             }
499           }
500         }
501       }
502   }
503
504   container vnfd-catalog {
505     description
506         "Virtual Network Function Descriptor (VNFD).";
507
508     list vnfd {
509       key "id";
510
511       uses vnfd-descriptor;
512      }
513   }
514 }
515
516 // vim: sw=2