Support of NS primitives via charms
[osm/IM.git] / models / yang / mano-types.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 mano-types
22 {
23   namespace "urn:ietf:params:xml:ns:yang:nfvo:mano-types";
24   prefix "manotypes";
25
26   import ietf-inet-types {
27     prefix "inet";
28   }
29
30   import rw-project {
31     prefix "rw-project";
32   }
33
34   revision 2017-02-08 {
35     description
36       "Update model to support projects.";
37   }
38
39   revision 2015-04-23 {
40     description
41       "Initial revision. This YANG file defines
42        the reusable base types for VNF Management
43        and Orchestration (MANO).";
44     reference
45       "Derived from earlier versions of base YANG files";
46   }
47
48   typedef meta-data-type {
49     type enumeration {
50       enum STRING;
51     }
52   }
53
54   typedef package-type {
55       description "Type of descriptor being on-boarded";
56       type enumeration {
57         enum NSD;
58         enum VNFD;
59       }
60     }
61
62   typedef parameter-data-type {
63     type enumeration {
64       enum STRING;
65       enum INTEGER;
66       enum BOOLEAN;
67     }
68   }
69
70   grouping primitive-parameter-value {
71     list parameter {
72       description
73           "List of parameters to the configuration primitive.";
74       key "name";
75       leaf name {
76         description
77             "Name of the parameter.";
78         type string;
79       }
80
81       leaf data-type {
82         description
83             "Data type associated with the value.";
84         type manotypes:parameter-data-type;
85       }
86
87       leaf value {
88         description
89             "Value associated with the name.";
90         type string;
91       }
92     }
93   }
94
95   grouping primitive-parameter {
96     leaf name {
97       description
98           "Name of the parameter.";
99       type string;
100     }
101
102     leaf data-type {
103       description
104           "Data type associated with the name.";
105       type manotypes:parameter-data-type;
106     }
107
108     leaf mandatory {
109       description "Is this field mandatory";
110       type boolean;
111       default false;
112     }
113
114     leaf default-value {
115       description "The default value for this field";
116       type string;
117     }
118
119     leaf parameter-pool {
120       description "NSD parameter pool name to use for this parameter";
121       type string;
122     }
123
124     leaf read-only {
125       description
126         "The value should be dimmed by the UI.
127         Only applies to parameters with default values.";
128       type boolean;
129       default false;
130     }
131
132     leaf hidden {
133       description
134         "The value should be hidden by the UI.
135         Only applies to parameters with default values.";
136       type boolean;
137       default false;
138     }
139   }
140
141   grouping ui-primitive-group {
142     list parameter-group {
143       description
144             "Grouping of parameters which are logically grouped in UI";
145       key "name";
146
147       leaf name {
148         description
149             "Name of the parameter group";
150         type string;
151       }
152
153       list parameter {
154         description
155             "List of parameters for the service primitive.";
156         key "name";
157         uses manotypes:primitive-parameter;
158       }
159
160       leaf mandatory {
161         description "Is this parameter group mandatory";
162         type boolean;
163         default true;
164       }
165     }
166   }
167
168   grouping event-config {
169     leaf seq {
170       description
171           "Sequence number for the configuration primitive.";
172       type uint64;
173     }
174
175     leaf name {
176       description
177           "Name of the configuration primitive.";
178       type string;
179       mandatory "true";
180     }
181
182     leaf user-defined-script {
183       description
184           "A user defined script.";
185       type string;
186     }
187
188     list parameter {
189       key "name";
190       leaf name {
191         type string;
192       }
193
194       leaf value {
195         description "Value of the configuration primitive.";
196         type string;
197       }
198     }
199   }
200
201  grouping image-properties {
202     leaf image {
203       description
204             "Image name for the software image.
205              If the image name is found within the VNF package it will
206              be uploaded to all VIM accounts during onboarding process.
207              Otherwise, the image must be added to the VIM account with
208              the same name as entered here.
209             ";
210       type string;
211     }
212
213     leaf image-checksum {
214       description
215             "Image md5sum for the software image.
216             The md5sum, if provided, along with the image name uniquely
217             identifies an image uploaded to the CAL.
218             ";
219       type string;
220     }
221   }
222
223
224   grouping vca-relationships {
225     container vca-relationships {
226       list relation {
227         description "List of relations between VCA componets.";
228
229         key "requires provides";
230
231         leaf requires {
232           description
233             "Name of the required relation.";
234           type string;
235         }
236
237         leaf provides {
238           description
239             "Name of the provided relation.";
240           type string;
241         }
242       }
243     }
244   }
245
246   grouping vca-metrics {
247     description
248         "Information about the VNF or VDU metrics";
249     list metrics {
250       description "List of VCA related metrics";
251       key "name";
252       leaf name {
253         description
254           "Name of the metric, as defined in the Juju charm.";
255         type string;
256       }
257     }
258   } // END - grouping vca-metrics
259
260   grouping configuration-method {
261     choice config-method {
262       description
263           "Defines the configuration method for the VNF or VDU.";
264       case script {
265         description
266             "Use custom script for configuring the VNF or VDU.
267              This script is executed in the context of
268              Orchestrator (The same system and environment
269              as the Launchpad).";
270         container script {
271           leaf script-type {
272             description
273                 "Script type - currently supported - Scripts confirming to Rift CA plugin";
274             type enumeration {
275               enum rift;
276             }
277           }
278         }
279       }
280
281       case juju {
282         description
283           "Configure the VNF or VDU through Juju.";
284         container juju {
285           leaf charm {
286             description "Juju charm to use with the VNF or VDU.";
287             type string;
288           }
289           leaf proxy {
290             description "Is this a proxy charm?";
291             type boolean;
292             default true;
293           }
294           uses manotypes:vca-relationships;
295         }
296       }
297     }
298   }
299
300   grouping ns-configuration {
301     description
302         "Information about NS configuration. Note:
303          In the future this should be equivalent to vca-configuration
304          grouping.";
305
306     uses manotypes:configuration-method;
307   }
308
309   grouping vca-configuration {
310     description
311         "Information about the VNF or VDU configuration. Note:
312          If the NS contains multiple instances of the
313          same VNF or VDU, each instance could have a different
314          configuration.";
315
316     uses manotypes:configuration-method;
317
318     list config-primitive {
319       description
320         "List of config primitives supported by the
321         configuration agent for this VNF or VDU.";
322       key "name";
323
324       leaf name {
325         description
326           "Name of the config primitive.";
327         type string;
328       }
329
330       list parameter {
331         description
332           "List of parameters to the config primitive.";
333         key "name";
334         uses primitive-parameter;
335       }
336
337       leaf user-defined-script {
338         description
339           "A user defined script. If user defined script is defined,
340            the script will be executed using bash";
341         type string;
342       }
343     }
344
345     list initial-config-primitive {
346       description
347         "Initial set of configuration primitives.";
348       key "seq";
349       leaf seq {
350         description
351           "Sequence number for the configuration primitive.";
352         type uint64;
353       }
354
355       choice primitive-type {
356         case primitive-definition {
357           leaf name {
358             description
359               "Name of the configuration primitive.";
360             type string;
361           }
362
363           uses primitive-parameter-value;
364
365           leaf user-defined-script {
366             description
367               "A user defined script.";
368             type string;
369           }
370         }
371       }
372     }
373
374     uses manotypes:vca-metrics;
375
376   } // END - grouping vca-configuration
377
378   typedef virtual-link-type {
379     description
380         "Type of virtual link
381          ELAN: A multipoint service connecting a set of VNFs
382          ELINE: For a simple point to point connection
383          //        between a VNF and the existing network.
384          // ETREE: A multipoint service connecting one or
385          //        more roots and a set of leaves, but
386          //        preventing inter-leaf communication.";
387     type enumeration {
388       enum ELAN;
389       enum ELINE;
390       // enum ETREE;
391     }
392   }
393
394   grouping named-value {
395     leaf name {
396       type string;
397     }
398
399     leaf value {
400       type string;
401     }
402   }
403
404   typedef http-method {
405     description
406       "Type of HTTP operation";
407
408     type enumeration {
409       enum POST;
410       enum PUT;
411       enum GET;
412       enum DELETE;
413       enum OPTIONS;
414       enum PATCH;
415     }
416   }
417
418   typedef api-type {
419     description
420       "Type of API to fetch monitoring parameters";
421
422     type enumeration {
423       enum HTTP;
424       enum NETCONF;
425       enum SOAP;
426     }
427   }
428
429   typedef json-query-method {
430     description
431       "The method to extract a value from a JSON response
432
433        NAMEKEY - Use the name as the key for a non-nested value.
434        JSONPATH - Use jsonpath-rw implementation to extract a value.
435        OBJECTPATH - Use objectpath implementation to extract a value.";
436       type enumeration {
437         enum NAMEKEY;
438         enum JSONPATH;
439         enum OBJECTPATH;
440       }
441   }
442
443   typedef param-value-type {
444     description
445       "The type of the parameter value";
446     type enumeration {
447        enum INT;
448        enum DECIMAL;
449        enum STRING;
450     }
451   }
452
453   typedef connection-point-type {
454     description
455         "Type of connection point
456         VPORT: Virtual Port
457         // VNIC_ADDR: Virtual NIC Address
458         // PNIC_ADDR: Physical NIC Address
459         // PPORT: Physical Port.";
460
461     type enumeration {
462       enum VPORT;
463     }
464   }
465
466   typedef widget-type {
467     description
468         "Type of the widget, typically used by the UI.";
469     type enumeration {
470       enum COUNTER;
471       enum GAUGE;
472       enum TEXTBOX;
473       enum SLIDER;
474       enum HISTOGRAM;
475       enum BAR;
476     }
477   }
478
479   typedef cpu-feature-type {
480     description
481         "Enumeration for CPU features.
482
483          AES: CPU supports advanced instruction set for
484          AES (Advanced Encryption Standard).
485
486          CAT: Cache Allocation Technology (CAT) allows
487          an Operating System, Hypervisor, or similar
488          system management agent to specify the amount
489          of L3 cache (currently the last-level cache
490          in most server and client platforms) space an
491          application can fill (as a hint to hardware
492          functionality, certain features such as power
493          management may override CAT settings).
494
495          CMT: Cache Monitoring Technology (CMT) allows
496          an Operating System, Hypervisor, or similar
497          system management agent to determine the
498          usage of cache based on applications running
499          on the platform. The implementation is
500          directed at L3 cache monitoring (currently
501          the last-level cache in most server and
502          client platforms).
503
504          DDIO: Intel Data Direct I/O (DDIO) enables
505          Ethernet server NICs and controllers talk
506          directly to the processor cache without a
507          detour via system memory. This enumeration
508          specifies if the VM requires a DDIO
509          capable host.";
510
511     type enumeration {
512       enum PREFER_AES;
513       enum REQUIRE_AES;
514       enum PREFER_CAT;
515       enum REQUIRE_CAT;
516       enum PREFER_CMT;
517       enum REQUIRE_CMT;
518       enum PREFER_DDIO;
519       enum REQUIRE_DDIO;
520       enum REQUIRE_VME;
521       enum PREFER_VME;
522       enum REQUIRE_DE;
523       enum PREFER_DE;
524       enum REQUIRE_PSE;
525       enum PREFER_PSE;
526       enum REQUIRE_TSC;
527       enum PREFER_TSC;
528       enum REQUIRE_MSR;
529       enum PREFER_MSR;
530       enum REQUIRE_PAE;
531       enum PREFER_PAE;
532       enum REQUIRE_MCE;
533       enum PREFER_MCE;
534       enum REQUIRE_CX8;
535       enum PREFER_CX8;
536       enum REQUIRE_APIC;
537       enum PREFER_APIC;
538       enum REQUIRE_SEP;
539       enum PREFER_SEP;
540       enum REQUIRE_MTRR;
541       enum PREFER_MTRR;
542       enum REQUIRE_PGE;
543       enum PREFER_PGE;
544       enum REQUIRE_MCA;
545       enum PREFER_MCA;
546       enum REQUIRE_CMOV;
547       enum PREFER_CMOV;
548       enum REQUIRE_PAT;
549       enum PREFER_PAT;
550       enum REQUIRE_PSE36;
551       enum PREFER_PSE36;
552       enum REQUIRE_CLFLUSH;
553       enum PREFER_CLFLUSH;
554       enum REQUIRE_DTS;
555       enum PREFER_DTS;
556       enum REQUIRE_ACPI;
557       enum PREFER_ACPI;
558       enum REQUIRE_MMX;
559       enum PREFER_MMX;
560       enum REQUIRE_FXSR;
561       enum PREFER_FXSR;
562       enum REQUIRE_SSE;
563       enum PREFER_SSE;
564       enum REQUIRE_SSE2;
565       enum PREFER_SSE2;
566       enum REQUIRE_SS;
567       enum PREFER_SS;
568       enum REQUIRE_HT;
569       enum PREFER_HT;
570       enum REQUIRE_TM;
571       enum PREFER_TM;
572       enum REQUIRE_IA64;
573       enum PREFER_IA64;
574       enum REQUIRE_PBE;
575       enum PREFER_PBE;
576       enum REQUIRE_RDTSCP;
577       enum PREFER_RDTSCP;
578       enum REQUIRE_PNI;
579       enum PREFER_PNI;
580       enum REQUIRE_PCLMULQDQ;
581       enum PREFER_PCLMULQDQ;
582       enum REQUIRE_DTES64;
583       enum PREFER_DTES64;
584       enum REQUIRE_MONITOR;
585       enum PREFER_MONITOR;
586       enum REQUIRE_DS_CPL;
587       enum PREFER_DS_CPL;
588       enum REQUIRE_VMX;
589       enum PREFER_VMX;
590       enum REQUIRE_SMX;
591       enum PREFER_SMX;
592       enum REQUIRE_EST;
593       enum PREFER_EST;
594       enum REQUIRE_TM2;
595       enum PREFER_TM2;
596       enum REQUIRE_SSSE3;
597       enum PREFER_SSSE3;
598       enum REQUIRE_CID;
599       enum PREFER_CID;
600       enum REQUIRE_FMA;
601       enum PREFER_FMA;
602       enum REQUIRE_CX16;
603       enum PREFER_CX16;
604       enum REQUIRE_XTPR;
605       enum PREFER_XTPR;
606       enum REQUIRE_PDCM;
607       enum PREFER_PDCM;
608       enum REQUIRE_PCID;
609       enum PREFER_PCID;
610       enum REQUIRE_DCA;
611       enum PREFER_DCA;
612       enum REQUIRE_SSE4_1;
613       enum PREFER_SSE4_1;
614       enum REQUIRE_SSE4_2;
615       enum PREFER_SSE4_2;
616       enum REQUIRE_X2APIC;
617       enum PREFER_X2APIC;
618       enum REQUIRE_MOVBE;
619       enum PREFER_MOVBE;
620       enum REQUIRE_POPCNT;
621       enum PREFER_POPCNT;
622       enum REQUIRE_TSC_DEADLINE_TIMER;
623       enum PREFER_TSC_DEADLINE_TIMER;
624       enum REQUIRE_XSAVE;
625       enum PREFER_XSAVE;
626       enum REQUIRE_AVX;
627       enum PREFER_AVX;
628       enum REQUIRE_F16C;
629       enum PREFER_F16C;
630       enum REQUIRE_RDRAND;
631       enum PREFER_RDRAND;
632       enum REQUIRE_FSGSBASE;
633       enum PREFER_FSGSBASE;
634       enum REQUIRE_BMI1;
635       enum PREFER_BMI1;
636       enum REQUIRE_HLE;
637       enum PREFER_HLE;
638       enum REQUIRE_AVX2;
639       enum PREFER_AVX2;
640       enum REQUIRE_SMEP;
641       enum PREFER_SMEP;
642       enum REQUIRE_BMI2;
643       enum PREFER_BMI2;
644       enum REQUIRE_ERMS;
645       enum PREFER_ERMS;
646       enum REQUIRE_INVPCID;
647       enum PREFER_INVPCID;
648       enum REQUIRE_RTM;
649       enum PREFER_RTM;
650       enum REQUIRE_MPX;
651       enum PREFER_MPX;
652       enum REQUIRE_RDSEED;
653       enum PREFER_RDSEED;
654       enum REQUIRE_ADX;
655       enum PREFER_ADX;
656       enum REQUIRE_SMAP;
657       enum PREFER_SMAP;
658     }
659   }
660
661   typedef nfvi-metric-type {
662     description "Type of NFVI metric to be monitored";
663     type enumeration {
664       enum cpu_utilization;
665       enum average_memory_utilization;
666       enum disk_read_ops;
667       enum disk_write_ops;
668       enum disk_read_bytes;
669       enum disk_write_bytes;
670       enum packets_sent;
671       enum packets_received;
672       enum packets_dropped;
673     }
674   }
675
676   typedef scaling-trigger {
677     type enumeration {
678       enum pre-scale-in {
679         value 1;
680       }
681       enum post-scale-in {
682         value 2;
683       }
684       enum pre-scale-out {
685         value 3;
686       }
687       enum post-scale-out {
688         value 4;
689       }
690     }
691   }
692
693   typedef scaling-policy-type {
694     type enumeration {
695       enum manual {
696         value 1;
697       }
698       enum automatic {
699         value 2;
700       }
701     }
702   }
703
704   typedef scaling-criteria-operation {
705     type enumeration {
706       enum AND {
707         value 1;
708       }
709       enum OR {
710         value 2;
711       }
712     }
713   }
714
715   grouping vm-flavor {
716     container vm-flavor {
717       leaf vcpu-count {
718         description
719             "Number of VCPUs for the VM.";
720         type uint16;
721       }
722
723       leaf memory-mb {
724         description
725             "Amount of memory in MB.";
726         type uint64;
727       }
728
729       leaf storage-gb {
730         description
731             "Amount of disk space in GB.";
732         type uint64;
733       }
734     }
735   } //grouping vm-flavor
736
737   grouping vm-flavor-name {
738     leaf vm-flavor-name {
739       description "flavor name to be used while creating vm using cloud account";
740       type string;
741     }
742   }
743
744   grouping vswitch-epa {
745     container vswitch-epa {
746       leaf ovs-acceleration {
747         description
748             "Specifies Open vSwitch acceleration mode.
749              MANDATORY: OVS acceleration is required
750              PREFERRED: OVS acceleration is preferred";
751         type enumeration {
752           enum MANDATORY;
753           enum PREFERRED;
754           enum DISABLED;
755         }
756       }
757
758       leaf ovs-offload {
759         description
760             "Specifies Open vSwitch hardware offload mode.
761              MANDATORY: OVS offload is required
762              PREFERRED: OVS offload is preferred";
763         type enumeration {
764           enum MANDATORY;
765           enum PREFERRED;
766           enum DISABLED;
767         }
768       }
769     }
770   }
771
772   grouping hypervisor-epa {
773     container hypervisor-epa {
774       leaf type {
775         description
776             "Specifies the type of hypervisor.
777              KVM: KVM
778              XEN: XEN";
779         type enumeration {
780           enum PREFER_KVM;
781           enum REQUIRE_KVM;
782         }
783       }
784       leaf version {
785         type string;
786       }
787     }
788   }
789
790   grouping host-epa {
791     container host-epa {
792       description "Specifies the host level EPA attributes.";
793       leaf cpu-model {
794         description
795             "Host CPU model. Examples include: SandyBridge,
796              IvyBridge";
797         type enumeration {
798           enum PREFER_WESTMERE;
799           enum REQUIRE_WESTMERE;
800           enum PREFER_SANDYBRIDGE;
801           enum REQUIRE_SANDYBRIDGE;
802           enum PREFER_IVYBRIDGE;
803           enum REQUIRE_IVYBRIDGE;
804           enum PREFER_HASWELL;
805           enum REQUIRE_HASWELL;
806           enum PREFER_BROADWELL;
807           enum REQUIRE_BROADWELL;
808           enum PREFER_NEHALEM;
809           enum REQUIRE_NEHALEM;
810           enum PREFER_PENRYN;
811           enum REQUIRE_PENRYN;
812           enum PREFER_CONROE;
813           enum REQUIRE_CONROE;
814           enum PREFER_CORE2DUO;
815           enum REQUIRE_CORE2DUO;
816         }
817       }
818
819       leaf cpu-arch {
820         description "Host CPU architecture.";
821         type enumeration {
822           enum PREFER_X86;
823           enum REQUIRE_X86;
824           enum PREFER_X86_64;
825           enum REQUIRE_X86_64;
826           enum PREFER_I686;
827           enum REQUIRE_I686;
828           enum PREFER_IA64;
829           enum REQUIRE_IA64;
830           enum PREFER_ARMV7;
831           enum REQUIRE_ARMV7;
832           enum PREFER_ARMV8;
833           enum REQUIRE_ARMV8;
834         }
835       }
836
837       leaf cpu-vendor {
838         description "Host CPU Vendor.";
839         type enumeration {
840           enum PREFER_INTEL;
841           enum REQUIRE_INTEL;
842           enum PREFER_AMD;
843           enum REQUIRE_AMD;
844         }
845       }
846
847       leaf cpu-socket-count {
848         description "Number of sockets on the host.";
849         type uint64;
850       }
851
852       leaf cpu-core-count {
853         description "Number of cores on the host.";
854         type uint64;
855       }
856
857       leaf cpu-core-thread-count {
858         description "Number of threads per cores on the host.";
859         type uint64;
860       }
861
862       list cpu-feature {
863         key "feature";
864         description "List of CPU features.";
865         leaf feature {
866           description "CPU feature.";
867           type cpu-feature-type;
868         }
869       }
870
871
872       leaf om-cpu-model-string {
873         description "OpenMANO CPU model string";
874         type string;
875       }
876
877       list om-cpu-feature {
878         key "feature";
879         description "List of OpenMANO CPU features";
880         leaf feature {
881           description "CPU feature";
882           type string;
883         }
884       }
885     }
886   }
887
888   grouping guest-epa {
889     description "EPA attributes for the guest";
890     container guest-epa {
891       leaf trusted-execution {
892         description "This VM should be allocated from trusted pool";
893         type boolean;
894       }
895
896       leaf mempage-size {
897         description
898             "Memory page allocation size. If a VM requires
899              hugepages, it should choose LARGE or SIZE_2MB
900              or SIZE_1GB. If the VM prefers hugepages it
901              should choose PREFER_LARGE.
902              LARGE        : Require hugepages (either 2MB or 1GB)
903              SMALL        : Doesn't require hugepages
904              SIZE_2MB     : Requires 2MB hugepages
905              SIZE_1GB     : Requires 1GB hugepages
906              PREFER_LARGE : Application prefers hugepages";
907         type enumeration {
908           enum LARGE;
909           enum SMALL;
910           enum SIZE_2MB;
911           enum SIZE_1GB;
912           enum PREFER_LARGE;
913         }
914       }
915
916       leaf cpu-pinning-policy {
917         description
918             "CPU pinning policy describes association
919              between virtual CPUs in guest and the
920              physical CPUs in the host.
921              DEDICATED : Virtual CPUs are pinned to
922                          physical CPUs
923              SHARED    : Multiple VMs may share the
924                          same physical CPUs.
925              ANY       : Any policy is acceptable for the VM";
926         type enumeration {
927           enum DEDICATED;
928           enum SHARED;
929           enum ANY;
930         }
931         default "ANY";
932       }
933
934       leaf cpu-thread-pinning-policy {
935           description
936             "CPU thread pinning policy describes how to
937              place the guest CPUs when the host supports
938              hyper threads:
939              AVOID   : Avoids placing a guest on a host
940                        with threads.
941              SEPARATE: Places vCPUs on separate cores,
942                        and avoids placing two vCPUs on
943                        two threads of same core.
944              ISOLATE : Places each vCPU on a different core,
945                        and places no vCPUs from a different
946                        guest on the same core.
947              PREFER  : Attempts to place vCPUs on threads
948                        of the same core.";
949         type enumeration {
950           enum AVOID;
951           enum SEPARATE;
952           enum ISOLATE;
953           enum PREFER;
954         }
955       }
956
957       list pcie-device {
958         description
959             "List of pcie passthrough devices.";
960         key device-id;
961         leaf device-id {
962           description
963               "Device identifier.";
964           type string;
965         }
966         leaf count {
967           description
968               "Number of devices to attach to the VM.";
969           type uint64;
970         }
971       }
972
973       choice numa-policy {
974         case numa-unaware {
975           leaf numa-unaware {
976             type empty;
977           }
978         }
979
980         case numa-aware {
981           container numa-node-policy {
982             description
983                 "This policy defines NUMA topology of the
984                  guest. Specifically identifies if the guest
985                  should be run on a host with one NUMA
986                  node or multiple NUMA nodes. As an example
987                  a guest might need 8 VCPUs and 4 GB of
988                  memory. However, it might need the VCPUs
989                  and memory distributed across multiple
990                  NUMA nodes. In this scenario, NUMA node
991                  1 could run with 6 VCPUs and 3GB, and
992                  NUMA node 2 could run with 2 VCPUs and
993                  1GB.";
994
995             leaf node-cnt {
996               description
997                   "The number of NUMA nodes to expose to the VM.";
998               type uint16;
999             }
1000
1001             leaf mem-policy {
1002               description
1003                   "This policy specifies how the memory should
1004                    be allocated in a multi-node scenario.
1005                    STRICT    : The memory must be allocated
1006                                strictly from the memory attached
1007                                to the NUMA node.
1008                    PREFERRED : The memory should be allocated
1009                                preferentially from the memory
1010                                attached to the NUMA node";
1011               type enumeration {
1012                 enum STRICT;
1013                 enum PREFERRED;
1014               }
1015             }
1016
1017            list node {
1018               key id;
1019               leaf id {
1020                 description
1021                     "NUMA node identification. Typically
1022                      it's 0 or 1";
1023                 type uint64;
1024               }
1025
1026               list vcpu {
1027                 key "id";
1028                 description
1029                     "List of VCPUs to allocate on
1030                      this NUMA node.";
1031                 leaf id {
1032                   type uint64;
1033                   description "List of VCPUs ids to allocate on
1034                                this NUMA node";
1035                 }
1036               }
1037
1038               leaf memory-mb {
1039                 description
1040                     "Memory size expressed in MB
1041                      for this NUMA node.";
1042                 type uint64;
1043               }
1044
1045               choice om-numa-type {
1046                 description
1047                     "OpenMANO Numa type selection";
1048
1049                 case cores {
1050                   leaf num-cores {
1051                     type uint8;
1052                   }
1053                 }
1054
1055                 case paired-threads {
1056                   container paired-threads {
1057                     leaf num-paired-threads {
1058                       type uint8;
1059                     }
1060
1061                     list paired-thread-ids {
1062                       description
1063                           "List of thread pairs to use in case of paired-thread NUMA";
1064                       max-elements 16;
1065                       key thread-a;
1066
1067                       leaf thread-a {
1068                           type uint8;
1069                       }
1070
1071                       leaf thread-b {
1072                           type uint8;
1073                       }
1074                     }
1075                   }
1076                 }
1077                 case threads {
1078                   leaf num-threads {
1079                     type uint8;
1080                   }
1081                 }
1082               }
1083             }
1084
1085           }
1086         }
1087       }
1088     }
1089   }
1090
1091   grouping provider-network {
1092     container provider-network {
1093       description "Container for the provider network.";
1094       leaf physical-network {
1095         description
1096             "Name of the physical network on which the provider
1097              network is built.";
1098         type string;
1099       }
1100
1101       leaf segmentation_id {
1102         description
1103             "ID of segregated virtual networks";
1104             type uint32;
1105       }
1106     }
1107   }
1108
1109   grouping ns-service-primitive {
1110     list service-primitive {
1111       description
1112           "Network service level service primitives.";
1113
1114       key "name";
1115
1116       leaf name {
1117         description
1118             "Name of the service primitive.";
1119         type string;
1120       }
1121
1122       list parameter {
1123         description
1124             "List of parameters for the service primitive.";
1125
1126         key "name";
1127         uses manotypes:primitive-parameter;
1128       }
1129
1130       list parameter-group {
1131         description
1132             "Grouping of parameters which are logically grouped in UI";
1133         key "name";
1134
1135         leaf name {
1136           description
1137               "Name of the parameter group";
1138           type string;
1139         }
1140
1141         list parameter {
1142           description
1143               "List of parameters for the service primitive.";
1144           key "name";
1145           uses manotypes:primitive-parameter;
1146         }
1147
1148         leaf mandatory {
1149           description "Is this parameter group mandatory";
1150           type boolean;
1151           default true;
1152         }
1153       }
1154
1155       list vnf-primitive-group {
1156         description
1157             "List of service primitives grouped by VNF.";
1158
1159         key "member-vnf-index-ref";
1160         leaf member-vnf-index-ref {
1161           description
1162               "Reference to member-vnf within constituent-vnfds";
1163           type string;
1164         }
1165
1166         leaf vnfd-id-ref {
1167           description
1168               "A reference to a vnfd. This is a
1169                leafref to path:
1170                    ../../../../nsd:constituent-vnfd
1171                    + [nsd:id = current()/../nsd:id-ref]
1172                    + /nsd:vnfd-id-ref
1173                NOTE: An issue with confd is preventing the
1174                use of xpath. Seems to be an issue with leafref
1175                to leafref, whose target is in a different module.
1176                Once that is resolved this will switched to use
1177                leafref";
1178
1179           type string;
1180         }
1181
1182         leaf vnfd-name {
1183           description
1184               "Name of the VNFD";
1185           type string;
1186         }
1187
1188         list primitive {
1189           key "index";
1190
1191           leaf index {
1192             description "Index of this primitive";
1193             type uint32;
1194           }
1195
1196           leaf name {
1197             description "Name of the primitive in the VNF primitive ";
1198             type string;
1199           }
1200         }
1201       }
1202
1203       leaf user-defined-script {
1204         description
1205             "A user defined script.";
1206         type string;
1207       }
1208     }
1209   }
1210
1211   grouping http-endpoints {
1212     list http-endpoint {
1213       description
1214           "List of http endpoints to be used by monitoring params";
1215       key path;
1216
1217       leaf path {
1218         description "The HTTP path on the management server";
1219         type string;
1220       }
1221
1222       leaf https {
1223         description "Pick HTTPS instead of HTTP , Default is false";
1224         type boolean;
1225         default "false";
1226       }
1227
1228       leaf port {
1229         description "The HTTP port to connect to";
1230         type inet:port-number;
1231       }
1232
1233       leaf username {
1234         description "The HTTP basic auth username";
1235         type string;
1236       }
1237
1238       leaf password {
1239         description "The HTTP basic auth password";
1240         type string;
1241       }
1242
1243       leaf polling-interval-secs {
1244         description "The HTTP polling interval in seconds";
1245         type uint8;
1246         default 2;
1247       }
1248
1249       leaf method {
1250         description
1251           "Method that the URI should perform.
1252            Deafult action is GET.";
1253
1254         type manotypes:http-method;
1255         default "GET";
1256       }
1257
1258       list headers {
1259         description "Custom HTTP headers to put on HTTP request";
1260         key key;
1261         leaf key{
1262           description "HTTP header key";
1263           type string;
1264         }
1265
1266         leaf value{
1267           description "HTTP header value";
1268           type string;
1269         }
1270       }
1271     }
1272   }
1273
1274   grouping monitoring-param-aggregation {
1275     typedef aggregation-type {
1276       description
1277           "aggregation-type, indicates the way to aggregate monitoring-params
1278           (e.g. how to aggregate CPU utilisation of all VNFs belonging to the
1279           same VNF group identified by member-vnf-index; or how to aggregate
1280           memory utilisation of all VDUs belonging to the same VDU group
1281           identified by vdu id)";
1282       type enumeration {
1283         enum AVERAGE;
1284         enum MINIMUM;
1285         enum MAXIMUM;
1286         enum COUNT;
1287         enum SUM;
1288       }
1289     }
1290
1291     leaf aggregation-type {
1292       type aggregation-type;
1293     }
1294   }
1295
1296   grouping monitoring-param-ui-data {
1297       leaf description {
1298         type string;
1299       }
1300
1301       leaf group-tag {
1302         description "A tag to group monitoring parameters";
1303         type string;
1304       }
1305
1306
1307       leaf widget-type {
1308         description "Defines the UI Display variant of measured counters.";
1309         type manotypes:widget-type;
1310         default "COUNTER";
1311       }
1312
1313       leaf units {
1314         description "Measured Counter Units (e.g., Packets, Kbps, Mbps, etc.)";
1315         type string;
1316       }
1317   }
1318
1319   grouping monitoring-param-value {
1320       leaf value-type {
1321         type param-value-type;
1322         default "INT";
1323       }
1324
1325       container numeric-constraints {
1326         leaf min-value {
1327           description
1328               "Minimum value for the parameter";
1329           type uint64;
1330         }
1331         leaf max-value {
1332           description
1333               "Maximum value for the parameter";
1334           type uint64;
1335         }
1336       }
1337
1338       container text-constraints {
1339         leaf min-length {
1340           description
1341               "Minimum string length for the parameter";
1342           type uint8;
1343         }
1344         leaf max-length {
1345           description
1346               "Maximum string length for the parameter";
1347           type uint8;
1348         }
1349       }
1350
1351       leaf value-integer {
1352         description
1353             "Current value for an integer parameter";
1354         type int64;
1355       }
1356
1357       leaf value-decimal {
1358         description
1359             "Current value for a decimal parameter";
1360         type decimal64 {
1361           fraction-digits 4;
1362         }
1363       }
1364
1365       leaf value-string {
1366         description
1367             "Current value for a string parameter";
1368         type string;
1369       }
1370   }
1371
1372   grouping control-param {
1373     list control-param {
1374       description
1375           "List of control parameters to manage and
1376            update the running configuration of the VNF";
1377       key id;
1378
1379       leaf id {
1380         description "Identifier for control parameter";
1381         type string;
1382       }
1383
1384       leaf name {
1385         description "Name of a control parameter";
1386         type string;
1387       }
1388
1389       leaf description {
1390         description "A description of the control parameter";
1391         type string;
1392       }
1393
1394       leaf group-tag {
1395         description "A tag to group control parameters";
1396         type string;
1397       }
1398
1399       leaf min-value {
1400         description
1401             "Minimum value for the parameter";
1402         type uint64;
1403       }
1404
1405       leaf max-value {
1406         description
1407             "Maximum value for the parameter";
1408         type uint64;
1409       }
1410
1411       leaf current-value {
1412         description
1413             "Current value for the parameter";
1414         type uint64;
1415       }
1416
1417       leaf step-value {
1418         description
1419             "Step value for the parameter";
1420         type uint64;
1421       }
1422
1423       leaf units {
1424         type string;
1425       }
1426
1427       leaf widget-type {
1428         type manotypes:widget-type;
1429       }
1430
1431       leaf url {
1432         description
1433           "This is the URL where the operation should be performed.";
1434
1435         type inet:uri;
1436       }
1437
1438       leaf method {
1439         description
1440           "Method that the URI should perform.
1441            Default Action is POST";
1442
1443         type manotypes:http-method;
1444         default "POST";
1445       }
1446
1447       leaf payload {
1448         description
1449           "This is the operation payload or payload template as stringified
1450            JSON. This field provides the data  to be sent for this operation
1451            call";
1452
1453         type string;
1454       }
1455     }
1456   }
1457
1458   grouping action-param {
1459     list action-param {
1460       description
1461           "List of action parameters to
1462            control VNF";
1463       key id;
1464       leaf id {
1465         type string;
1466       }
1467
1468       leaf name {
1469         type string;
1470       }
1471
1472       leaf description {
1473         type string;
1474       }
1475
1476       leaf group-tag {
1477         description "A tag to group monitoring parameter";
1478         type string;
1479       }
1480
1481       leaf url {
1482         description
1483           "This is the URL where to perform the operation";
1484         type inet:uri;
1485       }
1486
1487       leaf method {
1488         description
1489           "This is the method to be performed at the uri.
1490            POST by default for action";
1491
1492         type manotypes:http-method;
1493         default "POST";
1494       }
1495
1496       leaf payload {
1497         description
1498           "This is the operation payload or payload template to be sent in
1499            the data for this operation call";
1500
1501         type string;
1502       }
1503     }
1504   }
1505
1506   grouping input-parameter {
1507     description "List of input parameters that can be specified when instantiating a network service.";
1508
1509     list input-parameter {
1510       description
1511           "List of input parameters";
1512
1513       key xpath;
1514
1515
1516       leaf xpath {
1517         description
1518           "An xpath that specfies which element in a descriptor is to be
1519           modified.";
1520         type string;
1521       }
1522
1523       leaf value {
1524         description
1525           "The value that the element specified by the xpath should take when a
1526           record is created.";
1527         type string;
1528       }
1529     }
1530   }
1531
1532   grouping input-parameter-xpath {
1533     list input-parameter-xpath {
1534       description
1535           "List of xpaths to parameters inside the NSD
1536            the can be customized during the instantiation.";
1537
1538       key "xpath";
1539       leaf xpath {
1540         description
1541             "An xpath that specifies the element in a descriptor.";
1542         type string;
1543       }
1544
1545       leaf label {
1546         description "A descriptive string";
1547         type string;
1548       }
1549
1550       leaf default-value {
1551         description "Default Value for the Input Parameter";
1552         type string;
1553       }
1554     }
1555   }
1556
1557   grouping nfvi-metrics {
1558     container vcpu {
1559       leaf label {
1560         description
1561           "Label to show in UI";
1562         type string;
1563         default "VCPU";
1564       }
1565
1566       leaf total {
1567         description
1568           "The total number of VCPUs available.";
1569         type uint64;
1570       }
1571
1572       leaf utilization {
1573         description
1574           "The VCPU utilization (percentage).";
1575         type decimal64 {
1576           fraction-digits 2;
1577           range "0 .. 100";
1578         }
1579       }
1580     }
1581
1582     container memory {
1583       leaf label {
1584         description
1585           "Label to show in UI";
1586         type string;
1587         default "MEMORY";
1588       }
1589
1590       leaf used {
1591         description
1592           "The amount of memory (bytes) currently in use.";
1593         type uint64;
1594       }
1595
1596       leaf total {
1597         description
1598           "The amount of memory (bytes) available.";
1599         type uint64;
1600       }
1601
1602       leaf utilization {
1603         description
1604           "The memory utilization (percentage).";
1605         type decimal64 {
1606           fraction-digits 2;
1607           range "0 .. 100";
1608         }
1609       }
1610     }
1611
1612     container storage {
1613       leaf label {
1614         description
1615           "Label to show in UI";
1616         type string;
1617         default "STORAGE";
1618       }
1619
1620       leaf used {
1621         description
1622           "The amount of storage (bytes) currently in use.";
1623         type uint64;
1624       }
1625
1626       leaf total {
1627         description
1628           "The amount of storage (bytes) available.";
1629         type uint64;
1630       }
1631
1632       leaf utilization {
1633         description
1634           "The storage utilization (percentage).";
1635         type decimal64 {
1636           fraction-digits 2;
1637           range "0 .. 100";
1638         }
1639       }
1640     }
1641
1642     container external-ports {
1643       leaf label {
1644         description
1645           "Label to show in UI";
1646         type string;
1647         default "EXTERNAL PORTS";
1648       }
1649
1650       leaf total {
1651         description
1652           "The total number of external ports.";
1653         type uint64;
1654       }
1655     }
1656
1657     container internal-ports {
1658       leaf label {
1659         description
1660           "Label to show in UI";
1661         type string;
1662         default "INTERNAL PORTS";
1663       }
1664
1665       leaf total {
1666         description
1667           "The total number of internal ports.";
1668         type uint64;
1669       }
1670     }
1671
1672     container network {
1673       leaf label {
1674         description
1675           "Label to show in UI";
1676         type string;
1677         default "NETWORK TRAFFIC";
1678       }
1679
1680       container incoming {
1681         leaf label {
1682           description
1683             "Label to show in UI";
1684           type string;
1685           default "INCOMING NETWORK TRAFFIC";
1686         }
1687
1688         leaf bytes {
1689           description
1690             "The cumulative number of incoming bytes.";
1691           type uint64;
1692         }
1693
1694         leaf packets {
1695           description
1696             "The cumulative number of incoming packets.";
1697           type uint64;
1698         }
1699
1700         leaf byte-rate {
1701           description
1702             "The current incoming byte-rate (bytes per second).";
1703           type decimal64 {
1704             fraction-digits 2;
1705           }
1706         }
1707
1708         leaf packet-rate {
1709           description
1710             "The current incoming packet (packets per second).";
1711           type decimal64 {
1712             fraction-digits 2;
1713           }
1714         }
1715       }
1716
1717       container outgoing {
1718         leaf label {
1719           description
1720             "Label to show in UI";
1721           type string;
1722           default "OUTGOING NETWORK TRAFFIC";
1723         }
1724
1725         leaf bytes {
1726           description
1727             "The cumulative number of outgoing bytes.";
1728           type uint64;
1729         }
1730
1731         leaf packets {
1732           description
1733             "The cumulative number of outgoing packets.";
1734           type uint64;
1735         }
1736
1737         leaf byte-rate {
1738           description
1739             "The current outgoing byte-rate (bytes per second).";
1740           type decimal64 {
1741             fraction-digits 2;
1742           }
1743         }
1744
1745         leaf packet-rate {
1746           description
1747             "The current outgoing packet (packets per second).";
1748           type decimal64 {
1749             fraction-digits 2;
1750           }
1751         }
1752       }
1753     }
1754   }
1755
1756   typedef alarm-severity-type {
1757     description "An indication of the importance or urgency of the alarm";
1758     type enumeration {
1759       enum LOW;
1760       enum MODERATE;
1761       enum CRITICAL;
1762     }
1763   }
1764
1765   typedef alarm-metric-type {
1766     description "The type of metrics to register the alarm for";
1767     type enumeration {
1768       enum CPU_UTILIZATION;
1769       enum MEMORY_UTILIZATION;
1770       enum STORAGE_UTILIZATION;
1771     }
1772   }
1773
1774   typedef alarm-statistic-type {
1775     description
1776         "Statistic type to use to determine threshold crossing
1777          for an alarm.";
1778     type enumeration {
1779       enum AVERAGE;
1780       enum MINIMUM;
1781       enum MAXIMUM;
1782       enum COUNT;
1783       enum SUM;
1784     }
1785   }
1786
1787   typedef relational-operation-type {
1788     description
1789         "The relational operator used to define whether an alarm,
1790         scaling event, etc. should be triggered in certain scenarios,
1791         such as if the metric statistic goes above or below a specified
1792         value.";
1793     type enumeration {
1794       enum GE; // greater than or equal
1795       enum LE; // less than or equal
1796       enum GT; // greater than
1797       enum LT; // less than
1798       enum EQ; // equal
1799     }
1800   }
1801
1802   grouping alarm {
1803     leaf alarm-id {
1804       description
1805           "This field is reserved for the identifier assigned by the VIM provider";
1806
1807       type string;
1808     }
1809
1810     leaf name {
1811       description "A human readable string to identify the alarm";
1812       type string;
1813     }
1814
1815     leaf description {
1816       description "A description of this alarm";
1817       type string;
1818     }
1819
1820     leaf vdur-id {
1821       description
1822           "The identifier of the VDUR that the alarm is associated with";
1823       type string;
1824     }
1825
1826     container actions {
1827       list ok {
1828         key "url";
1829         leaf url {
1830           type string;
1831         }
1832       }
1833
1834       list insufficient-data {
1835         key "url";
1836         leaf url {
1837           type string;
1838         }
1839       }
1840
1841       list alarm {
1842         key "url";
1843         leaf url {
1844           type string;
1845         }
1846       }
1847     }
1848
1849     leaf repeat {
1850       description
1851           "This flag indicates whether the alarm should be repeatedly emitted
1852           while the associated threshold has been crossed.";
1853
1854       type boolean;
1855       default true;
1856     }
1857
1858     leaf enabled {
1859       description
1860           "This flag indicates whether the alarm has been enabled or
1861           disabled.";
1862
1863       type boolean;
1864       default true;
1865     }
1866
1867     leaf severity {
1868       description "A measure of the importance or urgency of the alarm";
1869       type alarm-severity-type;
1870     }
1871
1872     leaf metric {
1873       description "The metric to be tracked by this alarm.";
1874       type alarm-metric-type;
1875     }
1876
1877     leaf statistic {
1878       description "The type of metric statistic that is tracked by this alarm";
1879       type alarm-statistic-type;
1880     }
1881
1882     leaf operation {
1883       description
1884           "The relational operator used to define whether an alarm should be
1885            triggered in certain scenarios, such as if the metric statistic
1886            goes above or below a specified value.";
1887       type relational-operation-type;
1888     }
1889
1890     leaf value {
1891       description
1892           "This value defines the threshold that, if crossed, will trigger
1893           the alarm.";
1894       type decimal64 {
1895         fraction-digits 4;
1896       }
1897     }
1898
1899     leaf period {
1900       description
1901           "The period defines the length of time (seconds) that the metric
1902           data are collected over in oreder to evaluate the chosen
1903           statistic.";
1904       type uint32;
1905     }
1906
1907     leaf evaluations {
1908       description
1909           "Defines the length of time (seconds) in which metric data are
1910            collected in order to evaluate the chosen statistic.";
1911       type uint32;
1912     }
1913   }
1914
1915   typedef cloud-account-type {
1916     description "VIM account type";
1917     type enumeration {
1918       enum aws;
1919       enum cloudsim;
1920       enum cloudsim_proxy;
1921       enum mock;
1922       enum openmano;
1923       enum openstack;
1924       enum vsphere;
1925       enum openvim;
1926     }
1927   }
1928
1929   grouping host-aggregate {
1930     list host-aggregate {
1931       description "Name of the Host Aggregate";
1932       key "metadata-key";
1933
1934       leaf metadata-key {
1935         description
1936             "Name of the additional information attached to the host-aggregate";
1937         type string;
1938       }
1939       leaf metadata-value {
1940         description
1941             "Value of the corresponding metadata-key";
1942         type string;
1943       }
1944     }
1945   }
1946
1947   grouping placement-group-input {
1948     leaf cloud-type {
1949       type manotypes:cloud-account-type;
1950     }
1951     choice cloud-provider {
1952       case openstack {
1953         container availability-zone {
1954           description "Name of the Availability Zone";
1955           leaf name {
1956             type string;
1957           }
1958         }
1959         container server-group {
1960           description "Name of the Affinity/Anti-Affinity Server Group";
1961           leaf name {
1962             type string;
1963           }
1964         }
1965         uses host-aggregate;
1966       }
1967       case aws {
1968         leaf aws-construct {
1969           type empty;
1970         }
1971       }
1972       case openmano {
1973         leaf openmano-construct {
1974           type empty;
1975         }
1976       }
1977       case vsphere {
1978         leaf vsphere-construct {
1979           type empty;
1980         }
1981       }
1982       case mock {
1983         leaf mock-construct {
1984           type empty;
1985         }
1986       }
1987       case cloudsim {
1988         leaf cloudsim-construct {
1989           type empty;
1990         }
1991       }
1992     }
1993   }
1994
1995   grouping cloud-config {
1996     list key-pair {
1997       key "name";
1998       description "Used to configure the list of public keys to be injected as part
1999           of ns instantiation";
2000
2001       leaf name {
2002         description "Name of this key pair";
2003         type string;
2004       }
2005
2006       leaf key {
2007         description "Key associated with this key pair";
2008         type string;
2009       }
2010     }
2011
2012     list user {
2013       key "name";
2014       description "List of users to be added through cloud-config";
2015
2016       leaf name {
2017         description "Name of the user ";
2018         type string;
2019       }
2020
2021       leaf user-info {
2022         description "The user name's real name";
2023         type string;
2024       }
2025
2026       list key-pair {
2027         key "name";
2028         description "Used to configure the list of public keys to be injected as part
2029             of ns instantiation";
2030
2031         leaf name {
2032           description "Name of this key pair";
2033           type string;
2034         }
2035
2036         leaf key {
2037           description "Key associated with this key pair";
2038           type string;
2039         }
2040       }
2041     }
2042   }
2043
2044   grouping placement-group-info {
2045     description "";
2046
2047     leaf name {
2048       description
2049           "Place group construct to define the compute resource placement strategy
2050            in cloud environment";
2051       type string;
2052     }
2053
2054     leaf requirement {
2055       description "This is free text space used to describe the intent/rationale
2056                    behind this placement group. This is for human consumption only";
2057       type string;
2058     }
2059
2060     leaf strategy {
2061       description
2062           "Strategy associated with this placement group
2063              Following values are possible
2064                - COLOCATION: Colocation strategy imply intent to share the physical
2065                              infrastructure (hypervisor/network) among all members
2066                              of this group.
2067                - ISOLATION: Isolation strategy imply intent to not share the physical
2068                             infrastructure (hypervisor/network) among the members
2069                             of this group.
2070              ";
2071       type enumeration {
2072         enum COLOCATION;
2073         enum ISOLATION;
2074       }
2075       default "COLOCATION";
2076     }
2077   }
2078
2079   grouping ip-profile-info {
2080     description "Grouping for IP-Profile";
2081     container ip-profile-params {
2082
2083       leaf ip-version {
2084         type inet:ip-version;
2085         default ipv4;
2086       }
2087
2088       leaf subnet-address {
2089         description "Subnet IP prefix associated with IP Profile";
2090         type inet:ip-prefix;
2091       }
2092
2093       leaf gateway-address {
2094         description "IP Address of the default gateway associated with IP Profile";
2095         type inet:ip-address;
2096       }
2097
2098       leaf security-group {
2099         description "Name of the security group";
2100         type string;
2101       }
2102
2103       list dns-server {
2104         key "address";
2105         leaf address {
2106           description "List of DNS Servers associated with IP Profile";
2107           type inet:ip-address;
2108         }
2109       }
2110
2111       container dhcp-params {
2112         leaf enabled {
2113           description "This flag indicates if DHCP is enabled or not";
2114           type boolean;
2115           default true;
2116         }
2117
2118         leaf start-address {
2119           description "Start IP address of the IP-Address range associated with DHCP domain";
2120           type inet:ip-address;
2121         }
2122
2123         leaf count {
2124           description "Size of the DHCP pool associated with DHCP domain";
2125           type uint32;
2126         }
2127       }
2128
2129       leaf subnet-prefix-pool {
2130         description "VIM Specific reference to pre-created subnet prefix";
2131         type string;
2132       }
2133     }
2134   }
2135
2136   grouping ip-profile-list {
2137     list ip-profiles {
2138       description
2139           "List of IP Profiles.
2140              IP Profile describes the IP characteristics for the Virtual-Link";
2141
2142       key "name";
2143
2144       leaf name {
2145         description "Name of the IP-Profile";
2146         type string;
2147       }
2148
2149       leaf description {
2150         description "Description for IP profile";
2151         type string;
2152       }
2153
2154       uses ip-profile-info;
2155     }
2156   }
2157
2158   grouping config-file {
2159     description "Grouping for files needed to be mounted into an additional drive";
2160     list config-file {
2161       description
2162           "List of configuration files to be written on an additional drive";
2163       key "source";
2164       leaf source {
2165         description "Name of the configuration file";
2166         type string;
2167       }
2168       leaf dest {
2169         description "Full path of the destination in the guest";
2170         type string;
2171       }
2172     }
2173   }
2174
2175   grouping supplemental-boot-data {
2176     description "Grouping for custom vim data";
2177     container supplemental-boot-data {
2178 //    uses manotypes:config-file;
2179       leaf boot-data-drive {
2180         description "Some VIMs implement additional drives to host config-files or meta-data";
2181         type boolean;
2182         default false;
2183       }
2184     }
2185   }
2186
2187   grouping volume-info {
2188     description "Grouping for Volume-info";
2189
2190     leaf description {
2191       description "Description for Volume";
2192       type string;
2193     }
2194
2195     leaf size {
2196       description "Size of disk in GB";
2197       type uint64;
2198     }
2199
2200     choice volume-source {
2201       description
2202             "Defines the source of the volume. Possible options are
2203              1. Ephemeral -- Empty disk
2204              2. Image     -- Refer to image to be used for volume
2205              3. Volume    -- Reference of pre-existing volume to be used
2206             ";
2207
2208       case ephemeral {
2209         leaf ephemeral {
2210           type empty;
2211         }
2212       }
2213
2214       case image {
2215         uses image-properties;
2216       }
2217     }
2218
2219     leaf device-bus {
2220       description "Type of disk-bus on which this disk is exposed to guest";
2221       type enumeration {
2222         enum ide;
2223         enum usb;
2224         enum virtio;
2225         enum scsi;
2226       }
2227     }
2228
2229     leaf device-type {
2230       description "The type of device as exposed to guest";
2231       type enumeration {
2232           enum disk;
2233           enum cdrom;
2234           enum floppy;
2235           enum lun;
2236       }
2237     }
2238   }
2239
2240   grouping rpc-project-name {
2241     leaf project-name {
2242       default "default";
2243       description
2244         "Project to which this belongs";
2245       type leafref {
2246         path "/rw-project:project/rw-project:name";
2247       }
2248     }
2249   }
2250 }