update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b second try
[osm/SO.git] / models / plugins / yang / rw-vnfd.yang
1
2 /*
3  * 
4  *   Copyright 2016-2017 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 rw-vnfd
22 {
23   namespace "http://riftio.com/ns/riftware-1.0/rw-vnfd";
24   prefix "rw-vnfd";
25
26   import ietf-inet-types {
27     prefix "inet";
28   }
29
30   import vnfd {
31     prefix "vnfd";
32   }
33
34   import rw-vnfd-base {
35     prefix "rw-vnfd-base";
36   }
37
38   import vnfd-base {
39     prefix "vnfd-base";
40   }
41
42   import mano-rift-groupings {
43     prefix "mano-rift";
44   }
45
46   import mano-types {
47     prefix "manotypes";
48   }
49
50   revision 2017-02-28 {
51     description
52       "Update model to support projects.";
53   }
54
55   revision 2015-09-10 {
56     description
57       "Initial revision. This YANG file augments
58        the base MANO VNFD";
59     reference
60       "Derived from earlier versions of base YANG files";
61   }
62
63   grouping vnfd-config-parameter {
64     container config-parameter {
65       description
66         "List of VNF config parameter requests and sources";
67       list config-parameter-source {
68         description "The list of parameters exposed by this VNF";
69         key "name";
70
71         leaf name {
72           description "Name of the source";
73           type string {
74             length "1..128";
75           }
76         }
77
78         leaf description {
79           description " Description of the source";
80           type string;
81         }
82
83         choice source {
84           case descriptor {
85             leaf descriptor {
86               description
87                 "Location of this source as an xpath.
88                  For example:
89                    ../../../mgmt-interface/port";
90               type string;
91             }
92           }
93
94           case attribute {
95             leaf attribute {
96               description
97                 "Location of this source as runtime attribute.
98                  The value is <xpath>, <attribute_name>
99                  For example:
100                    ../../../mgmt-interface, ip-address
101                    which retruns the ip-address assigned to the
102                    mgmt-interface after VNF instantiation.";
103               type string;
104             }
105           }
106
107           case primitive-ref {
108             leaf config-primitive-name-ref {
109               description
110                 "A leafref to configuration primitive.
111                  This refers to a config parameter whose
112                  output parameter is referred in out-parameter.";
113               type leafref {
114                 path "../../../vnfd:vnf-configuration/vnfd:config-primitive/vnfd:name";
115               }
116             }
117
118             leaf parameter-ref {
119               description
120                 "Name of the output parameter in the config primitiive";
121               type leafref {
122                 path
123                   "../../../vnfd:vnf-configuration/vnfd:config-primitive[vnfd:name=current()/../config-primitive-name-ref]/vnfd:parameter/vnfd:name";
124               }
125             }
126           }
127
128           case value {
129             leaf value {
130               description
131                 "Pre-defined value to be used for this source";
132               type string;
133             }
134           }
135         }
136
137         list parameter {
138           key "config-primitive-name-ref";
139
140           leaf config-primitive-name-ref {
141             description
142               "Name of the configuration primitive where this
143              request will used";
144             type leafref {
145               path "../../../../vnfd:vnf-configuration/vnfd:config-primitive/vnfd:name";
146             }
147           }
148
149           leaf config-primitive-parameter-ref {
150             description
151               "Parameter name of the config primitive";
152             type leafref {
153               path "../../../../vnfd:vnf-configuration/vnfd:config-primitive[vnfd:name=current()/../config-primitive-name-ref]/vnfd:parameter/vnfd:name";
154             }
155           }
156         }
157       }
158
159       list config-parameter-request {
160         description "The list of requests for this VNF";
161         key "name";
162
163         leaf name {
164           description "Name of this parameter request";
165           type string {
166             length "1..128";
167           }
168         }
169
170         leaf description {
171           description "Description of this request";
172           type string;
173         }
174
175         list parameter {
176           key "config-primitive-name-ref";
177
178           leaf config-primitive-name-ref {
179             description
180               "Name of the configuration primitive where this
181              request will used";
182             type leafref {
183               path "../../../../vnfd:vnf-configuration/vnfd:config-primitive/vnfd:name";
184             }
185           }
186
187           leaf config-primitive-parameter-ref {
188             description
189               "Parameter name of the config primitive";
190             type leafref {
191               path "../../../../vnfd:vnf-configuration/vnfd:config-primitive[vnfd:name=current()/../config-primitive-name-ref]/vnfd:parameter/vnfd:name";
192             }
193           }
194         }
195       }
196     }
197   }
198
199   augment /vnfd:vnfd-catalog/vnfd:vnfd {
200     uses rw-vnfd-base:rw-vnfd-ext;
201     uses vnfd-config-parameter;
202   }
203
204   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:mgmt-interface {
205     uses rw-vnfd-base:ssh-key;
206   }
207
208   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:http-endpoint {
209     uses mano-rift:http-end-point-additions;
210   }
211
212   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:supplemental-boot-data {
213     uses mano-rift:custom-meta-data;
214   }
215
216   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:volumes {
217     uses mano-rift:volume-info-additions;
218     uses mano-rift:custom-meta-data;
219   }
220
221   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:interface {
222     leaf static-ip-address {
223       description "Static IP address for the connection point";
224       type inet:ip-address;
225     }
226
227     leaf floating-ip-needed{
228       type boolean;
229       default "false";
230       description 
231         "Sole purpose of this field is to facilitate translation of VNFD 
232               to other VNFMs";
233     }
234   }
235
236   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:volumes/vnfd:volume-source {
237     case volume {
238       leaf volume-ref {
239         description "Reference for pre-existing volume in VIM";
240         type string;
241       }
242     }
243   }
244
245   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:internal-vld {
246     list virtual-connection-points {
247       description
248           "A list of virtual-connection points associated with Virtual Link.
249          These connection points are not directly associated with any VDUs";
250       key name;
251       uses vnfd-base:common-connection-point;
252
253       leaf-list associated-cps {
254         description
255             "A List of connection points associated with virtual connection point";
256         type leafref {
257           path "../../vnfd:internal-connection-point/vnfd:id-ref";
258         }
259       }
260     }
261   }
262
263   
264   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vdu/vnfd:vm-flavor {
265         uses manotypes:vm-flavor-name;
266   }
267
268   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vnf-configuration/vnfd:config-primitive/vnfd:parameter {
269     leaf out {
270       description "If this is an output of the primitive execution";
271       type boolean;
272       default false;
273     }
274   }
275
276   augment /vnfd:vnfd-catalog/vnfd:vnfd/vnfd:vnf-configuration/vnfd:initial-config-primitive/vnfd:primitive-type {
277     case primitive-ref {
278       leaf config-primitive-ref {
279         description
280           "Reference to a config primitive name.
281            NOTE: The config primitive referred should have
282                  all the input parameters predefined either
283                  with default values or dependency references.";
284         type leafref {
285           path "../../vnfd:config-primitive/vnfd:name";
286         }
287       }
288     }
289   }
290   
291 }
292 // vim: sw=2