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