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