Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / schemas / yang / vnfd.yang.src
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              OM-MGMT         : Used to specify openmano mgmt external-connection type";
85
86         type enumeration {
87           enum OM-MGMT;
88           enum PCI-PASSTHROUGH;
89           enum SR-IOV;
90           enum VIRTIO;
91         }
92         default "VIRTIO";
93       }
94
95       leaf vpci {
96         description
97             "Specifies the virtual PCI address. Expressed in
98              the following format dddd:dd:dd.d. For example
99              0000:00:12.0. This information can be used to
100              pass as metadata during the VM creation.";
101         type string;
102       }
103
104       leaf bandwidth {
105         description
106             "Aggregate bandwidth of the NIC.";
107         type uint64;
108       }
109     }
110   }
111
112   container vnfd-catalog {
113
114     description
115         "Virtual Network Function Descriptor (VNFD).";
116
117     list vnfd {
118       key "id";
119
120       leaf id {
121         description "Identifier for the VNFD.";
122         type string;
123       }
124
125       leaf name {
126         description "VNFD name.";
127         mandatory true;
128         type string;
129       }
130
131       leaf short-name {
132         description "VNFD short name.";
133         type string;
134       }
135
136       leaf vendor {
137         description "Vendor of the VNFD.";
138         type string;
139       }
140
141       leaf logo {
142         description
143             "Vendor logo for the Virtual Network Function";
144         type string;
145       }
146
147       leaf description {
148         description "Description of the VNFD.";
149         type string;
150       }
151
152       leaf version {
153         description "Version of the VNFD";
154         type string;
155       }
156
157       container mgmt-interface {
158         description
159             "Interface over which the VNF is managed.";
160
161         uses manotypes:vnf-configuration;
162         
163         choice endpoint-type {
164           description
165               "Indicates the type of management endpoint.";
166
167           case ip {
168             description
169                 "Specifies the static IP address for managing the VNF.";
170             leaf ip-address {
171               type inet:ip-address;
172             }
173           }
174
175           case vdu-id {
176             description
177                 "Use the default management interface on this VDU.";
178             leaf vdu-id {
179               type leafref {
180                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:id";
181               }
182             }
183           }
184
185           case cp {
186             description
187                 "Use the ip address associated with this connection point.";
188             leaf cp {
189               type leafref {
190                 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:connection-point/vnfd:name";
191               }
192             }
193           }
194         }
195
196         leaf port {
197           description
198               "Port for the management interface.";
199           type inet:port-number;
200         }
201
202         container dashboard-params {
203           description "Parameters for the VNF dashboard";
204
205           leaf path {
206             description "The HTTP path for the dashboard";
207             type string;
208           }
209
210           leaf https {
211             description "Pick HTTPS instead of HTTP , Default is false";
212             type boolean;
213           }
214
215           leaf port {
216             description "The HTTP port for the dashboard";
217             type inet:port-number;
218           }
219         }
220       }
221
222       list internal-vld {
223         key "id";
224         description
225             "List of Internal Virtual Link Descriptors (VLD).
226             The internal VLD describes the basic topology of
227             the connectivity (e.g. E-LAN, E-Line, E-Tree)
228             between internal VNF components of the system.";
229
230         leaf id {
231           description "Identifier for the VLD";
232           type string;
233         }
234
235         leaf name {
236           description "Name of the internal VLD";
237           type string;
238         }
239
240         leaf short-name {
241           description "Short name of the internal VLD";
242           type string;
243         }
244
245         leaf description {
246           type string;
247         }
248
249         leaf type {
250           type manotypes:virtual-link-type;
251         }
252
253         leaf root-bandwidth {
254           description
255               "For ELAN this is the aggregate bandwidth.";
256           type uint64;
257         }
258
259         leaf leaf-bandwidth {
260           description
261               "For ELAN this is the bandwidth of branches.";
262           type uint64;
263         }
264
265         leaf-list internal-connection-point-ref {
266           type leafref {
267             path "../../vdu/internal-connection-point/id";
268           }
269         }
270
271         uses manotypes:provider-network;
272       }
273
274       list connection-point {
275         key "name";
276         description
277             "List for external connection points. Each VNF has one
278             or more external connection points. As the name
279             implies that external connection points are used for
280             connecting the VNF to other VNFs or to external networks.
281             Each VNF exposes these connection points to the
282             orchestrator. The orchestrator can construct network
283             services by connecting the connection points between
284             different VNFs. The NFVO will use VLDs and VNFFGs at
285             the network service level to construct network services.";
286
287         uses common-connection-point;
288       }
289
290       list vdu {
291         description "List of Virtual Deployment Units";
292         key "id";
293
294         leaf id {
295           description "Unique id for the VDU";
296           type string;
297         }
298
299         leaf name {
300           description "Unique name for the VDU";
301           type string;
302         }
303
304         leaf description {
305             description "Description of the VDU.";
306             type string;
307         }
308
309         leaf count {
310           description "Number of instances of VDU";
311           type uint64;
312         }
313
314         leaf mgmt-vpci {
315           description
316               "Specifies the virtual PCI address. Expressed in
317              the following format dddd:dd:dd.d. For example
318              0000:00:12.0. This information can be used to
319              pass as metadata during the VM creation.";
320           type string;
321         }
322
323         uses manotypes:vm-flavor;
324         uses manotypes:guest-epa;
325         uses manotypes:vswitch-epa;
326         uses manotypes:hypervisor-epa;
327         uses manotypes:host-epa;
328
329         list alarm {
330           key "alarm-id";
331
332           uses manotypes:alarm;
333         }
334
335         leaf image {
336           description
337             "Image name for the software image.
338              If the image name is found within the VNF packaage it will
339              be uploaded to all cloud accounts during onboarding process.
340              Otherwise, the image must be added to the cloud account with
341              the same name as entered here.
342             ";
343           mandatory true;
344           type string;
345         }
346
347         leaf image-checksum {
348           description
349             "Image md5sum for the software image.
350             The md5sum, if provided, along with the image name uniquely
351             identifies an image uploaded to the CAL.
352             ";
353           type string;
354         }
355
356         leaf cloud-init {
357           description "Content of cloud-init script";
358           type string;
359         }
360
361         list internal-connection-point {
362           key "id";
363           description
364               "List for internal connection points. Each VNFC
365               has zero or more internal connection points.
366               Internal connection points are used for connecting
367               the VNF components internal to the VNF. If a VNF
368               has only one VNFC, it may not have any internal
369               connection points.";
370
371           uses common-connection-point;
372
373           leaf internal-vld-ref {
374             type leafref {
375               path "../../../internal-vld/id";
376             }
377           }
378         }
379
380         list internal-interface {
381           description
382               "List of internal interfaces for the VNF";
383           key name;
384
385           leaf name {
386             description
387                 "Name of internal interface. Note that this
388                 name has only local significance to the VDU.";
389             type string;
390           }
391
392           leaf vdu-internal-connection-point-ref {
393             type leafref {
394               path "../../internal-connection-point/id";
395             }
396           }
397           uses virtual-interface;
398         }
399
400         list external-interface {
401           description
402               "List of external interfaces for the VNF.
403               The external interfaces enable sending
404               traffic to and from VNF.";
405           key name;
406
407           leaf name {
408             description
409                 "Name of the external interface. Note that
410                 this name has only local significance.";
411             type string;
412           }
413
414           leaf vnfd-connection-point-ref {
415             description
416               "Name of the external connection point.";
417             type leafref {
418               path "../../../connection-point/name";
419             }
420           }
421           uses virtual-interface;
422         }
423       }
424
425       list vdu-dependency {
426         description
427             "List of VDU dependencies.";
428
429         key vdu-source-ref;
430         leaf vdu-source-ref {
431           type leafref {
432             path "../../vdu/id";
433           }
434         }
435
436         leaf vdu-depends-on-ref {
437           description
438               "Reference to the VDU that
439               source VDU depends.";
440           type leafref {
441             path "../../vdu/id";
442           }
443         }
444       }
445
446       leaf service-function-chain {
447         description "Type of node in Service Function Chaining Architecture";
448
449         type enumeration {
450           enum UNAWARE;
451           enum CLASSIFIER;
452           enum SF;
453           enum SFF;
454         }
455         default "UNAWARE";
456       }
457
458       leaf service-function-type {
459         description
460             "Type of Service Function.
461              NOTE: This needs to map with Service Function Type in ODL to
462              support VNFFG. Service Function Type is manadatory param in ODL
463              SFC. This is temporarily set to string for ease of use";
464             type string;
465       }
466
467       uses manotypes:monitoring-param;
468
469       list placement-groups {
470         description "List of placement groups at VNF level";
471
472         key "name";
473         uses manotypes:placement-group-info;
474         
475         list member-vdus {
476           description
477               "List of VDUs that are part of this placement group";
478           key "member-vdu-ref";
479         
480           leaf member-vdu-ref {
481             type leafref {
482               path "../../../vdu/id";
483             }
484           }
485         }
486       }
487     }
488   }
489 }
490
491 // vim: sw=2