51bb9f705b54190de6721956656ef2ea3fbd9816
[osm/IM.git] / models / 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 to appear as label in the UI";
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 "Short name to appear as label in the UI";
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 such as 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 to appear as label in the UI";
245           type string;
246         }
247
248         leaf description {
249           description "Description of internal VLD.";
250           type string;
251         }
252
253         leaf type {
254           type manotypes:virtual-link-type;
255         }
256
257         leaf root-bandwidth {
258           description
259               "For ELAN this is the aggregate bandwidth.";
260           type uint64;
261         }
262
263         leaf leaf-bandwidth {
264           description
265               "For ELAN this is the bandwidth of branches.";
266           type uint64;
267         }
268
269         list internal-connection-point {
270           key "id-ref";
271           description "List of internal connection points in this VLD";
272           leaf id-ref {
273             description "reference to the internal connection point id";
274             type leafref {
275               path "../../../vdu/internal-connection-point/id";
276             }
277           }
278         }
279         uses manotypes:provider-network;
280         choice init-params {
281           description "Extra parameters for VLD instantiation";
282
283           case vim-network-ref {
284             leaf vim-network-name {
285               description
286                   "Name of network in VIM account. This is used to indicate
287                     pre-provisioned network name in cloud account.";
288               type string;
289             }
290           }
291
292           case vim-network-profile {
293             leaf ip-profile-ref {
294               description "Named reference to IP-profile object";
295               type leafref {
296                 path "../../ip-profiles/name";
297               }
298             }
299           }
300         }
301       }
302
303       uses manotypes:ip-profile-list;
304
305       list connection-point {
306         key "name";
307         description
308             "List for external connection points. Each VNF has one
309             or more external connection points that connect the VNF
310             to other VNFs or to external networks. Each VNF exposes
311             connection points to the orchestrator, which can construct
312             network services by connecting the connection points
313             between different VNFs. The NFVO will use VLDs and VNFFGs
314             at 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 with 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 to
434                 the VDU.";
435             type string;
436           }
437
438           leaf vnfd-connection-point-ref {
439             description
440               "Name of the external connection point.";
441             type leafref {
442               path "../../../connection-point/name";
443             }
444           }
445           uses virtual-interface;
446         }
447
448         list volumes {
449           key "name";
450
451           leaf name {
452             description "Name of the disk-volumes, e.g. vda, vdb etc";
453             type string;
454           }
455
456           uses manotypes:volume-info;
457         }
458       }
459
460       list vdu-dependency {
461         description
462             "List of VDU dependencies.";
463
464         key vdu-source-ref;
465         leaf vdu-source-ref {
466           type leafref {
467             path "../../vdu/id";
468           }
469         }
470
471         leaf vdu-depends-on-ref {
472           description
473               "Reference to the VDU on which
474               the source VDU depends.";
475           type leafref {
476             path "../../vdu/id";
477           }
478         }
479       }
480
481       leaf service-function-chain {
482         description "Type of node in Service Function Chaining Architecture";
483
484         type enumeration {
485           enum UNAWARE;
486           enum CLASSIFIER;
487           enum SF;
488           enum SFF;
489         }
490         default "UNAWARE";
491       }
492
493       leaf service-function-type {
494         description
495             "Type of Service Function.
496              NOTE: This needs to map with Service Function Type in ODL to
497              support VNFFG. Service Function Type is mandatory param in ODL
498              SFC. This is temporarily set to string for ease of use";
499             type string;
500       }
501
502       uses manotypes:monitoring-param;
503
504       list placement-groups {
505         description "List of placement groups at VNF level";
506
507         key "name";
508         uses manotypes:placement-group-info;
509
510         list member-vdus {
511
512           description
513               "List of VDUs that are part of this placement group";
514           key "member-vdu-ref";
515
516           leaf member-vdu-ref {
517             type leafref {
518               path "../../../vdu/id";
519             }
520           }
521         }
522       }
523   }
524
525   container vnfd-catalog {
526     description
527         "Virtual Network Function Descriptor (VNFD).";
528
529     list vnfd {
530       key "id";
531
532       uses vnfd-descriptor;
533      }
534   }
535 }
536
537 // vim: sw=2