3ab3eab83e496526387ae2bb3d223e655a8bd4f0
[osm/IM.git] / models / yang / vnfd-base.yang
1
2 /*
3  *
4  *   Copyright 2017 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-base
22 {
23   namespace "http://riftio.com/ns/riftware-1.0/vnfd-base";
24   prefix "vnfd-base";
25
26   import mano-types {
27     prefix "manotypes";
28   }
29
30   import ietf-inet-types {
31     prefix "inet";
32   }
33
34   revision 2017-02-28 {
35     description
36       "Initial revision. This YANG file defines
37        the common types for Virtual Network Function
38        (VNF) descriptor";
39     reference
40       "Derived from earlier versions of base YANG files";
41   }
42
43   grouping common-connection-point {
44     leaf name {
45       description "Name of the connection point";
46       type string;
47     }
48
49     leaf id {
50       description "Identifier for the internal connection points";
51       type string;
52     }
53
54     leaf short-name {
55       description "Short name to appear as label in the UI";
56       type string;
57     }
58
59     leaf type {
60       description "Type of the connection point.";
61       type manotypes:connection-point-type;
62     }
63
64     leaf port-security-enabled {
65       description "Enables the port security for the port";
66       type boolean;
67       default true;
68     }
69   }
70
71   typedef interface-type {
72     type enumeration {
73       enum INTERNAL;
74       enum EXTERNAL;
75     }
76   }
77
78   typedef vnf-operational-status {
79     type enumeration {
80       enum init;
81       enum running;
82       enum upgrading;
83       enum terminate;
84       enum terminated;
85       enum failed;
86     }
87   }
88
89   grouping virtual-interface {
90     container virtual-interface {
91       description
92           "Container for the virtual interface properties";
93
94       leaf type {
95         description
96             "Specifies the type of virtual interface
97              between VM and host.
98              VIRTIO          : Use the traditional VIRTIO interface.
99              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
100              SR-IOV          : Use SR-IOV interface.
101              E1000           : Emulate E1000 interface.
102              RTL8139         : Emulate RTL8139 interface.
103              PCNET           : Emulate PCNET interface.
104              OM-MGMT         : Deprecated! Use VIRTIO instead and set the VNF management interface at vnfd:mgmt-interface:cp";
105
106         type enumeration {
107           enum OM-MGMT;
108           enum PCI-PASSTHROUGH;
109           enum SR-IOV;
110           enum VIRTIO;
111           enum E1000;
112           enum RTL8139;
113           enum PCNET;
114         }
115         default "VIRTIO";
116       }
117
118       leaf vpci {
119         description
120             "Specifies the virtual PCI address. Expressed in
121              the following format dddd:dd:dd.d. For example
122              0000:00:12.0. This information can be used to
123              pass as metadata during the VM creation.";
124         type string;
125       }
126
127       leaf bandwidth {
128         description
129             "Aggregate bandwidth of the NIC.";
130         type uint64;
131       }
132     }
133   }
134
135   grouping vnfd-descriptor {
136       leaf id {
137         description "Identifier for the VNFD.";
138         type string {
139           length "1..63";
140         }
141       }
142
143       leaf name {
144         description "VNFD name.";
145         mandatory true;
146         type string;
147       }
148
149       leaf short-name {
150         description "Short name to appear as label in the UI";
151         type string;
152       }
153
154       leaf vendor {
155         description "Vendor of the VNFD.";
156         type string;
157       }
158
159       leaf logo {
160         description
161             "Vendor logo for the Virtual Network Function";
162         type string;
163       }
164
165       leaf description {
166         description "Description of the VNFD.";
167         type string;
168       }
169
170       leaf version {
171         description "Version of the VNFD";
172         type string;
173       }
174
175       container vnf-configuration {
176         uses manotypes:vca-configuration;
177       }
178
179       leaf operational-status {
180          description
181            "The operational status of the VNF
182              init                : The VNF has just started.
183              running             : The VNF is active in VM
184              upgrading           : The VNF is being upgraded (EXPERIMENTAL)
185              terminate           : The VNF is being terminated
186              terminated          : The VNF is in the terminated state.
187              failed              : The VNF  instantiation failed.
188            ";
189          type vnf-operational-status;
190       }
191
192       container mgmt-interface {
193         description
194             "Interface over which the VNF is managed.";
195
196         choice endpoint-type {
197           description
198               "Indicates the type of management endpoint.";
199
200           case ip {
201             description
202                 "Specifies the static IP address for managing the VNF.";
203             leaf ip-address {
204               type inet:ip-address;
205             }
206           }
207
208           case vdu-id {
209             description
210                 "Use the default management interface on this VDU.";
211             leaf vdu-id {
212               type leafref {
213                 path "../../vdu/id";
214               }
215             }
216           }
217
218           case cp {
219             description
220                 "Use the ip address associated with this connection point. This cp is then considered as management.";
221             leaf cp {
222               type leafref {
223                 path "../../connection-point/name";
224               }
225             }
226           }
227         }
228
229         leaf port {
230           description
231               "Port for the management interface.";
232           type inet:port-number;
233         }
234
235         container dashboard-params {
236           description "Parameters for the VNF dashboard";
237
238           leaf path {
239             description "The HTTP path for the dashboard";
240             type string;
241           }
242
243           leaf https {
244             description "Pick HTTPS instead of HTTP , Default is false";
245             type boolean;
246           }
247
248           leaf port {
249             description "The HTTP port for the dashboard";
250             type inet:port-number;
251           }
252         }
253       }
254
255       list internal-vld {
256         key "id";
257         description
258           "List of Internal Virtual Link Descriptors (VLD).
259           The internal VLD describes the basic topology of
260           the connectivity such as E-LAN, E-Line, E-Tree.
261           between internal VNF components of the system.";
262
263         leaf id {
264           description "Identifier for the VLD";
265           type string;
266         }
267
268         leaf name {
269           description "Name of the internal VLD";
270           type string;
271         }
272
273         leaf short-name {
274           description "Short name to appear as label in the UI";
275           type string;
276         }
277
278         leaf description {
279           type string;
280         }
281
282         leaf type {
283           type manotypes:virtual-link-type;
284         }
285
286         leaf root-bandwidth {
287           description
288               "For ELAN this is the aggregate bandwidth.";
289           type uint64;
290         }
291
292         leaf leaf-bandwidth {
293           description
294               "For ELAN this is the bandwidth of branches.";
295           type uint64;
296         }
297
298         list internal-connection-point {
299           key "id-ref";
300           description "List of internal connection points in this VLD";
301           leaf id-ref {
302             description "reference to the internal connection point id";
303             type leafref {
304               path "../../../vdu/internal-connection-point/id";
305             }
306           }
307           leaf ip-address {
308             description "IP address of the internal connection point";
309             type inet:ip-address;
310           }
311         }
312
313         uses manotypes:provider-network;
314         choice init-params {
315           description "Extra parameters for VLD instantiation";
316
317           case vim-network-ref {
318             leaf vim-network-name {
319               description
320                   "Name of network in VIM account. This is used to indicate
321                     pre-provisioned network name in cloud account.";
322               type string;
323             }
324           }
325
326           case vim-network-profile {
327             leaf ip-profile-ref {
328               description "Named reference to IP-profile object";
329               type string;
330             }
331           }
332
333         }
334       }
335
336       uses manotypes:ip-profile-list;
337
338       list connection-point {
339         key "name";
340         description
341           "List for external connection points. Each VNF has one
342           or more external connection points that connect the VNF
343           to other VNFs or to external networks. Each VNF exposes
344           connection points to the orchestrator, which can construct
345           network services by connecting the connection points
346           between different VNFs. The NFVO will use VLDs and VNFFGs
347           at the network service level to construct network services.";
348
349         uses common-connection-point;
350       }
351
352       list vdu {
353         description "List of Virtual Deployment Units";
354         key "id";
355
356         leaf id {
357           description "Unique id for the VDU";
358           type string;
359         }
360
361         leaf name {
362           description "Unique name for the VDU";
363           type string;
364         }
365
366         leaf description {
367             description "Description of the VDU.";
368             type string;
369         }
370
371         leaf count {
372           description "Number of instances of VDU";
373           type uint64;
374         }
375
376         leaf mgmt-vpci {
377           description
378               "Specifies the virtual PCI address. Expressed in
379              the following format dddd:dd:dd.d. For example
380              0000:00:12.0. This information can be used to
381              pass as metadata during the VM creation.";
382           type string;
383         }
384
385         uses manotypes:vm-flavor;
386         uses manotypes:guest-epa;
387         uses manotypes:vswitch-epa;
388         uses manotypes:hypervisor-epa;
389         uses manotypes:host-epa;
390
391         list alarm {
392           key "alarm-id";
393
394           uses manotypes:alarm;
395         }
396
397         uses manotypes:image-properties;
398
399         list alternative-images {
400           key "vim-type";
401           description
402             "List of alternative images per VIM type.
403             Different images can be used for specific types of VIMs instead
404             of the default image. This allows deployments in sites where the
405             image identifier in the VIM is given by the VIM provider and
406             cannot be modified.
407             If an alternative image is specified for a VIM type, it will prevail
408             over the default image";
409
410           leaf vim-type {
411             description "VIM type: openvim, openstack, vmware, aws, etc.";
412             type string;
413           }
414
415           uses manotypes:image-properties;
416         }
417
418         container vdu-configuration {
419           uses manotypes:vca-configuration;
420         }
421
422         choice cloud-init-input {
423           description
424             "Indicates how the contents of cloud-init script are provided.
425              There are 2 choices - inline or in a file";
426
427           case inline {
428             leaf cloud-init {
429               description
430                 "Contents of cloud-init script, provided inline, in cloud-config format";
431               type string;
432             }
433           }
434
435           case filename {
436             leaf cloud-init-file {
437               description
438                 "Name of file with contents of cloud-init script in cloud-config format";
439                 type string;
440             }
441           }
442         }
443
444         uses manotypes:supplemental-boot-data;
445
446         list internal-connection-point {
447           key "id";
448           description
449             "List for internal connection points. Each VNFC
450             has zero or more internal connection points.
451             Internal connection points are used for connecting
452             the VNF with components internal to the VNF. If a VNF
453             has only one VNFC, it may not have any internal
454             connection points.";
455
456           uses common-connection-point;
457
458           leaf internal-vld-ref {
459             type leafref {
460               path "../../../internal-vld/id";
461             }
462           }
463         }
464
465         list interface {
466           description
467               "List of Interfaces (external and internal) for the VNF";
468           key name;
469
470           leaf name {
471             description
472                 "Name of the interface. Note that this
473                 name has only local significance to the VDU.";
474             type string;
475           }
476
477           leaf position {
478             description
479                 "Explicit Position of the interface within the list";
480             type uint32;
481           }
482
483           leaf type {
484             description
485                 "Type of the Interface";
486             type interface-type;
487
488             default "EXTERNAL";
489           }
490
491           leaf mac-address {
492             description
493                 "MAC address of the interface.
494                 Some VNFs require a specific MAC address to be configured
495                 in the interface. While this is not recommended at all in
496                 NFV environments, this parameter exists to allow those
497                 scenarios.
498                 This parameter will be likely deprecated in the future.";
499             type string;
500           }
501
502           choice connection-point-type {
503             case internal {
504               leaf internal-connection-point-ref {
505                 description
506                     "Leaf Ref to the particular internal connection point";
507                 type leafref {
508                    path "../../internal-connection-point/id";
509                  }
510               }
511             }
512             case external {
513               leaf external-connection-point-ref {
514                 description
515                     "Leaf Ref to the particular external connection point";
516                 type leafref {
517                    path "../../../connection-point/name";
518                  }
519               }
520             }
521           }
522
523           uses virtual-interface;
524         }
525
526
527         list volumes {
528           key "name";
529
530           leaf name {
531             description "Name of the disk-volumes, e.g. vda, vdb etc";
532             type string;
533           }
534
535           uses manotypes:volume-info;
536         }
537       }
538
539       list vdu-dependency {
540         description
541             "List of VDU dependencies.";
542
543         key vdu-source-ref;
544         leaf vdu-source-ref {
545           type leafref {
546             path "../../vdu/id";
547           }
548         }
549
550         leaf vdu-depends-on-ref {
551           description
552             "Reference to the VDU on which
553             the source VDU depends.";
554           type leafref {
555             path "../../vdu/id";
556           }
557         }
558       }
559
560       leaf service-function-chain {
561         description "Type of node in Service Function Chaining Architecture";
562
563         type enumeration {
564           enum UNAWARE;
565           enum CLASSIFIER;
566           enum SF;
567           enum SFF;
568         }
569         default "UNAWARE";
570       }
571
572       leaf service-function-type {
573         description
574           "Type of Service Function.
575            NOTE: This needs to map with Service Function Type in ODL to
576            support VNFFG. Service Function Type is mandatory param in ODL
577            SFC. This is temporarily set to string for ease of use";
578         type string;
579       }
580
581       uses manotypes:monitoring-param;
582
583       list placement-groups {
584         description "List of placement groups at VNF level";
585
586         key "name";
587         uses manotypes:placement-group-info;
588
589         list member-vdus {
590
591           description
592               "List of VDUs that are part of this placement group";
593           key "member-vdu-ref";
594
595           leaf member-vdu-ref {
596             type leafref {
597               path "../../../vdu/id";
598             }
599           }
600         }
601       }
602   }
603 }
604
605 // vim: sw=2