blob: 4a88eac47db4cd1ce5872b8a9b73832fe073226a [file] [log] [blame]
velandy793e5ea2017-06-07 13:01:55 -04001
2/*
3 *
Rajesh Velandye27e0b22017-09-18 17:21:48 -04004 * Copyright 2016-2017 RIFT.IO Inc
velandy793e5ea2017-06-07 13:01:55 -04005 *
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
21module nsd
22{
23 namespace "urn:ietf:params:xml:ns:yang:nfvo:nsd";
24 prefix "nsd";
25
velandy793e5ea2017-06-07 13:01:55 -040026 import vnfd {
27 prefix "vnfd";
28 }
29
Rajesh Velandye27e0b22017-09-18 17:21:48 -040030 import nsd-base {
31 prefix "nsd-base";
velandy793e5ea2017-06-07 13:01:55 -040032 }
33
velandy793e5ea2017-06-07 13:01:55 -040034 import mano-types {
35 prefix "manotypes";
36 }
37
Rajesh Velandye27e0b22017-09-18 17:21:48 -040038 revision 2017-02-28 {
39 description
40 "Update model to support projects.";
41 }
42
velandy793e5ea2017-06-07 13:01:55 -040043 revision 2014-10-27 {
44 description
45 "Initial revision. This YANG file defines
46 the Network Service Descriptor (NSD)";
47 reference
48 "Derived from earlier versions of base YANG files";
49 }
50
Rajesh Velandye27e0b22017-09-18 17:21:48 -040051 grouping nsd-constituent-vnfd {
52 list constituent-vnfd {
velandy793e5ea2017-06-07 13:01:55 -040053 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -040054 "List of VNFDs that are part of this
55 network service.";
velandy793e5ea2017-06-07 13:01:55 -040056
Rajesh Velandye27e0b22017-09-18 17:21:48 -040057 key "member-vnf-index";
velandy793e5ea2017-06-07 13:01:55 -040058
Rajesh Velandye27e0b22017-09-18 17:21:48 -040059 leaf member-vnf-index {
velandy793e5ea2017-06-07 13:01:55 -040060 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -040061 "Identifier/index for the VNFD. This separate id
62 is required to ensure that multiple VNFs can be
63 part of single NS";
64 type uint64;
velandy793e5ea2017-06-07 13:01:55 -040065 }
66
Rajesh Velandye27e0b22017-09-18 17:21:48 -040067 leaf vnfd-id-ref {
velandy793e5ea2017-06-07 13:01:55 -040068 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -040069 "Identifier for the VNFD.";
70 type leafref {
71 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
72 }
73 }
74
75 leaf start-by-default {
76 description
77 "VNFD is started as part of the NS instantiation";
78 type boolean;
79 default true;
velandy793e5ea2017-06-07 13:01:55 -040080 }
81 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -040082 }
velandy793e5ea2017-06-07 13:01:55 -040083
Rajesh Velandye27e0b22017-09-18 17:21:48 -040084 grouping nsd-vld {
velandy793e5ea2017-06-07 13:01:55 -040085 list vld {
velandy793e5ea2017-06-07 13:01:55 -040086
87 key "id";
88
Rajesh Velandye27e0b22017-09-18 17:21:48 -040089 uses nsd-base:nsd-vld-common;
velandy793e5ea2017-06-07 13:01:55 -040090
91 list vnfd-connection-point-ref {
92 description
93 "A list of references to connection points.";
94 key "member-vnf-index-ref vnfd-connection-point-ref";
95
96 leaf member-vnf-index-ref {
97 description "Reference to member-vnf within constituent-vnfds";
98 type leafref {
99 path "../../../constituent-vnfd/member-vnf-index";
100 }
101 }
102
103 leaf vnfd-id-ref {
104 description
105 "A reference to a VNFD";
106 type leafref {
107 path "../../../constituent-vnfd" +
108 "[member-vnf-index = current()/../member-vnf-index-ref]" +
109 "/vnfd-id-ref";
110 }
111 }
112
113 leaf vnfd-connection-point-ref {
114 description "A reference to a connection point name";
115 type leafref {
116 path "/vnfd:vnfd-catalog/vnfd:vnfd" +
117 "[vnfd:id = current()/../vnfd-id-ref]/" +
118 "vnfd:connection-point/vnfd:name";
119 }
120 }
121 }
velandy793e5ea2017-06-07 13:01:55 -0400122 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400123 }
velandy793e5ea2017-06-07 13:01:55 -0400124
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400125 grouping nsd-vnf-dependency {
126 list vnf-dependency {
velandy793e5ea2017-06-07 13:01:55 -0400127 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400128 "List of VNF dependencies.";
129 key vnf-source-ref;
130 leaf vnf-source-ref {
velandy793e5ea2017-06-07 13:01:55 -0400131 type leafref {
132 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
133 }
134 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400135 leaf vnf-depends-on-ref {
velandy793e5ea2017-06-07 13:01:55 -0400136 description
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400137 "Reference to VNF that sorce VNF depends.";
138 type leafref {
139 path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
velandy793e5ea2017-06-07 13:01:55 -0400140 }
141 }
142 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400143 }
velandy793e5ea2017-06-07 13:01:55 -0400144
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400145 grouping nsd-placement-groups {
velandy793e5ea2017-06-07 13:01:55 -0400146 list placement-groups {
147 description "List of placement groups at NS level";
148
149 key "name";
150 uses manotypes:placement-group-info;
151
152 list member-vnfd {
153 description
154 "List of VNFDs that are part of this placement group";
155
156 key "member-vnf-index-ref";
157
158 leaf member-vnf-index-ref {
159 description "Member VNF index of this member VNF";
160 type leafref {
161 path "../../../constituent-vnfd/member-vnf-index";
162 }
163 }
164
165 leaf vnfd-id-ref {
166 description
167 "Identifier for the VNFD.";
168 type leafref {
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400169 path "../../../constituent-vnfd" +
velandy793e5ea2017-06-07 13:01:55 -0400170 "[member-vnf-index = current()/../member-vnf-index-ref]" +
171 "/vnfd-id-ref";
172 }
173 }
174 }
175 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400176 }
velandy793e5ea2017-06-07 13:01:55 -0400177
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400178 grouping nsd-monitoring-param {
velandy793e5ea2017-06-07 13:01:55 -0400179
180 list monitoring-param {
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400181 key id;
velandy793e5ea2017-06-07 13:01:55 -0400182
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400183 uses nsd-base:monitoring-param-common;
velandy793e5ea2017-06-07 13:01:55 -0400184
185 list vnfd-monitoring-param {
186 description "A list of VNFD monitoring params";
187 key "member-vnf-index-ref vnfd-monitoring-param-ref";
188
189 leaf vnfd-id-ref {
190 description
191 "A reference to a VNFD. This is a leafref";
192
193 type leafref {
194 path "../../../constituent-vnfd" +
195 "[member-vnf-index = current()/../member-vnf-index-ref]" +
196 "/vnfd-id-ref";
197 }
198 }
199
200 leaf vnfd-monitoring-param-ref {
201 description "A reference to the VNFD monitoring param";
202 type leafref {
203 path "/vnfd:vnfd-catalog/vnfd:vnfd"
204 + "[vnfd:id = current()/../vnfd-id-ref]"
205 + "/vnfd:monitoring-param/vnfd:id";
206 }
207 }
208
209 leaf member-vnf-index-ref {
210 description
211 "Mandatory reference to member-vnf within constituent-vnfds";
212 type leafref {
213 path "../../../constituent-vnfd/member-vnf-index";
214 }
215 }
216 }
217 }
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400218 }
velandy793e5ea2017-06-07 13:01:55 -0400219
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400220 grouping nsd-service-primitive {
221 list service-primitive {
velandy793e5ea2017-06-07 13:01:55 -0400222 description
223 "Network service level service primitives.";
224
225 key "name";
226
227 leaf name {
228 description
229 "Name of the service primitive.";
230 type string;
231 }
232
233 list parameter {
234 description
235 "List of parameters for the service primitive.";
236
237 key "name";
238 uses manotypes:primitive-parameter;
239 }
240
241 uses manotypes:ui-primitive-group;
242
243 list vnf-primitive-group {
244 description
245 "List of service primitives grouped by VNF.";
246
247 key "member-vnf-index-ref";
248 leaf member-vnf-index-ref {
249 description
250 "Reference to member-vnf within constituent-vnfds";
251 type leafref {
252 path "../../../constituent-vnfd/member-vnf-index";
253 }
254 }
255
256 leaf vnfd-id-ref {
257 description
258 "A reference to a VNFD. This is a leafref";
259
260 type leafref {
261 path "../../../constituent-vnfd" +
262 "[member-vnf-index = current()/../member-vnf-index-ref]" + "/vnfd-id-ref";
263 }
264 }
265
266 leaf vnfd-name {
267 description
268 "Name of the VNFD";
269 type leafref {
270 path "/vnfd:vnfd-catalog/vnfd:vnfd"
271 + "[vnfd:id = current()/../vnfd-id-ref]"
272 + "/vnfd:name";
273 }
274 }
275
276 list primitive {
277 key "index";
278
279 leaf index {
280 description "Index of this primitive";
281 type uint32;
282 }
283
284 leaf name {
285 description "Name of the primitive in the VNF primitive ";
286 type string;
287 }
288 }
289 }
290
291 leaf user-defined-script {
292 description
293 "A user defined script.";
294 type string;
295 }
296 }
velandy793e5ea2017-06-07 13:01:55 -0400297 }
298
velandy793e5ea2017-06-07 13:01:55 -0400299 container nsd-catalog {
300
301 list nsd {
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400302 key id;
velandy793e5ea2017-06-07 13:01:55 -0400303
Rajesh Velandye27e0b22017-09-18 17:21:48 -0400304 uses nsd-base:nsd-descriptor-common;
305
306 uses nsd-vld;
307
308 uses nsd-constituent-vnfd;
309
310 uses nsd-placement-groups;
311
312 uses nsd-vnf-dependency;
313
314 uses nsd-monitoring-param;
315
316 uses nsd-service-primitive;
velandy793e5ea2017-06-07 13:01:55 -0400317 }
318 }
velandy793e5ea2017-06-07 13:01:55 -0400319}