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