New feature: Support static IP in VNF connection points
[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     leaf static-ip-address {
72       description "Static IP address for the connection point";
73       type inet:ip-address;
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
280         uses manotypes:provider-network;
281       }
282
283       list connection-point {
284         key "name";
285         description
286             "List for external connection points. Each VNF has one
287             or more external connection points. As the name
288             implies that external connection points are used for
289             connecting the VNF to other VNFs or to external networks.
290             Each VNF exposes these connection points to the
291             orchestrator. The orchestrator can construct network
292             services by connecting the connection points between
293             different VNFs. The NFVO will use VLDs and VNFFGs at
294             the network service level to construct network services.";
295
296         uses common-connection-point;
297       }
298
299       list vdu {
300         description "List of Virtual Deployment Units";
301         key "id";
302
303         leaf id {
304           description "Unique id for the VDU";
305           type string;
306         }
307
308         leaf name {
309           description "Unique name for the VDU";
310           type string;
311         }
312
313         leaf description {
314             description "Description of the VDU.";
315             type string;
316         }
317
318         leaf count {
319           description "Number of instances of VDU";
320           type uint64;
321         }
322
323         leaf mgmt-vpci {
324           description
325               "Specifies the virtual PCI address. Expressed in
326              the following format dddd:dd:dd.d. For example
327              0000:00:12.0. This information can be used to
328              pass as metadata during the VM creation.";
329           type string;
330         }
331
332         uses manotypes:vm-flavor;
333         uses manotypes:guest-epa;
334         uses manotypes:vswitch-epa;
335         uses manotypes:hypervisor-epa;
336         uses manotypes:host-epa;
337
338         list alarm {
339           key "alarm-id";
340
341           uses manotypes:alarm;
342         }
343
344         uses manotypes:image-properties;
345
346         choice cloud-init-input {
347           description
348             "Indicates how the contents of cloud-init script are provided.
349              There are 2 choices - inline or in a file";
350
351           case inline {
352             leaf cloud-init {
353               description
354                 "Contents of cloud-init script, provided inline, in cloud-config format";
355               type string;
356             }
357           }
358
359           case filename {
360             leaf cloud-init-file {
361               description
362                 "Name of file with contents of cloud-init script in cloud-config format";
363                 type string;
364             }
365           }
366         }
367
368         list internal-connection-point {
369           key "id";
370           description
371               "List for internal connection points. Each VNFC
372               has zero or more internal connection points.
373               Internal connection points are used for connecting
374               the VNF components internal to the VNF. If a VNF
375               has only one VNFC, it may not have any internal
376               connection points.";
377
378           uses common-connection-point;
379
380           leaf internal-vld-ref {
381             type leafref {
382               path "../../../internal-vld/id";
383             }
384           }
385         }
386
387         list internal-interface {
388           description
389               "List of internal interfaces for the VNF";
390           key name;
391
392           leaf name {
393             description
394                 "Name of internal interface. Note that this
395                 name has only local significance to the VDU.";
396             type string;
397           }
398
399           leaf vdu-internal-connection-point-ref {
400             type leafref {
401               path "../../internal-connection-point/id";
402             }
403           }
404           uses virtual-interface;
405         }
406
407         list external-interface {
408           description
409               "List of external interfaces for the VNF.
410               The external interfaces enable sending
411               traffic to and from VNF.";
412           key name;
413
414           leaf name {
415             description
416                 "Name of the external interface. Note that
417                 this name has only local significance.";
418             type string;
419           }
420
421           leaf vnfd-connection-point-ref {
422             description
423               "Name of the external connection point.";
424             type leafref {
425               path "../../../connection-point/name";
426             }
427           }
428           uses virtual-interface;
429         }
430
431         list volumes {
432           key "name";
433
434           leaf name {
435             description "Name of the disk-volumes, e.g. vda, vdb etc";
436             type string;
437           }
438
439           uses manotypes:volume-info;
440         } 
441       }
442
443       list vdu-dependency {
444         description
445             "List of VDU dependencies.";
446
447         key vdu-source-ref;
448         leaf vdu-source-ref {
449           type leafref {
450             path "../../vdu/id";
451           }
452         }
453
454         leaf vdu-depends-on-ref {
455           description
456               "Reference to the VDU that
457               source VDU depends.";
458           type leafref {
459             path "../../vdu/id";
460           }
461         }
462       }
463
464       leaf service-function-chain {
465         description "Type of node in Service Function Chaining Architecture";
466
467         type enumeration {
468           enum UNAWARE;
469           enum CLASSIFIER;
470           enum SF;
471           enum SFF;
472         }
473         default "UNAWARE";
474       }
475
476       leaf service-function-type {
477         description
478             "Type of Service Function.
479              NOTE: This needs to map with Service Function Type in ODL to
480              support VNFFG. Service Function Type is manadatory param in ODL
481              SFC. This is temporarily set to string for ease of use";
482             type string;
483       }
484
485       uses manotypes:monitoring-param;
486
487       list placement-groups {
488         description "List of placement groups at VNF level";
489
490         key "name";
491         uses manotypes:placement-group-info;
492
493         list member-vdus {
494
495           description
496               "List of VDUs that are part of this placement group";
497           key "member-vdu-ref";
498
499           leaf member-vdu-ref {
500             type leafref {
501               path "../../../vdu/id";
502             }
503           }
504         }
505       }
506   }
507
508   container vnfd-catalog {
509     description
510         "Virtual Network Function Descriptor (VNFD).";
511
512     list vnfd {
513       key "id";
514
515       uses vnfd-descriptor;
516      }
517   }
518 }
519
520 // vim: sw=2