1dfb459f4e6eee4c64d7ceafdcdc626e7f5ba497
[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 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 string;
296             }
297           }
298
299         }
300       }
301
302       uses manotypes:ip-profile-list;
303
304       list connection-point {
305         key "name";
306         description
307             "List for external connection points. Each VNF has one
308             or more external connection points that connect the VNF
309             to other VNFs or to external networks. Each VNF exposes
310             connection points to the orchestrator, which can construct
311             network services by connecting the connection points
312             between different VNFs. The NFVO will use VLDs and VNFFGs
313             at the network service level to construct network services.";
314
315         uses common-connection-point;
316       }
317
318       list vdu {
319         description "List of Virtual Deployment Units";
320         key "id";
321
322         leaf id {
323           description "Unique id for the VDU";
324           type string;
325         }
326
327         leaf name {
328           description "Unique name for the VDU";
329           type string;
330         }
331
332         leaf description {
333             description "Description of the VDU.";
334             type string;
335         }
336
337         leaf count {
338           description "Number of instances of VDU";
339           type uint64;
340         }
341
342         leaf mgmt-vpci {
343           description
344               "Specifies the virtual PCI address. Expressed in
345              the following format dddd:dd:dd.d. For example
346              0000:00:12.0. This information can be used to
347              pass as metadata during the VM creation.";
348           type string;
349         }
350
351         uses manotypes:vm-flavor;
352         uses manotypes:guest-epa;
353         uses manotypes:vswitch-epa;
354         uses manotypes:hypervisor-epa;
355         uses manotypes:host-epa;
356
357         list alarm {
358           key "alarm-id";
359
360           uses manotypes:alarm;
361         }
362
363         uses manotypes:image-properties;
364
365         choice cloud-init-input {
366           description
367               "Indicates how the contents of cloud-init script are provided.
368               There are 2 choices - inline or in a file";
369
370           case inline {
371             leaf cloud-init {
372               description
373                   "Contents of cloud-init script, provided inline, in cloud-config format";
374               type string;
375             }
376           }
377
378           case filename {
379             leaf cloud-init-file {
380               description
381                   "Name of file with contents of cloud-init script in cloud-config format";
382               type string;
383             }
384           }
385         }
386
387         uses manotypes:supplemental-boot-data;
388
389         list internal-connection-point {
390           key "id";
391           description
392               "List for internal connection points. Each VNFC
393               has zero or more internal connection points.
394               Internal connection points are used for connecting
395               the VNF with components internal to the VNF. If a VNF
396               has only one VNFC, it may not have any internal
397               connection points.";
398
399           uses common-connection-point;
400         }
401
402         list internal-interface {
403           description
404               "List of internal interfaces for the VNF";
405           key name;
406
407           leaf name {
408             description
409                 "Name of internal interface. Note that this
410                 name has only local significance to the VDU.";
411             type string;
412           }
413
414           leaf vdu-internal-connection-point-ref {
415             type leafref {
416               path "../../internal-connection-point/id";
417             }
418           }
419           uses virtual-interface;
420         }
421
422         list external-interface {
423           description
424               "List of external interfaces for the VNF.
425               The external interfaces enable sending
426               traffic to and from VNF.";
427           key name;
428
429           leaf name {
430             description
431                 "Name of the external interface. Note that
432                 this name has only local significance to
433                 the VDU.";
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 on which
473               the 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 mandatory 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