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