Merge branch 'v1.1'
[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     leaf port-security-enabled {
71       description "Enables the port security for the port";
72       type boolean;
73     }
74   }
75
76   grouping virtual-interface {
77     container virtual-interface {
78       description
79           "Container for the virtual interface properties";
80
81       leaf type {
82         description
83             "Specifies the type of virtual interface
84              between VM and host.
85              VIRTIO          : Use the traditional VIRTIO interface.
86              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
87              SR-IOV          : Use SR-IOV interface.
88              E1000           : Emulate E1000 interface.
89              RTL8139         : Emulate RTL8139 interface.
90              PCNET           : Emulate PCNET interface.
91              OM-MGMT         : Used to specify openmano mgmt external-connection type";
92
93         type enumeration {
94           enum OM-MGMT;
95           enum PCI-PASSTHROUGH;
96           enum SR-IOV;
97           enum VIRTIO;
98           enum E1000;
99           enum RTL8139;
100           enum PCNET;
101         }
102         default "VIRTIO";
103       }
104
105       leaf vpci {
106         description
107             "Specifies the virtual PCI address. Expressed in
108              the following format dddd:dd:dd.d. For example
109              0000:00:12.0. This information can be used to
110              pass as metadata during the VM creation.";
111         type string;
112       }
113
114       leaf bandwidth {
115         description
116             "Aggregate bandwidth of the NIC.";
117         type uint64;
118       }
119     }
120   }
121
122   grouping vnfd-descriptor {
123       leaf id {
124         description "Identifier for the VNFD.";
125         type string;
126       }
127
128       leaf name {
129         description "VNFD name.";
130         mandatory true;
131         type string;
132       }
133
134       leaf short-name {
135         description "VNFD short name.";
136         type string;
137       }
138
139       leaf vendor {
140         description "Vendor of the VNFD.";
141         type string;
142       }
143
144       leaf logo {
145         description
146             "Vendor logo for the Virtual Network Function";
147         type string;
148       }
149
150       leaf description {
151         description "Description of the VNFD.";
152         type string;
153       }
154
155       leaf version {
156         description "Version of the VNFD";
157         type string;
158       }
159
160       uses manotypes:vnf-configuration;
161
162       container mgmt-interface {
163         description
164             "Interface over which the VNF is managed.";
165
166         choice endpoint-type {
167           description
168               "Indicates the type of management endpoint.";
169
170           case ip {
171             description
172                 "Specifies the static IP address for managing the VNF.";
173             leaf ip-address {
174               type inet:ip-address;
175             }
176           }
177
178           case vdu-id {
179             description
180                 "Use the default management interface on this VDU.";
181             leaf vdu-id {
182               type leafref {
183                 path "../../vdu/id";
184               }
185             }
186           }
187
188           case cp {
189             description
190                 "Use the ip address associated with this connection point.";
191             leaf cp {
192               type leafref {
193                 path "../../connection-point/name";
194               }
195             }
196           }
197         }
198
199         leaf port {
200           description
201               "Port for the management interface.";
202           type inet:port-number;
203         }
204
205         container dashboard-params {
206           description "Parameters for the VNF dashboard";
207
208           leaf path {
209             description "The HTTP path for the dashboard";
210             type string;
211           }
212
213           leaf https {
214             description "Pick HTTPS instead of HTTP , Default is false";
215             type boolean;
216           }
217
218           leaf port {
219             description "The HTTP port for the dashboard";
220             type inet:port-number;
221           }
222         }
223       }
224
225       list internal-vld {
226         key "id";
227         description
228             "List of Internal Virtual Link Descriptors (VLD).
229             The internal VLD describes the basic topology of
230             the connectivity (e.g. E-LAN, E-Line, E-Tree)
231             between internal VNF components of the system.";
232
233         leaf id {
234           description "Identifier for the VLD";
235           type string;
236         }
237
238         leaf name {
239           description "Name of the internal VLD";
240           type string;
241         }
242
243         leaf short-name {
244           description "Short name of the internal VLD";
245           type string;
246         }
247
248         leaf description {
249           type string;
250         }
251
252         leaf type {
253           type manotypes:virtual-link-type;
254         }
255
256         leaf root-bandwidth {
257           description
258               "For ELAN this is the aggregate bandwidth.";
259           type uint64;
260         }
261
262         leaf leaf-bandwidth {
263           description
264               "For ELAN this is the bandwidth of branches.";
265           type uint64;
266         }
267
268         list internal-connection-point {
269           key "id-ref";
270           description "List of internal connection points in this VLD";
271           leaf id-ref {
272             description "reference to the internal connection point id";
273             type leafref {
274               path "../../../vdu/internal-connection-point/id";
275             }
276           }
277         }
278         uses manotypes:provider-network;
279         choice init-params {
280           description "Extra parameters for VLD instantiation";
281
282           case vim-network-ref {
283             leaf vim-network-name {
284               description
285                   "Name of network in VIM account. This is used to indicate
286                     pre-provisioned network name in cloud account.";
287               type string;
288             }
289           }
290
291           case vim-network-profile {
292             leaf ip-profile-ref {
293               description "Named reference to IP-profile object";
294               type string;
295             }
296           }
297
298         }
299       }
300
301       uses manotypes:ip-profile-list;
302
303       list connection-point {
304         key "name";
305         description
306             "List for external connection points. Each VNF has one
307             or more external connection points. As the name
308             implies that external connection points are used for
309             connecting the VNF to other VNFs or to external networks.
310             Each VNF exposes these connection points to the
311             orchestrator. The orchestrator can construct network
312             services by connecting the connection points between
313             different VNFs. The NFVO will use VLDs and VNFFGs at
314             the network service level to construct network services.";
315
316         uses common-connection-point;
317       }
318
319       list vdu {
320         description "List of Virtual Deployment Units";
321         key "id";
322
323         leaf id {
324           description "Unique id for the VDU";
325           type string;
326         }
327
328         leaf name {
329           description "Unique name for the VDU";
330           type string;
331         }
332
333         leaf description {
334             description "Description of the VDU.";
335             type string;
336         }
337
338         leaf count {
339           description "Number of instances of VDU";
340           type uint64;
341         }
342
343         leaf mgmt-vpci {
344           description
345               "Specifies the virtual PCI address. Expressed in
346              the following format dddd:dd:dd.d. For example
347              0000:00:12.0. This information can be used to
348              pass as metadata during the VM creation.";
349           type string;
350         }
351
352         uses manotypes:vm-flavor;
353         uses manotypes:guest-epa;
354         uses manotypes:vswitch-epa;
355         uses manotypes:hypervisor-epa;
356         uses manotypes:host-epa;
357
358         list alarm {
359           key "alarm-id";
360
361           uses manotypes:alarm;
362         }
363
364         uses manotypes:image-properties;
365
366         choice cloud-init-input {
367           description
368             "Indicates how the contents of cloud-init script are provided.
369              There are 2 choices - inline or in a file";
370
371           case inline {
372             leaf cloud-init {
373               description
374                 "Contents of cloud-init script, provided inline, in cloud-config format";
375               type string;
376             }
377           }
378
379           case filename {
380             leaf cloud-init-file {
381               description
382                 "Name of file with contents of cloud-init script in cloud-config format";
383                 type string;
384             }
385           }
386         }
387
388         uses manotypes:supplemental-boot-data;
389
390         list internal-connection-point {
391           key "id";
392           description
393               "List for internal connection points. Each VNFC
394               has zero or more internal connection points.
395               Internal connection points are used for connecting
396               the VNF components internal to the VNF. If a VNF
397               has only one VNFC, it may not have any internal
398               connection points.";
399
400           uses common-connection-point;
401         }
402
403         list internal-interface {
404           description
405               "List of internal interfaces for the VNF";
406           key name;
407
408           leaf name {
409             description
410                 "Name of internal interface. Note that this
411                 name has only local significance to the VDU.";
412             type string;
413           }
414
415           leaf vdu-internal-connection-point-ref {
416             type leafref {
417               path "../../internal-connection-point/id";
418             }
419           }
420           uses virtual-interface;
421         }
422
423         list external-interface {
424           description
425               "List of external interfaces for the VNF.
426               The external interfaces enable sending
427               traffic to and from VNF.";
428           key name;
429
430           leaf name {
431             description
432                 "Name of the external interface. Note that
433                 this name has only local significance.";
434             type string;
435           }
436
437           leaf vnfd-connection-point-ref {
438             description
439               "Name of the external connection point.";
440             type leafref {
441               path "../../../connection-point/name";
442             }
443           }
444           uses virtual-interface;
445         }
446
447         list volumes {
448           key "name";
449
450           leaf name {
451             description "Name of the disk-volumes, e.g. vda, vdb etc";
452             type string;
453           }
454
455           uses manotypes:volume-info;
456         } 
457       }
458
459       list vdu-dependency {
460         description
461             "List of VDU dependencies.";
462
463         key vdu-source-ref;
464         leaf vdu-source-ref {
465           type leafref {
466             path "../../vdu/id";
467           }
468         }
469
470         leaf vdu-depends-on-ref {
471           description
472               "Reference to the VDU that
473               source VDU depends.";
474           type leafref {
475             path "../../vdu/id";
476           }
477         }
478       }
479
480       leaf service-function-chain {
481         description "Type of node in Service Function Chaining Architecture";
482
483         type enumeration {
484           enum UNAWARE;
485           enum CLASSIFIER;
486           enum SF;
487           enum SFF;
488         }
489         default "UNAWARE";
490       }
491
492       leaf service-function-type {
493         description
494             "Type of Service Function.
495              NOTE: This needs to map with Service Function Type in ODL to
496              support VNFFG. Service Function Type is manadatory param in ODL
497              SFC. This is temporarily set to string for ease of use";
498             type string;
499       }
500
501       uses manotypes:monitoring-param;
502
503       list placement-groups {
504         description "List of placement groups at VNF level";
505
506         key "name";
507         uses manotypes:placement-group-info;
508
509         list member-vdus {
510
511           description
512               "List of VDUs that are part of this placement group";
513           key "member-vdu-ref";
514
515           leaf member-vdu-ref {
516             type leafref {
517               path "../../../vdu/id";
518             }
519           }
520         }
521       }
522   }
523
524   container vnfd-catalog {
525     description
526         "Virtual Network Function Descriptor (VNFD).";
527
528     list vnfd {
529       key "id";
530
531       uses vnfd-descriptor;
532      }
533   }
534 }
535
536 // vim: sw=2