Merge changes I3b2a87cd,If344b5e0
[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     }
68   }
69
70   typedef interface-type {
71     type enumeration {
72       enum INTERNAL;
73       enum EXTERNAL;
74     }
75   }
76
77   grouping virtual-interface {
78     container virtual-interface {
79       description
80           "Container for the virtual interface properties";
81
82       leaf type {
83         description
84             "Specifies the type of virtual interface
85              between VM and host.
86              VIRTIO          : Use the traditional VIRTIO interface.
87              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
88              SR-IOV          : Use SR-IOV interface.
89              E1000           : Emulate E1000 interface.
90              RTL8139         : Emulate RTL8139 interface.
91              PCNET           : Emulate PCNET interface.
92              OM-MGMT         : Used to specify openmano mgmt external-connection type";
93
94         type enumeration {
95           enum OM-MGMT;
96           enum PCI-PASSTHROUGH;
97           enum SR-IOV;
98           enum VIRTIO;
99           enum E1000;
100           enum RTL8139;
101           enum PCNET;
102         }
103         default "VIRTIO";
104       }
105
106       leaf vpci {
107         description
108             "Specifies the virtual PCI address. Expressed in
109              the following format dddd:dd:dd.d. For example
110              0000:00:12.0. This information can be used to
111              pass as metadata during the VM creation.";
112         type string;
113       }
114
115       leaf bandwidth {
116         description
117             "Aggregate bandwidth of the NIC.";
118         type uint64;
119       }
120     }
121   }
122
123   grouping vnfd-descriptor {
124       leaf id {
125         description "Identifier for the VNFD.";
126         type string {
127           length "1..63";
128         }
129       }
130
131       leaf name {
132         description "VNFD name.";
133         mandatory true;
134         type string;
135       }
136
137       leaf short-name {
138         description "Short name to appear as label in the UI";
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:vca-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 "../../vdu/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 "../../connection-point/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 such as 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 to appear as label in the UI";
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
282         uses manotypes:provider-network;
283         choice init-params {
284           description "Extra parameters for VLD instantiation";
285
286           case vim-network-ref {
287             leaf vim-network-name {
288               description
289                   "Name of network in VIM account. This is used to indicate
290                     pre-provisioned network name in cloud account.";
291               type string;
292             }
293           }
294
295           case vim-network-profile {
296             leaf ip-profile-ref {
297               description "Named reference to IP-profile object";
298               type string;
299             }
300           }
301
302         }
303       }
304
305       uses manotypes:ip-profile-list;
306
307       list connection-point {
308         key "name";
309         description
310           "List for external connection points. Each VNF has one
311           or more external connection points that connect the VNF
312           to other VNFs or to external networks. Each VNF exposes
313           connection points to the orchestrator, which can construct
314           network services by connecting the connection points
315           between different VNFs. The NFVO will use VLDs and VNFFGs
316           at the network service level to construct network services.";
317
318         uses common-connection-point;
319       }
320
321       list vdu {
322         description "List of Virtual Deployment Units";
323         key "id";
324
325         leaf id {
326           description "Unique id for the VDU";
327           type string;
328         }
329
330         leaf name {
331           description "Unique name for the VDU";
332           type string;
333         }
334
335         leaf description {
336             description "Description of the VDU.";
337             type string;
338         }
339
340         leaf count {
341           description "Number of instances of VDU";
342           type uint64;
343         }
344
345         leaf mgmt-vpci {
346           description
347               "Specifies the virtual PCI address. Expressed in
348              the following format dddd:dd:dd.d. For example
349              0000:00:12.0. This information can be used to
350              pass as metadata during the VM creation.";
351           type string;
352         }
353
354         uses manotypes:vm-flavor;
355         uses manotypes:guest-epa;
356         uses manotypes:vswitch-epa;
357         uses manotypes:hypervisor-epa;
358         uses manotypes:host-epa;
359
360         list alarm {
361           key "alarm-id";
362
363           uses manotypes:alarm;
364         }
365
366         uses manotypes:image-properties;
367
368         choice cloud-init-input {
369           description
370             "Indicates how the contents of cloud-init script are provided.
371              There are 2 choices - inline or in a file";
372
373           case inline {
374             leaf cloud-init {
375               description
376                 "Contents of cloud-init script, provided inline, in cloud-config format";
377               type string;
378             }
379           }
380
381           case filename {
382             leaf cloud-init-file {
383               description
384                 "Name of file with contents of cloud-init script in cloud-config format";
385                 type string;
386             }
387           }
388         }
389
390         uses manotypes:supplemental-boot-data;
391
392         list internal-connection-point {
393           key "id";
394           description
395             "List for internal connection points. Each VNFC
396             has zero or more internal connection points.
397             Internal connection points are used for connecting
398             the VNF with components internal to the VNF. If a VNF
399             has only one VNFC, it may not have any internal
400             connection points.";
401
402           uses common-connection-point;
403
404           leaf internal-vld-ref {
405             type leafref {
406               path "../../../internal-vld/id";
407             }
408           }
409         }
410
411         list interface {
412           description
413               "List of Interfaces (external and internal) for the VNF";
414           key name;
415
416           leaf name {
417             description
418                 "Name of the interface. Note that this
419                 name has only local significance to the VDU.";
420             type string;
421           }
422
423           leaf position {
424             description
425                 "Explicit Position of the interface within the list";
426             type uint32;
427           }
428
429           leaf type {
430             description
431                 "Type of the Interface";
432             type interface-type;
433
434             default "EXTERNAL";
435           }
436
437           choice connection-point-type {
438             case internal {
439               leaf internal-connection-point-ref {
440                 description
441                     "Leaf Ref to the particular internal connection point";
442                 type leafref {
443                    path "../../internal-connection-point/id";
444                  }
445               }
446             }
447             case external {
448               leaf external-connection-point-ref {
449                 description
450                     "Leaf Ref to the particular external connection point";
451                 type leafref {
452                    path "../../../connection-point/name";
453                  }
454               }
455             }
456           }
457
458           uses virtual-interface;
459         }
460
461
462         list volumes {
463           key "name";
464
465           leaf name {
466             description "Name of the disk-volumes, e.g. vda, vdb etc";
467             type string;
468           }
469
470           uses manotypes:volume-info;
471         }
472       }
473
474       list vdu-dependency {
475         description
476             "List of VDU dependencies.";
477
478         key vdu-source-ref;
479         leaf vdu-source-ref {
480           type leafref {
481             path "../../vdu/id";
482           }
483         }
484
485         leaf vdu-depends-on-ref {
486           description
487             "Reference to the VDU on which
488             the source VDU depends.";
489           type leafref {
490             path "../../vdu/id";
491           }
492         }
493       }
494
495       leaf service-function-chain {
496         description "Type of node in Service Function Chaining Architecture";
497
498         type enumeration {
499           enum UNAWARE;
500           enum CLASSIFIER;
501           enum SF;
502           enum SFF;
503         }
504         default "UNAWARE";
505       }
506
507       leaf service-function-type {
508         description
509           "Type of Service Function.
510            NOTE: This needs to map with Service Function Type in ODL to
511            support VNFFG. Service Function Type is mandatory param in ODL
512            SFC. This is temporarily set to string for ease of use";
513         type string;
514       }
515
516       uses manotypes:monitoring-param;
517
518       list placement-groups {
519         description "List of placement groups at VNF level";
520
521         key "name";
522         uses manotypes:placement-group-info;
523
524         list member-vdus {
525
526           description
527               "List of VDUs that are part of this placement group";
528           key "member-vdu-ref";
529
530           leaf member-vdu-ref {
531             type leafref {
532               path "../../../vdu/id";
533             }
534           }
535         }
536       }
537   }
538 }
539
540 // vim: sw=2