SO Multidisk changes
[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   }
71
72   grouping virtual-interface {
73     container virtual-interface {
74       description
75           "Container for the virtual interface properties";
76
77       leaf type {
78         description
79             "Specifies the type of virtual interface
80              between VM and host.
81              VIRTIO          : Use the traditional VIRTIO interface.
82              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
83              SR-IOV          : Use SR-IOV interface.
84              E1000           : Emulate E1000 interface.
85              RTL8139         : Emulate RTL8139 interface.
86              PCNET           : Emulate PCNET interface.
87              OM-MGMT         : Used to specify openmano mgmt external-connection type";
88
89         type enumeration {
90           enum OM-MGMT;
91           enum PCI-PASSTHROUGH;
92           enum SR-IOV;
93           enum VIRTIO;
94           enum E1000;
95           enum RTL8139;
96           enum PCNET;
97         }
98         default "VIRTIO";
99       }
100
101       leaf vpci {
102         description
103             "Specifies the virtual PCI address. Expressed in
104              the following format dddd:dd:dd.d. For example
105              0000:00:12.0. This information can be used to
106              pass as metadata during the VM creation.";
107         type string;
108       }
109
110       leaf bandwidth {
111         description
112             "Aggregate bandwidth of the NIC.";
113         type uint64;
114       }
115     }
116   }
117
118   container vnfd-catalog {
119
120     description
121         "Virtual Network Function Descriptor (VNFD).";
122
123     list vnfd {
124       key "id";
125
126       leaf id {
127         description "Identifier for the VNFD.";
128         type string;
129       }
130
131       leaf name {
132         description "VNFD name.";
133         mandatory true;
134         type string;
135       }
136
137       leaf short-name {
138         description "VNFD short name.";
139         type string;
140       }
141
142       leaf vendor {
143         description "Vendor of the VNFD.";
144         type string;
145       }
146
147       leaf logo {
148         description
149             "Vendor logo for the Virtual Network Function";
150         type string;
151       }
152
153       leaf description {
154         description "Description of the VNFD.";
155         type string;
156       }
157
158       leaf version {
159         description "Version of the VNFD";
160         type string;
161       }
162
163       uses manotypes:vnf-configuration;
164
165       container mgmt-interface {
166         description
167             "Interface over which the VNF is managed.";
168
169         choice endpoint-type {
170           description
171               "Indicates the type of management endpoint.";
172
173           case ip {
174             description
175                 "Specifies the static IP address for managing the VNF.";
176             leaf ip-address {
177               type inet:ip-address;
178             }
179           }
180
181           case vdu-id {
182             description
183                 "Use the default management interface on this VDU.";
184             leaf vdu-id {
185               type leafref {
186                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:id";
187               }
188             }
189           }
190
191           case cp {
192             description
193                 "Use the ip address associated with this connection point.";
194             leaf cp {
195               type leafref {
196                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
197               }
198             }
199           }
200         }
201
202         leaf port {
203           description
204               "Port for the management interface.";
205           type inet:port-number;
206         }
207
208         container dashboard-params {
209           description "Parameters for the VNF dashboard";
210
211           leaf path {
212             description "The HTTP path for the dashboard";
213             type string;
214           }
215
216           leaf https {
217             description "Pick HTTPS instead of HTTP , Default is false";
218             type boolean;
219           }
220
221           leaf port {
222             description "The HTTP port for the dashboard";
223             type inet:port-number;
224           }
225         }
226       }
227
228       list internal-vld {
229         key "id";
230         description
231             "List of Internal Virtual Link Descriptors (VLD).
232             The internal VLD describes the basic topology of
233             the connectivity (e.g. E-LAN, E-Line, E-Tree)
234             between internal VNF components of the system.";
235
236         leaf id {
237           description "Identifier for the VLD";
238           type string;
239         }
240
241         leaf name {
242           description "Name of the internal VLD";
243           type string;
244         }
245
246         leaf short-name {
247           description "Short name of the internal VLD";
248           type string;
249         }
250
251         leaf description {
252           type string;
253         }
254
255         leaf type {
256           type manotypes:virtual-link-type;
257         }
258
259         leaf root-bandwidth {
260           description
261               "For ELAN this is the aggregate bandwidth.";
262           type uint64;
263         }
264
265         leaf leaf-bandwidth {
266           description
267               "For ELAN this is the bandwidth of branches.";
268           type uint64;
269         }
270
271         list internal-connection-point {
272           key "id-ref";
273           description "List of internal connection points in this VLD";
274           leaf id-ref {
275             description "reference to the internal connection point id";
276             type leafref {
277               path "../../../vdu/internal-connection-point/id";
278             }
279           }
280         }
281         uses manotypes:provider-network;
282       }
283
284       list connection-point {
285         key "name";
286         description
287             "List for external connection points. Each VNF has one
288             or more external connection points. As the name
289             implies that external connection points are used for
290             connecting the VNF to other VNFs or to external networks.
291             Each VNF exposes these connection points to the
292             orchestrator. The orchestrator can construct network
293             services by connecting the connection points between
294             different VNFs. The NFVO will use VLDs and VNFFGs at
295             the network service level to construct network services.";
296
297         uses common-connection-point;
298       }
299
300       list vdu {
301         description "List of Virtual Deployment Units";
302         key "id";
303
304         leaf id {
305           description "Unique id for the VDU";
306           type string;
307         }
308
309         leaf name {
310           description "Unique name for the VDU";
311           type string;
312         }
313
314         leaf description {
315             description "Description of the VDU.";
316             type string;
317         }
318
319         leaf count {
320           description "Number of instances of VDU";
321           type uint64;
322         }
323
324         leaf mgmt-vpci {
325           description
326               "Specifies the virtual PCI address. Expressed in
327              the following format dddd:dd:dd.d. For example
328              0000:00:12.0. This information can be used to
329              pass as metadata during the VM creation.";
330           type string;
331         }
332
333         uses manotypes:vm-flavor;
334         uses manotypes:guest-epa;
335         uses manotypes:vswitch-epa;
336         uses manotypes:hypervisor-epa;
337         uses manotypes:host-epa;
338
339         list alarm {
340           key "alarm-id";
341
342           uses manotypes:alarm;
343         }
344
345         uses manotypes:image-properties;
346
347         choice cloud-init-input {
348           description
349             "Indicates how the contents of cloud-init script are provided.
350              There are 2 choices - inline or in a file";
351
352           case inline {
353             leaf cloud-init {
354               description
355                 "Contents of cloud-init script, provided inline, in cloud-config format";
356               type string;
357             }
358           }
359
360           case filename {
361             leaf cloud-init-file {
362               description
363                 "Name of file with contents of cloud-init script in cloud-config format";
364                 type string;
365             }
366           }
367         }
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 }
510
511 // vim: sw=2