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