805ed00cc5e460424b1851081e302b153ca8bd30
[osm/SO.git] / models / plugins / yang / rw-nsr.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 rw-nsr
22 {
23   namespace "http://riftio.com/ns/riftware-1.0/rw-nsr";
24   prefix "rw-nsr";
25
26   import mano-types {
27     prefix "manotypes";
28   }
29
30   import nsr {
31     prefix "nsr";
32   }
33
34   import nsd {
35     prefix "nsd";
36   }
37
38   import rw-cloud {
39     prefix "rw-cloud";
40   }
41
42   import rw-config-agent {
43     prefix "rw-config-agent";
44   }
45
46   import rw-sdn {
47     prefix "rw-sdn";
48   }
49
50   import ietf-yang-types {
51     prefix "yang";
52   }
53
54   revision 2015-09-10 {
55     description
56       "Initial revision. This YANG file augments
57        the base MANO VNFD";
58     reference
59       "Derived from earlier versions of base YANG files";
60   }
61
62   grouping operational-events {
63     list operational-events {
64       key "id";
65       description
66         "Recent operational events for this network service.
67         Though the model does not impose any restrictions on the numbe of events,
68         the max operational events will be limited to the most recent 10";
69
70       leaf id {
71         description "The id of the instance";
72         type uint64;
73       }
74
75       leaf timestamp {
76         description
77           "The timestamp of this event expressed as seconds since
78           unix epoch - 1970-01-01T00:00:00Z";
79         type uint32;
80       }
81       leaf event {
82         description "Short description of the event";
83         type string;
84       }
85       leaf description {
86         description
87           "The description of this event";
88         type string;
89       }
90       leaf details {
91         description
92           "The detailed description of this event (in case of errors)";
93         type string;
94       }
95     }
96   }
97
98   grouping nsd-ref-count {
99     list nsd-ref-count {
100       key "nsd-id-ref";
101       description "This table maintains the number of NSRs used by each NSD";
102
103       leaf nsd-id-ref {
104         description "Reference to NSD";
105         type leafref {
106           path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
107         }
108       }
109       leaf instance-ref-count {
110         description
111           "Reference count for the number of NSRs refering this NSD.
112            Every NS record instantiated using this descriptor takes
113            a reference on the NSD and releases the reference when the
114            network service is terminated. This desciptor cannot be
115            deleted when this counter is non zero";
116         type uint64;
117       }
118     }
119   }
120
121   grouping rw-ns-instance-config {
122     leaf cloud-account {
123       description
124         "The configured cloud account which the NSR is instantiated within.
125          All VDU's, Virtual Links, and provider networks will be requested
126          using the cloud-account's associated CAL instance";
127       type leafref {
128         path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
129       }
130     }
131
132     leaf om-datacenter {
133       description
134         "Openmano datacenter name to use when instantiating
135          the network service.  This is only used when openmano
136          is selected as the cloud account.  This should be superceded
137          by multiple cloud accounts when that becomes available.";
138       type string;
139     }
140
141     list vnf-cloud-account-map {
142       description
143           "Mapping VNF to Cloud Account where VNF will be instantiated";
144
145       key "member-vnf-index-ref";
146       leaf member-vnf-index-ref {
147         type uint64;
148       }
149
150       leaf cloud-account {
151         description
152             "The configured cloud account where VNF is instantiated within.
153             All VDU's, Virtual Links, and provider networks will be requested
154             using the cloud-account's associated CAL instance";
155         type leafref {
156           path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
157         }
158       }
159
160       leaf om-datacenter {
161         description
162             "Openmano datacenter name to use when instantiating
163             the network service.  This is only used when openmano
164             is selected as the cloud account.  This should be superceded
165             by multiple cloud accounts when that becomes available.";
166         type string;
167       }
168
169       leaf config-agent-account {
170         description
171           "The configured config agent account to use for instantiating this VNF.
172           The configuration for this VNF will be driven using the specified config
173           agent account";
174         type leafref {
175           path "/rw-config-agent:config-agent/rw-config-agent:account/rw-config-agent:name";
176         }
177       }
178     }
179
180     list vl-cloud-account-map {
181       description
182           "Mapping VL to Cloud Account where VL will be instantiated";
183
184       key "vld-id-ref";
185
186       leaf vld-id-ref {
187         description
188             "A reference to a vld.
189             leafref path ../../nsd/vld/id";
190         type string;
191       }
192
193       leaf-list cloud-accounts {
194         description
195             "The configured list of cloud accounts where VL is instantiated.
196             All VDU's, Virtual Links, and provider networks will be requested
197             using the cloud-account's associated CAL instance";
198         type leafref {
199           path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
200         }
201       }
202
203       leaf-list om-datacenters {
204         description
205             "Openmano datacenter names to use when instantiating
206             the VLs. This is only used when openmano
207             is selected as the cloud account.  This should be superceded
208             by multiple cloud accounts when that becomes available.";
209         type string;
210       }
211     }
212   }
213
214
215   augment /nsr:ns-instance-config/nsr:nsr {
216     uses rw-ns-instance-config;
217   }
218
219   augment /nsr:start-network-service/nsr:input{
220     uses rw-ns-instance-config;
221   }
222
223   augment /nsr:ns-instance-opdata/nsr:nsr {
224     uses manotypes:action-param;
225     uses manotypes:control-param;
226
227     leaf sdn-account {
228       description
229         "The SDN account associted with the cloud account using which an
230          NS was instantiated.";
231       type leafref {
232         path "/rw-sdn:sdn/rw-sdn:account/rw-sdn:name";
233       }
234     }
235
236     leaf config-status-details {
237       description
238         "The configuration status error details of the NS instance, in case of any errors";
239       type string;
240     }
241
242     container nfvi-metrics {
243       container vm {
244         leaf label {
245           description
246             "Label to show in UI";
247           type string;
248           default "VM";
249         }
250
251         leaf active-vm {
252           description
253             "The number of active VMs.";
254           type uint64;
255         }
256
257         leaf inactive-vm {
258           description
259             "The number of inactive VMs.";
260           type uint64;
261         }
262       }
263
264       uses manotypes:nfvi-metrics;
265     }
266
267     container epa-param {
268       container ovs-acceleration {
269         leaf label {
270           description
271             "Label to show in UI for the param";
272           type string;
273           default "OVS ACCELERATION";
274         }
275
276         leaf vm {
277           description
278             "Number of VMs with the EPA attribute";
279           type uint64;
280         }
281
282         leaf unit {
283           description
284             "Unit label to show in the UI";
285           type string;
286           default "vms";
287         }
288       }
289
290       container ovs-offload {
291         leaf label {
292           description
293             "Label to show in UI for the param";
294           type string;
295           default "OVS OFFLOAD";
296         }
297
298         leaf vm {
299           description
300             "Number of VMs with the EPA attribute";
301           type uint64;
302         }
303
304         leaf unit {
305           description
306             "Unit label to show in the UI";
307           type string;
308           default "vms";
309         }
310
311       }
312
313       container ddio {
314         leaf label {
315           description
316             "Label to show in UI for the param";
317           type string;
318           default "DDIO";
319         }
320
321         leaf vm {
322           description
323             "Number of VMs with the EPA attribute";
324           type uint64;
325         }
326
327         leaf unit {
328           description
329             "Unit label to show in the UI";
330           type string;
331           default "vms";
332         }
333
334       }
335
336       container cat {
337         leaf label {
338           description
339             "Label to show in UI for the param";
340           type string;
341           default "CAT";
342         }
343
344         leaf vm {
345           description
346             "Number of VMs with the EPA attribute";
347           type uint64;
348         }
349
350         leaf unit {
351           description
352             "Unit label to show in the UI";
353           type string;
354           default "vms";
355         }
356       }
357
358       container cmt {
359         leaf label {
360           description
361             "Label to show in UI for the param";
362           type string;
363           default "CMT";
364         }
365
366         leaf vm {
367           description
368             "Number of VMs with the EPA attribute";
369           type uint64;
370         }
371
372         leaf unit {
373           description
374             "Unit label to show in the UI";
375           type string;
376           default "vms";
377         }
378
379       }
380     }
381     uses operational-events;
382   }
383
384   augment /nsr:ns-instance-opdata {
385     uses nsd-ref-count;
386   }
387
388   augment /nsr:ns-instance-opdata/nsr:nsr/nsr:vlr {
389     leaf assigned-subnet {
390       description "Subnet added for the VL";
391       type string;
392     }
393     leaf cloud-account {
394       description
395         "The configured cloud account in which the VL is instantiated within.";
396       type leafref {
397         path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
398       }
399     }
400     leaf om-datacenter {
401       description
402         "Openmano datacenter name to use when instantiating
403          the network service.  This is only used when openmano
404          is selected as the cloud account.  This should be superceded
405          by multiple cloud accounts when that becomes available.";
406       type string;
407     }
408   }
409
410   augment /nsr:ns-instance-opdata/nsr:nsr/nsr:constituent-vnfr-ref {
411     leaf cloud-account {
412       description
413         "The configured cloud account in which the VNF is instantiated within.
414          All VDU's, Virtual Links, and provider networks will be requested
415          using the cloud-account's associated CAL instance";
416       type leafref {
417         path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
418       }
419     }
420     leaf om-datacenter {
421       description
422         "Openmano datacenter name to use when instantiating
423          the network service.  This is only used when openmano
424          is selected as the cloud account.  This should be superceded
425          by multiple cloud accounts when that becomes available.";
426       type string;
427     }
428   }
429
430   augment /nsr:ns-instance-config {
431     leaf nfvi-polling-period {
432       description
433         "Defines the period (secons) that the NFVI metrics are polled at";
434       type uint64;
435       default 4;
436     }
437   }
438
439   notification nsm-notification {
440     description "Notification for NSM Events.
441         The timestamp of this event is automatically expressed
442         in human readble format - 1970-01-01T00:00:00Z";
443
444     leaf event {
445       description "Short name of the event";
446       type string;
447     }
448
449     leaf description {
450       description "The description of this event";
451       type string;
452     }
453
454     leaf details {
455       description "The detailed description of this event, in case of errors";
456       type string;
457     }
458   }
459 }
460
461 // vim: sw=2