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