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