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