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