New feature: Code changes for project support
[osm/SO.git] / models / plugins / yang / vnfd.yang
1
2 /*
3  * 
4  *   Copyright 2016-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
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   import rw-project {
43     prefix "rw-project";
44   }
45
46   revision 2017-02-08 {
47     description
48       "Update model to support projects.";
49   }
50
51   revision 2015-09-10 {
52     description
53       "Initial revision. This YANG file defines
54        the Virtual Network Function (VNF)";
55     reference
56       "Derived from earlier versions of base YANG files";
57   }
58
59   grouping common-connection-point {
60     leaf name {
61       description "Name of the connection point";
62       type string;
63     }
64
65     leaf id {
66       description "Identifier for the internal connection points";
67       type string;
68     }
69
70     leaf short-name {
71       description "Short name of the connection point";
72       type string;
73     }
74
75     leaf type {
76       description "Type of the connection point.";
77       type manotypes:connection-point-type;
78     }
79     leaf port-security-enabled {
80       description "Enables the port security for the port";
81       type boolean;
82     }
83   }
84
85   grouping virtual-interface {
86     container virtual-interface {
87       description
88           "Container for the virtual interface properties";
89
90       leaf type {
91         description
92             "Specifies the type of virtual interface
93              between VM and host.
94              VIRTIO          : Use the traditional VIRTIO interface.
95              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
96              SR-IOV          : Use SR-IOV interface.
97              E1000           : Emulate E1000 interface.
98              RTL8139         : Emulate RTL8139 interface.
99              PCNET           : Emulate PCNET interface.
100              OM-MGMT         : Used to specify openmano mgmt external-connection type";
101
102         type enumeration {
103           enum OM-MGMT;
104           enum PCI-PASSTHROUGH;
105           enum SR-IOV;
106           enum VIRTIO;
107           enum E1000;
108           enum RTL8139;
109           enum PCNET;
110         }
111         default "VIRTIO";
112       }
113
114       leaf vpci {
115         description
116             "Specifies the virtual PCI address. Expressed in
117              the following format dddd:dd:dd.d. For example
118              0000:00:12.0. This information can be used to
119              pass as metadata during the VM creation.";
120         type string;
121       }
122
123       leaf bandwidth {
124         description
125             "Aggregate bandwidth of the NIC.";
126         type uint64;
127       }
128     }
129   }
130
131   grouping vnfd-descriptor {
132       leaf id {
133         description "Identifier for the VNFD.";
134         type string;
135       }
136
137       leaf name {
138         description "VNFD name.";
139         mandatory true;
140         type string;
141       }
142
143       leaf short-name {
144         description "VNFD short name.";
145         type string;
146       }
147
148       leaf vendor {
149         description "Vendor of the VNFD.";
150         type string;
151       }
152
153       leaf logo {
154         description
155             "Vendor logo for the Virtual Network Function";
156         type string;
157       }
158
159       leaf description {
160         description "Description of the VNFD.";
161         type string;
162       }
163
164       leaf version {
165         description "Version of the VNFD";
166         type string;
167       }
168
169       uses manotypes:vnf-configuration;
170
171       container mgmt-interface {
172         description
173             "Interface over which the VNF is managed.";
174
175         choice endpoint-type {
176           description
177               "Indicates the type of management endpoint.";
178
179           case ip {
180             description
181                 "Specifies the static IP address for managing the VNF.";
182             leaf ip-address {
183               type inet:ip-address;
184             }
185           }
186
187           case vdu-id {
188             description
189                 "Use the default management interface on this VDU.";
190             leaf vdu-id {
191               type leafref {
192                 path "../../vdu/id";
193               }
194             }
195           }
196
197           case cp {
198             description
199                 "Use the ip address associated with this connection point.";
200             leaf cp {
201               type leafref {
202                 path "../../connection-point/name";
203               }
204             }
205           }
206         }
207
208         leaf port {
209           description
210               "Port for the management interface.";
211           type inet:port-number;
212         }
213
214         container dashboard-params {
215           description "Parameters for the VNF dashboard";
216
217           leaf path {
218             description "The HTTP path for the dashboard";
219             type string;
220           }
221
222           leaf https {
223             description "Pick HTTPS instead of HTTP , Default is false";
224             type boolean;
225           }
226
227           leaf port {
228             description "The HTTP port for the dashboard";
229             type inet:port-number;
230           }
231         }
232       }
233
234       list internal-vld {
235         key "id";
236         description
237             "List of Internal Virtual Link Descriptors (VLD).
238             The internal VLD describes the basic topology of
239             the connectivity (e.g. E-LAN, E-Line, E-Tree)
240             between internal VNF components of the system.";
241
242         leaf id {
243           description "Identifier for the VLD";
244           type string;
245         }
246
247         leaf name {
248           description "Name of the internal VLD";
249           type string;
250         }
251
252         leaf short-name {
253           description "Short name of the internal VLD";
254           type string;
255         }
256
257         leaf description {
258           type string;
259         }
260
261         leaf type {
262           type manotypes:virtual-link-type;
263         }
264
265         leaf root-bandwidth {
266           description
267               "For ELAN this is the aggregate bandwidth.";
268           type uint64;
269         }
270
271         leaf leaf-bandwidth {
272           description
273               "For ELAN this is the bandwidth of branches.";
274           type uint64;
275         }
276
277         list internal-connection-point {
278           key "id-ref";
279           description "List of internal connection points in this VLD";
280           leaf id-ref {
281             description "reference to the internal connection point id";
282             type leafref {
283               path "../../../vdu/internal-connection-point/id";
284             }
285           }
286         }
287         uses manotypes:provider-network;
288         choice init-params {
289           description "Extra parameters for VLD instantiation";
290
291           case vim-network-ref {
292             leaf vim-network-name {
293               description
294                   "Name of network in VIM account. This is used to indicate
295                     pre-provisioned network name in cloud account.";
296               type string;
297             }
298           }
299
300           case vim-network-profile {
301             leaf ip-profile-ref {
302               description "Named reference to IP-profile object";
303               type string;
304             }
305           }
306
307         }
308       }
309
310       uses manotypes:ip-profile-list;
311
312       list connection-point {
313         key "name";
314         description
315             "List for external connection points. Each VNF has one
316             or more external connection points. As the name
317             implies that external connection points are used for
318             connecting the VNF to other VNFs or to external networks.
319             Each VNF exposes these connection points to the
320             orchestrator. The orchestrator can construct network
321             services by connecting the connection points between
322             different VNFs. The NFVO will use VLDs and VNFFGs at
323             the network service level to construct network services.";
324
325         uses common-connection-point;
326       }
327
328       list vdu {
329         description "List of Virtual Deployment Units";
330         key "id";
331
332         leaf id {
333           description "Unique id for the VDU";
334           type string;
335         }
336
337         leaf name {
338           description "Unique name for the VDU";
339           type string;
340         }
341
342         leaf description {
343             description "Description of the VDU.";
344             type string;
345         }
346
347         leaf count {
348           description "Number of instances of VDU";
349           type uint64;
350         }
351
352         leaf mgmt-vpci {
353           description
354               "Specifies the virtual PCI address. Expressed in
355              the following format dddd:dd:dd.d. For example
356              0000:00:12.0. This information can be used to
357              pass as metadata during the VM creation.";
358           type string;
359         }
360
361         uses manotypes:vm-flavor;
362         uses manotypes:guest-epa;
363         uses manotypes:vswitch-epa;
364         uses manotypes:hypervisor-epa;
365         uses manotypes:host-epa;
366
367         list alarm {
368           key "alarm-id";
369
370           uses manotypes:alarm;
371         }
372
373         uses manotypes:image-properties;
374
375         choice cloud-init-input {
376           description
377             "Indicates how the contents of cloud-init script are provided.
378              There are 2 choices - inline or in a file";
379
380           case inline {
381             leaf cloud-init {
382               description
383                 "Contents of cloud-init script, provided inline, in cloud-config format";
384               type string;
385             }
386           }
387
388           case filename {
389             leaf cloud-init-file {
390               description
391                 "Name of file with contents of cloud-init script in cloud-config format";
392                 type string;
393             }
394           }
395         }
396
397         uses manotypes:supplemental-boot-data;
398
399         list internal-connection-point {
400           key "id";
401           description
402               "List for internal connection points. Each VNFC
403               has zero or more internal connection points.
404               Internal connection points are used for connecting
405               the VNF components internal to the VNF. If a VNF
406               has only one VNFC, it may not have any internal
407               connection points.";
408
409           uses common-connection-point;
410
411           leaf internal-vld-ref {
412             type leafref {
413               path "../../../internal-vld/id";
414             }
415           }
416         }
417
418         list internal-interface {
419           description
420               "List of internal interfaces for the VNF";
421           key name;
422
423           leaf name {
424             description
425                 "Name of internal interface. Note that this
426                 name has only local significance to the VDU.";
427             type string;
428           }
429
430           leaf vdu-internal-connection-point-ref {
431             type leafref {
432               path "../../internal-connection-point/id";
433             }
434           }
435           uses virtual-interface;
436         }
437
438         list external-interface {
439           description
440               "List of external interfaces for the VNF.
441               The external interfaces enable sending
442               traffic to and from VNF.";
443           key name;
444
445           leaf name {
446             description
447                 "Name of the external interface. Note that
448                 this name has only local significance.";
449             type string;
450           }
451
452           leaf vnfd-connection-point-ref {
453             description
454               "Name of the external connection point.";
455             type leafref {
456               path "../../../connection-point/name";
457             }
458           }
459           uses virtual-interface;
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 that
488               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 manadatory 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   augment "/rw-project:project" {
540     container vnfd-catalog {
541       description
542         "Virtual Network Function Descriptor (VNFD).";
543
544       list vnfd {
545         key "id";
546
547         uses vnfd-descriptor;
548       }
549     }
550   }
551 }
552
553 // vim: sw=2