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