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