Model changes to change leaf-lists to lists
[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         list internal-connection-point {
272           key "id-ref";
273           description "List of internal connection points in this VLD";
274           leaf id-ref {
275             description "reference to the internal connection point id";
276             type leafref {
277               path "../../../vdu/internal-connection-point/id";
278             }
279           }
280         }
281         uses manotypes:provider-network;
282       }
283
284       list connection-point {
285         key "name";
286         description
287             "List for external connection points. Each VNF has one
288             or more external connection points. As the name
289             implies that external connection points are used for
290             connecting the VNF to other VNFs or to external networks.
291             Each VNF exposes these connection points to the
292             orchestrator. The orchestrator can construct network
293             services by connecting the connection points between
294             different VNFs. The NFVO will use VLDs and VNFFGs at
295             the network service level to construct network services.";
296
297         uses common-connection-point;
298       }
299
300       list vdu {
301         description "List of Virtual Deployment Units";
302         key "id";
303
304         leaf id {
305           description "Unique id for the VDU";
306           type string;
307         }
308
309         leaf name {
310           description "Unique name for the VDU";
311           type string;
312         }
313
314         leaf description {
315             description "Description of the VDU.";
316             type string;
317         }
318
319         leaf count {
320           description "Number of instances of VDU";
321           type uint64;
322         }
323
324         leaf mgmt-vpci {
325           description
326               "Specifies the virtual PCI address. Expressed in
327              the following format dddd:dd:dd.d. For example
328              0000:00:12.0. This information can be used to
329              pass as metadata during the VM creation.";
330           type string;
331         }
332
333         uses manotypes:vm-flavor;
334         uses manotypes:guest-epa;
335         uses manotypes:vswitch-epa;
336         uses manotypes:hypervisor-epa;
337         uses manotypes:host-epa;
338
339         list alarm {
340           key "alarm-id";
341
342           uses manotypes:alarm;
343         }
344
345         leaf image {
346           description
347             "Image name for the software image.
348              If the image name is found within the VNF packaage it will
349              be uploaded to all cloud accounts during onboarding process.
350              Otherwise, the image must be added to the cloud account with
351              the same name as entered here.
352             ";
353           mandatory true;
354           type string;
355         }
356
357         leaf image-checksum {
358           description
359             "Image md5sum for the software image.
360             The md5sum, if provided, along with the image name uniquely
361             identifies an image uploaded to the CAL.
362             ";
363           type string;
364         }
365
366         choice cloud-init-input {
367           description
368             "Indicates how the contents of cloud-init script are provided.
369              There are 2 choices - inline or in a file";
370
371           case inline {
372             leaf cloud-init {
373               description
374                 "Contents of cloud-init script, provided inline, in cloud-config format";
375               type string;
376             }
377           }
378
379           case filename {
380             leaf cloud-init-file {
381               description
382                 "Name of file with contents of cloud-init script in cloud-config format";
383                 type string;
384             }
385           }
386         }
387
388         list internal-connection-point {
389           key "id";
390           description
391               "List for internal connection points. Each VNFC
392               has zero or more internal connection points.
393               Internal connection points are used for connecting
394               the VNF components internal to the VNF. If a VNF
395               has only one VNFC, it may not have any internal
396               connection points.";
397
398           uses common-connection-point;
399
400           leaf internal-vld-ref {
401             type leafref {
402               path "../../../internal-vld/id";
403             }
404           }
405         }
406
407         list internal-interface {
408           description
409               "List of internal interfaces for the VNF";
410           key name;
411
412           leaf name {
413             description
414                 "Name of internal interface. Note that this
415                 name has only local significance to the VDU.";
416             type string;
417           }
418
419           leaf vdu-internal-connection-point-ref {
420             type leafref {
421               path "../../internal-connection-point/id";
422             }
423           }
424           uses virtual-interface;
425         }
426
427         list external-interface {
428           description
429               "List of external interfaces for the VNF.
430               The external interfaces enable sending
431               traffic to and from VNF.";
432           key name;
433
434           leaf name {
435             description
436                 "Name of the external interface. Note that
437                 this name has only local significance.";
438             type string;
439           }
440
441           leaf vnfd-connection-point-ref {
442             description
443               "Name of the external connection point.";
444             type leafref {
445               path "../../../connection-point/name";
446             }
447           }
448           uses virtual-interface;
449         }
450       }
451
452       list vdu-dependency {
453         description
454             "List of VDU dependencies.";
455
456         key vdu-source-ref;
457         leaf vdu-source-ref {
458           type leafref {
459             path "../../vdu/id";
460           }
461         }
462
463         leaf vdu-depends-on-ref {
464           description
465               "Reference to the VDU that
466               source VDU depends.";
467           type leafref {
468             path "../../vdu/id";
469           }
470         }
471       }
472
473       leaf service-function-chain {
474         description "Type of node in Service Function Chaining Architecture";
475
476         type enumeration {
477           enum UNAWARE;
478           enum CLASSIFIER;
479           enum SF;
480           enum SFF;
481         }
482         default "UNAWARE";
483       }
484
485       leaf service-function-type {
486         description
487             "Type of Service Function.
488              NOTE: This needs to map with Service Function Type in ODL to
489              support VNFFG. Service Function Type is manadatory param in ODL
490              SFC. This is temporarily set to string for ease of use";
491             type string;
492       }
493
494       uses manotypes:monitoring-param;
495
496       list placement-groups {
497         description "List of placement groups at VNF level";
498
499         key "name";
500         uses manotypes:placement-group-info;
501         
502         list member-vdus {
503
504           description
505               "List of VDUs that are part of this placement group";
506           key "member-vdu-ref";
507
508           leaf member-vdu-ref {
509             type leafref {
510               path "../../../vdu/id";
511             }
512           }
513         }
514       }
515     }
516   }
517 }
518
519 // vim: sw=2