Bug 113 add VNFD copy to VNFR
[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         list internal-connection-point {
363           key "id";
364           description
365               "List for internal connection points. Each VNFC
366               has zero or more internal connection points.
367               Internal connection points are used for connecting
368               the VNF components internal to the VNF. If a VNF
369               has only one VNFC, it may not have any internal
370               connection points.";
371
372           uses common-connection-point;
373
374           leaf internal-vld-ref {
375             type leafref {
376               path "../../../internal-vld/id";
377             }
378           }
379         }
380
381         list internal-interface {
382           description
383               "List of internal interfaces for the VNF";
384           key name;
385
386           leaf name {
387             description
388                 "Name of internal interface. Note that this
389                 name has only local significance to the VDU.";
390             type string;
391           }
392
393           leaf vdu-internal-connection-point-ref {
394             type leafref {
395               path "../../internal-connection-point/id";
396             }
397           }
398           uses virtual-interface;
399         }
400
401         list external-interface {
402           description
403               "List of external interfaces for the VNF.
404               The external interfaces enable sending
405               traffic to and from VNF.";
406           key name;
407
408           leaf name {
409             description
410                 "Name of the external interface. Note that
411                 this name has only local significance.";
412             type string;
413           }
414
415           leaf vnfd-connection-point-ref {
416             description
417               "Name of the external connection point.";
418             type leafref {
419               path "../../../connection-point/name";
420             }
421           }
422           uses virtual-interface;
423         }
424
425         list volumes {
426           key "name";
427
428           leaf name {
429             description "Name of the disk-volumes, e.g. vda, vdb etc";
430             type string;
431           }
432
433           uses manotypes:volume-info;
434         } 
435       }
436
437       list vdu-dependency {
438         description
439             "List of VDU dependencies.";
440
441         key vdu-source-ref;
442         leaf vdu-source-ref {
443           type leafref {
444             path "../../vdu/id";
445           }
446         }
447
448         leaf vdu-depends-on-ref {
449           description
450               "Reference to the VDU that
451               source VDU depends.";
452           type leafref {
453             path "../../vdu/id";
454           }
455         }
456       }
457
458       leaf service-function-chain {
459         description "Type of node in Service Function Chaining Architecture";
460
461         type enumeration {
462           enum UNAWARE;
463           enum CLASSIFIER;
464           enum SF;
465           enum SFF;
466         }
467         default "UNAWARE";
468       }
469
470       leaf service-function-type {
471         description
472             "Type of Service Function.
473              NOTE: This needs to map with Service Function Type in ODL to
474              support VNFFG. Service Function Type is manadatory param in ODL
475              SFC. This is temporarily set to string for ease of use";
476             type string;
477       }
478
479       uses manotypes:monitoring-param;
480
481       list placement-groups {
482         description "List of placement groups at VNF level";
483
484         key "name";
485         uses manotypes:placement-group-info;
486
487         list member-vdus {
488
489           description
490               "List of VDUs that are part of this placement group";
491           key "member-vdu-ref";
492
493           leaf member-vdu-ref {
494             type leafref {
495               path "../../../vdu/id";
496             }
497           }
498         }
499       }
500   }
501
502   container vnfd-catalog {
503     description
504         "Virtual Network Function Descriptor (VNFD).";
505
506     list vnfd {
507       key "id";
508
509       uses vnfd-descriptor;
510      }
511   }
512 }
513
514 // vim: sw=2