46472e75483596314e6983f2ff0a982e9b09198a
[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
895       leaf om-cpu-model-string {
896         description "OpenMANO CPU model string";
897         type string;
898       }
899
900       list om-cpu-feature {
901         key "feature";
902         description "List of OpenMANO CPU features";
903         leaf feature {
904           description "CPU feature";
905           type string;
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       leaf cpu-pinning-policy {
940         description
941             "CPU pinning policy describes association
942              between virtual CPUs in guest and the
943              physical CPUs in the host.
944              DEDICATED : Virtual CPUs are pinned to
945                          physical CPUs
946              SHARED    : Multiple VMs may share the
947                          same physical CPUs.
948              ANY       : Any policy is acceptable for the VM";
949         type enumeration {
950           enum DEDICATED;
951           enum SHARED;
952           enum ANY;
953         }
954         default "ANY";
955       }
956
957       leaf cpu-thread-pinning-policy {
958           description
959             "CPU thread pinning policy describes how to
960              place the guest CPUs when the host supports
961              hyper threads:
962              AVOID   : Avoids placing a guest on a host
963                        with threads.
964              SEPARATE: Places vCPUs on separate cores,
965                        and avoids placing two vCPUs on
966                        two threads of same core.
967              ISOLATE : Places each vCPU on a different core,
968                        and places no vCPUs from a different
969                        guest on the same core.
970              PREFER  : Attempts to place vCPUs on threads
971                        of the same core.";
972         type enumeration {
973           enum AVOID;
974           enum SEPARATE;
975           enum ISOLATE;
976           enum PREFER;
977         }
978       }
979
980       list pcie-device {
981         description
982             "List of pcie passthrough devices.";
983         key device-id;
984         leaf device-id {
985           description
986               "Device identifier.";
987           type string;
988         }
989         leaf count {
990           description
991               "Number of devices to attach to the VM.";
992           type uint64;
993         }
994       }
995
996       choice numa-policy {
997         case numa-unaware {
998           leaf numa-unaware {
999             type empty;
1000           }
1001         }
1002
1003         case numa-aware {
1004           container numa-node-policy {
1005             description
1006                 "This policy defines NUMA topology of the
1007                  guest. Specifically identifies if the guest
1008                  should be run on a host with one NUMA
1009                  node or multiple NUMA nodes. As an example
1010                  a guest might need 8 VCPUs and 4 GB of
1011                  memory. However, it might need the VCPUs
1012                  and memory distributed across multiple
1013                  NUMA nodes. In this scenario, NUMA node
1014                  1 could run with 6 VCPUs and 3GB, and
1015                  NUMA node 2 could run with 2 VCPUs and
1016                  1GB.";
1017
1018             leaf node-cnt {
1019               description
1020                   "The number of NUMA nodes to expose to the VM.";
1021               type uint16;
1022             }
1023
1024             leaf mem-policy {
1025               description
1026                   "This policy specifies how the memory should
1027                    be allocated in a multi-node scenario.
1028                    STRICT    : The memory must be allocated
1029                                strictly from the memory attached
1030                                to the NUMA node.
1031                    PREFERRED : The memory should be allocated
1032                                preferentially from the memory
1033                                attached to the NUMA node";
1034               type enumeration {
1035                 enum STRICT;
1036                 enum PREFERRED;
1037               }
1038             }
1039
1040            list node {
1041               key id;
1042               leaf id {
1043                 description
1044                     "NUMA node identification. Typically
1045                      it's 0 or 1";
1046                 type uint64;
1047               }
1048
1049               list vcpu {
1050                 key "id";
1051                 description
1052                     "List of VCPUs to allocate on
1053                      this NUMA node.";
1054                 leaf id {
1055                   type uint64;
1056                   description "List of VCPUs ids to allocate on
1057                                this NUMA node";
1058                 }
1059               }
1060
1061               leaf memory-mb {
1062                 description
1063                     "Memory size expressed in MB
1064                      for this NUMA node.";
1065                 type uint64;
1066               }
1067
1068               choice om-numa-type {
1069                 description
1070                     "OpenMANO Numa type selection";
1071
1072                 case cores {
1073                   leaf num-cores {
1074                     type uint8;
1075                   }
1076                 }
1077
1078                 case paired-threads {
1079                   container paired-threads {
1080                     leaf num-paired-threads {
1081                       type uint8;
1082                     }
1083
1084                     list paired-thread-ids {
1085                       description
1086                           "List of thread pairs to use in case of paired-thread NUMA";
1087                       max-elements 16;
1088                       key thread-a;
1089
1090                       leaf thread-a {
1091                           type uint8;
1092                       }
1093
1094                       leaf thread-b {
1095                           type uint8;
1096                       }
1097                     }
1098                   }
1099                 }
1100                 case threads {
1101                   leaf num-threads {
1102                     type uint8;
1103                   }
1104                 }
1105               }
1106             }
1107
1108           }
1109         }
1110       }
1111     }
1112   }
1113
1114   grouping provider-network {
1115     container provider-network {
1116       description "Container for the provider network.";
1117       leaf physical-network {
1118         description
1119             "Name of the physical network on which the provider
1120              network is built.";
1121         type string;
1122       }
1123
1124       leaf segmentation_id {
1125         description
1126             "ID of segregated virtual networks";
1127             type uint32;
1128       }
1129     }
1130   }
1131
1132   grouping ns-service-primitive {
1133     list service-primitive {
1134       description
1135           "Network service level service primitives.";
1136
1137       key "name";
1138
1139       leaf name {
1140         description
1141             "Name of the service primitive.";
1142         type string;
1143       }
1144
1145       list parameter {
1146         description
1147             "List of parameters for the service primitive.";
1148
1149         key "name";
1150         uses manotypes:primitive-parameter;
1151       }
1152
1153       list parameter-group {
1154         description
1155             "Grouping of parameters which are logically grouped in UI";
1156         key "name";
1157
1158         leaf name {
1159           description
1160               "Name of the parameter group";
1161           type string;
1162         }
1163
1164         list parameter {
1165           description
1166               "List of parameters for the service primitive.";
1167           key "name";
1168           uses manotypes:primitive-parameter;
1169         }
1170
1171         leaf mandatory {
1172           description "Is this parameter group mandatory";
1173           type boolean;
1174           default true;
1175         }
1176       }
1177
1178       list vnf-primitive-group {
1179         description
1180             "List of service primitives grouped by VNF.";
1181
1182         key "member-vnf-index-ref";
1183         leaf member-vnf-index-ref {
1184           description
1185               "Reference to member-vnf within constituent-vnfds";
1186           type string;
1187         }
1188
1189         leaf vnfd-id-ref {
1190           description
1191               "A reference to a vnfd. This is a
1192                leafref to path:
1193                    ../../../../nsd:constituent-vnfd
1194                    + [nsd:id = current()/../nsd:id-ref]
1195                    + /nsd:vnfd-id-ref
1196                NOTE: An issue with confd is preventing the
1197                use of xpath. Seems to be an issue with leafref
1198                to leafref, whose target is in a different module.
1199                Once that is resolved this will switched to use
1200                leafref";
1201
1202           type string;
1203         }
1204
1205         leaf vnfd-name {
1206           description
1207               "Name of the VNFD";
1208           type string;
1209         }
1210
1211         list primitive {
1212           key "index";
1213
1214           leaf index {
1215             description "Index of this primitive";
1216             type uint32;
1217           }
1218
1219           leaf name {
1220             description "Name of the primitive in the VNF primitive ";
1221             type string;
1222           }
1223         }
1224       }
1225
1226       leaf user-defined-script {
1227         description
1228             "A user defined script.";
1229         type string;
1230       }
1231     }
1232   }
1233
1234   grouping http-endpoints {
1235     list http-endpoint {
1236       description
1237           "List of http endpoints to be used by monitoring params";
1238       key path;
1239
1240       leaf path {
1241         description "The HTTP path on the management server";
1242         type string;
1243       }
1244
1245       leaf https {
1246         description "Pick HTTPS instead of HTTP , Default is false";
1247         type boolean;
1248         default "false";
1249       }
1250
1251       leaf port {
1252         description "The HTTP port to connect to";
1253         type inet:port-number;
1254       }
1255
1256       leaf username {
1257         description "The HTTP basic auth username";
1258         type string;
1259       }
1260
1261       leaf password {
1262         description "The HTTP basic auth password";
1263         type string;
1264       }
1265
1266       leaf polling-interval-secs {
1267         description "The HTTP polling interval in seconds";
1268         type uint8;
1269         default 2;
1270       }
1271
1272       leaf method {
1273         description
1274           "Method that the URI should perform.
1275            Deafult action is GET.";
1276
1277         type manotypes:http-method;
1278         default "GET";
1279       }
1280
1281       list headers {
1282         description "Custom HTTP headers to put on HTTP request";
1283         key key;
1284         leaf key{
1285           description "HTTP header key";
1286           type string;
1287         }
1288
1289         leaf value{
1290           description "HTTP header value";
1291           type string;
1292         }
1293       }
1294     }
1295   }
1296
1297   grouping monitoring-param-aggregation {
1298     typedef aggregation-type {
1299       description
1300           "aggregation-type, indicates the way to aggregate monitoring-params
1301           (e.g. how to aggregate CPU utilisation of all VNFs belonging to the
1302           same VNF group identified by member-vnf-index; or how to aggregate
1303           memory utilisation of all VDUs belonging to the same VDU group
1304           identified by vdu id)";
1305       type enumeration {
1306         enum AVERAGE;
1307         enum MINIMUM;
1308         enum MAXIMUM;
1309         enum COUNT;
1310         enum SUM;
1311       }
1312     }
1313
1314     leaf aggregation-type {
1315       type aggregation-type;
1316     }
1317   }
1318
1319   grouping monitoring-param-ui-data {
1320       leaf description {
1321         type string;
1322       }
1323
1324       leaf group-tag {
1325         description "A tag to group monitoring parameters";
1326         type string;
1327       }
1328
1329
1330       leaf widget-type {
1331         description "Defines the UI Display variant of measured counters.";
1332         type manotypes:widget-type;
1333         default "COUNTER";
1334       }
1335
1336       leaf units {
1337         description "Measured Counter Units (e.g., Packets, Kbps, Mbps, etc.)";
1338         type string;
1339       }
1340   }
1341
1342   grouping monitoring-param-value {
1343       leaf value-type {
1344         type param-value-type;
1345         default "INT";
1346       }
1347
1348       container numeric-constraints {
1349         leaf min-value {
1350           description
1351               "Minimum value for the parameter";
1352           type uint64;
1353         }
1354         leaf max-value {
1355           description
1356               "Maximum value for the parameter";
1357           type uint64;
1358         }
1359       }
1360
1361       container text-constraints {
1362         leaf min-length {
1363           description
1364               "Minimum string length for the parameter";
1365           type uint8;
1366         }
1367         leaf max-length {
1368           description
1369               "Maximum string length for the parameter";
1370           type uint8;
1371         }
1372       }
1373
1374       leaf value-integer {
1375         description
1376             "Current value for an integer parameter";
1377         type int64;
1378       }
1379
1380       leaf value-decimal {
1381         description
1382             "Current value for a decimal parameter";
1383         type decimal64 {
1384           fraction-digits 4;
1385         }
1386       }
1387
1388       leaf value-string {
1389         description
1390             "Current value for a string parameter";
1391         type string;
1392       }
1393   }
1394
1395   grouping control-param {
1396     list control-param {
1397       description
1398           "List of control parameters to manage and
1399            update the running configuration of the VNF";
1400       key id;
1401
1402       leaf id {
1403         description "Identifier for control parameter";
1404         type string;
1405       }
1406
1407       leaf name {
1408         description "Name of a control parameter";
1409         type string;
1410       }
1411
1412       leaf description {
1413         description "A description of the control parameter";
1414         type string;
1415       }
1416
1417       leaf group-tag {
1418         description "A tag to group control parameters";
1419         type string;
1420       }
1421
1422       leaf min-value {
1423         description
1424             "Minimum value for the parameter";
1425         type uint64;
1426       }
1427
1428       leaf max-value {
1429         description
1430             "Maximum value for the parameter";
1431         type uint64;
1432       }
1433
1434       leaf current-value {
1435         description
1436             "Current value for the parameter";
1437         type uint64;
1438       }
1439
1440       leaf step-value {
1441         description
1442             "Step value for the parameter";
1443         type uint64;
1444       }
1445
1446       leaf units {
1447         type string;
1448       }
1449
1450       leaf widget-type {
1451         type manotypes:widget-type;
1452       }
1453
1454       leaf url {
1455         description
1456           "This is the URL where the operation should be performed.";
1457
1458         type inet:uri;
1459       }
1460
1461       leaf method {
1462         description
1463           "Method that the URI should perform.
1464            Default Action is POST";
1465
1466         type manotypes:http-method;
1467         default "POST";
1468       }
1469
1470       leaf payload {
1471         description
1472           "This is the operation payload or payload template as stringified
1473            JSON. This field provides the data  to be sent for this operation
1474            call";
1475
1476         type string;
1477       }
1478     }
1479   }
1480
1481   grouping action-param {
1482     list action-param {
1483       description
1484           "List of action parameters to
1485            control VNF";
1486       key id;
1487       leaf id {
1488         type string;
1489       }
1490
1491       leaf name {
1492         type string;
1493       }
1494
1495       leaf description {
1496         type string;
1497       }
1498
1499       leaf group-tag {
1500         description "A tag to group monitoring parameter";
1501         type string;
1502       }
1503
1504       leaf url {
1505         description
1506           "This is the URL where to perform the operation";
1507         type inet:uri;
1508       }
1509
1510       leaf method {
1511         description
1512           "This is the method to be performed at the uri.
1513            POST by default for action";
1514
1515         type manotypes:http-method;
1516         default "POST";
1517       }
1518
1519       leaf payload {
1520         description
1521           "This is the operation payload or payload template to be sent in
1522            the data for this operation call";
1523
1524         type string;
1525       }
1526     }
1527   }
1528
1529   grouping input-parameter {
1530     description "List of input parameters that can be specified when instantiating a network service.";
1531
1532     list input-parameter {
1533       description
1534           "List of input parameters";
1535
1536       key xpath;
1537
1538
1539       leaf xpath {
1540         description
1541           "An xpath that specfies which element in a descriptor is to be
1542           modified.";
1543         type string;
1544       }
1545
1546       leaf value {
1547         description
1548           "The value that the element specified by the xpath should take when a
1549           record is created.";
1550         type string;
1551       }
1552     }
1553   }
1554
1555   grouping input-parameter-xpath {
1556     list input-parameter-xpath {
1557       description
1558           "List of xpaths to parameters inside the NSD
1559            the can be customized during the instantiation.";
1560
1561       key "xpath";
1562       leaf xpath {
1563         description
1564             "An xpath that specifies the element in a descriptor.";
1565         type string;
1566       }
1567
1568       leaf label {
1569         description "A descriptive string";
1570         type string;
1571       }
1572
1573       leaf default-value {
1574         description "Default Value for the Input Parameter";
1575         type string;
1576       }
1577     }
1578   }
1579
1580   grouping nfvi-metrics {
1581     container vcpu {
1582       leaf label {
1583         description
1584           "Label to show in UI";
1585         type string;
1586         default "VCPU";
1587       }
1588
1589       leaf total {
1590         description
1591           "The total number of VCPUs available.";
1592         type uint64;
1593       }
1594
1595       leaf utilization {
1596         description
1597           "The VCPU utilization (percentage).";
1598         type decimal64 {
1599           fraction-digits 2;
1600           range "0 .. 100";
1601         }
1602       }
1603     }
1604
1605     container memory {
1606       leaf label {
1607         description
1608           "Label to show in UI";
1609         type string;
1610         default "MEMORY";
1611       }
1612
1613       leaf used {
1614         description
1615           "The amount of memory (bytes) currently in use.";
1616         type uint64;
1617       }
1618
1619       leaf total {
1620         description
1621           "The amount of memory (bytes) available.";
1622         type uint64;
1623       }
1624
1625       leaf utilization {
1626         description
1627           "The memory utilization (percentage).";
1628         type decimal64 {
1629           fraction-digits 2;
1630           range "0 .. 100";
1631         }
1632       }
1633     }
1634
1635     container storage {
1636       leaf label {
1637         description
1638           "Label to show in UI";
1639         type string;
1640         default "STORAGE";
1641       }
1642
1643       leaf used {
1644         description
1645           "The amount of storage (bytes) currently in use.";
1646         type uint64;
1647       }
1648
1649       leaf total {
1650         description
1651           "The amount of storage (bytes) available.";
1652         type uint64;
1653       }
1654
1655       leaf utilization {
1656         description
1657           "The storage utilization (percentage).";
1658         type decimal64 {
1659           fraction-digits 2;
1660           range "0 .. 100";
1661         }
1662       }
1663     }
1664
1665     container external-ports {
1666       leaf label {
1667         description
1668           "Label to show in UI";
1669         type string;
1670         default "EXTERNAL PORTS";
1671       }
1672
1673       leaf total {
1674         description
1675           "The total number of external ports.";
1676         type uint64;
1677       }
1678     }
1679
1680     container internal-ports {
1681       leaf label {
1682         description
1683           "Label to show in UI";
1684         type string;
1685         default "INTERNAL PORTS";
1686       }
1687
1688       leaf total {
1689         description
1690           "The total number of internal ports.";
1691         type uint64;
1692       }
1693     }
1694
1695     container network {
1696       leaf label {
1697         description
1698           "Label to show in UI";
1699         type string;
1700         default "NETWORK TRAFFIC";
1701       }
1702
1703       container incoming {
1704         leaf label {
1705           description
1706             "Label to show in UI";
1707           type string;
1708           default "INCOMING NETWORK TRAFFIC";
1709         }
1710
1711         leaf bytes {
1712           description
1713             "The cumulative number of incoming bytes.";
1714           type uint64;
1715         }
1716
1717         leaf packets {
1718           description
1719             "The cumulative number of incoming packets.";
1720           type uint64;
1721         }
1722
1723         leaf byte-rate {
1724           description
1725             "The current incoming byte-rate (bytes per second).";
1726           type decimal64 {
1727             fraction-digits 2;
1728           }
1729         }
1730
1731         leaf packet-rate {
1732           description
1733             "The current incoming packet (packets per second).";
1734           type decimal64 {
1735             fraction-digits 2;
1736           }
1737         }
1738       }
1739
1740       container outgoing {
1741         leaf label {
1742           description
1743             "Label to show in UI";
1744           type string;
1745           default "OUTGOING NETWORK TRAFFIC";
1746         }
1747
1748         leaf bytes {
1749           description
1750             "The cumulative number of outgoing bytes.";
1751           type uint64;
1752         }
1753
1754         leaf packets {
1755           description
1756             "The cumulative number of outgoing packets.";
1757           type uint64;
1758         }
1759
1760         leaf byte-rate {
1761           description
1762             "The current outgoing byte-rate (bytes per second).";
1763           type decimal64 {
1764             fraction-digits 2;
1765           }
1766         }
1767
1768         leaf packet-rate {
1769           description
1770             "The current outgoing packet (packets per second).";
1771           type decimal64 {
1772             fraction-digits 2;
1773           }
1774         }
1775       }
1776     }
1777   }
1778
1779   typedef alarm-severity-type {
1780     description "An indication of the importance or urgency of the alarm";
1781     type enumeration {
1782       enum LOW;
1783       enum MODERATE;
1784       enum CRITICAL;
1785     }
1786   }
1787
1788   typedef alarm-metric-type {
1789     description "The type of metrics to register the alarm for";
1790     type enumeration {
1791       enum CPU_UTILIZATION;
1792       enum MEMORY_UTILIZATION;
1793       enum STORAGE_UTILIZATION;
1794     }
1795   }
1796
1797   typedef alarm-statistic-type {
1798     description
1799         "Statistic type to use to determine threshold crossing
1800          for an alarm.";
1801     type enumeration {
1802       enum AVERAGE;
1803       enum MINIMUM;
1804       enum MAXIMUM;
1805       enum COUNT;
1806       enum SUM;
1807     }
1808   }
1809
1810   typedef relational-operation-type {
1811     description
1812         "The relational operator used to define whether an alarm,
1813         scaling event, etc. should be triggered in certain scenarios,
1814         such as if the metric statistic goes above or below a specified
1815         value.";
1816     type enumeration {
1817       enum GE; // greater than or equal
1818       enum LE; // less than or equal
1819       enum GT; // greater than
1820       enum LT; // less than
1821       enum EQ; // equal
1822     }
1823   }
1824
1825   grouping alarm-properties {
1826     leaf name {
1827       description "A human readable string to identify the alarm";
1828       type string;
1829     }
1830
1831     leaf description {
1832       description "A description of this alarm";
1833       type string;
1834     }
1835
1836     leaf vdur-id {
1837       description
1838           "The identifier of the VDUR that the alarm is associated with";
1839       type string;
1840     }
1841
1842     container actions {
1843       list ok {
1844         key "url";
1845         leaf url {
1846           type string;
1847         }
1848       }
1849
1850       list insufficient-data {
1851         key "url";
1852         leaf url {
1853           type string;
1854         }
1855       }
1856
1857       list alarm {
1858         key "url";
1859         leaf url {
1860           type string;
1861         }
1862       }
1863     }
1864
1865     leaf repeat {
1866       description
1867           "This flag indicates whether the alarm should be repeatedly emitted
1868           while the associated threshold has been crossed.";
1869
1870       type boolean;
1871       default true;
1872     }
1873
1874     leaf enabled {
1875       description
1876           "This flag indicates whether the alarm has been enabled or
1877           disabled.";
1878
1879       type boolean;
1880       default true;
1881     }
1882
1883     leaf severity {
1884       description "A measure of the importance or urgency of the alarm";
1885       type alarm-severity-type;
1886     }
1887
1888     leaf statistic {
1889       description "The type of metric statistic that is tracked by this alarm";
1890       type alarm-statistic-type;
1891     }
1892
1893     leaf operation {
1894       description
1895           "The relational operator used to define whether an alarm should be
1896            triggered in certain scenarios, such as if the metric statistic
1897            goes above or below a specified value.";
1898       type relational-operation-type;
1899     }
1900
1901     leaf value {
1902       description
1903           "This value defines the threshold that, if crossed, will trigger
1904           the alarm.";
1905       type decimal64 {
1906         fraction-digits 4;
1907       }
1908     }
1909
1910     leaf period {
1911       description
1912           "The period defines the length of time (seconds) that the metric
1913           data are collected over in oreder to evaluate the chosen
1914           statistic.";
1915       type uint32;
1916     }
1917
1918     leaf evaluations {
1919       description
1920           "Defines the length of time (seconds) in which metric data are
1921            collected in order to evaluate the chosen statistic.";
1922       type uint32;
1923     }
1924   }
1925
1926   typedef cloud-account-type {
1927     description "VIM account type";
1928     type enumeration {
1929       enum aws;
1930       enum cloudsim;
1931       enum cloudsim_proxy;
1932       enum mock;
1933       enum openmano;
1934       enum openstack;
1935       enum vsphere;
1936       enum openvim;
1937     }
1938   }
1939
1940   grouping host-aggregate {
1941     list host-aggregate {
1942       description "Name of the Host Aggregate";
1943       key "metadata-key";
1944
1945       leaf metadata-key {
1946         description
1947             "Name of the additional information attached to the host-aggregate";
1948         type string;
1949       }
1950       leaf metadata-value {
1951         description
1952             "Value of the corresponding metadata-key";
1953         type string;
1954       }
1955     }
1956   }
1957
1958   grouping placement-group-input {
1959     leaf cloud-type {
1960       type manotypes:cloud-account-type;
1961     }
1962     choice cloud-provider {
1963       case openstack {
1964         container availability-zone {
1965           description "Name of the Availability Zone";
1966           leaf name {
1967             type string;
1968           }
1969         }
1970         container server-group {
1971           description "Name of the Affinity/Anti-Affinity Server Group";
1972           leaf name {
1973             type string;
1974           }
1975         }
1976         uses host-aggregate;
1977       }
1978       case aws {
1979         leaf aws-construct {
1980           type empty;
1981         }
1982       }
1983       case openmano {
1984         leaf openmano-construct {
1985           type empty;
1986         }
1987       }
1988       case vsphere {
1989         leaf vsphere-construct {
1990           type empty;
1991         }
1992       }
1993       case mock {
1994         leaf mock-construct {
1995           type empty;
1996         }
1997       }
1998       case cloudsim {
1999         leaf cloudsim-construct {
2000           type empty;
2001         }
2002       }
2003     }
2004   }
2005
2006   grouping cloud-config {
2007     list key-pair {
2008       key "name";
2009       description "Used to configure the list of public keys to be injected as part
2010           of ns instantiation";
2011
2012       leaf name {
2013         description "Name of this key pair";
2014         type string;
2015       }
2016
2017       leaf key {
2018         description "Key associated with this key pair";
2019         type string;
2020       }
2021     }
2022
2023     list user {
2024       key "name";
2025       description "List of users to be added through cloud-config";
2026
2027       leaf name {
2028         description "Name of the user ";
2029         type string;
2030       }
2031
2032       leaf user-info {
2033         description "The user name's real name";
2034         type string;
2035       }
2036
2037       list key-pair {
2038         key "name";
2039         description "Used to configure the list of public keys to be injected as part
2040             of ns instantiation";
2041
2042         leaf name {
2043           description "Name of this key pair";
2044           type string;
2045         }
2046
2047         leaf key {
2048           description "Key associated with this key pair";
2049           type string;
2050         }
2051       }
2052     }
2053   }
2054
2055   grouping placement-group-info {
2056     description "";
2057
2058     leaf name {
2059       description
2060           "Place group construct to define the compute resource placement strategy
2061            in cloud environment";
2062       type string;
2063     }
2064
2065     leaf requirement {
2066       description "This is free text space used to describe the intent/rationale
2067                    behind this placement group. This is for human consumption only";
2068       type string;
2069     }
2070
2071     leaf strategy {
2072       description
2073           "Strategy associated with this placement group
2074              Following values are possible
2075                - COLOCATION: Colocation strategy imply intent to share the physical
2076                              infrastructure (hypervisor/network) among all members
2077                              of this group.
2078                - ISOLATION: Isolation strategy imply intent to not share the physical
2079                             infrastructure (hypervisor/network) among the members
2080                             of this group.
2081              ";
2082       type enumeration {
2083         enum COLOCATION;
2084         enum ISOLATION;
2085       }
2086       default "COLOCATION";
2087     }
2088   }
2089
2090   grouping ip-profile-info {
2091     description "Grouping for IP-Profile";
2092     container ip-profile-params {
2093
2094       leaf ip-version {
2095         type inet:ip-version;
2096         default ipv4;
2097       }
2098
2099       leaf subnet-address {
2100         description "Subnet IP prefix associated with IP Profile";
2101         type inet:ip-prefix;
2102       }
2103
2104       leaf gateway-address {
2105         description "IP Address of the default gateway associated with IP Profile";
2106         type inet:ip-address;
2107       }
2108
2109       leaf security-group {
2110         description "Name of the security group";
2111         type string;
2112       }
2113
2114       list dns-server {
2115         key "address";
2116         leaf address {
2117           description "List of DNS Servers associated with IP Profile";
2118           type inet:ip-address;
2119         }
2120       }
2121
2122       container dhcp-params {
2123         leaf enabled {
2124           description "This flag indicates if DHCP is enabled or not";
2125           type boolean;
2126           default true;
2127         }
2128
2129         leaf start-address {
2130           description "Start IP address of the IP-Address range associated with DHCP domain";
2131           type inet:ip-address;
2132         }
2133
2134         leaf count {
2135           description "Size of the DHCP pool associated with DHCP domain";
2136           type uint32;
2137         }
2138       }
2139
2140       leaf subnet-prefix-pool {
2141         description "VIM Specific reference to pre-created subnet prefix";
2142         type string;
2143       }
2144     }
2145   }
2146
2147   grouping ip-profile-list {
2148     list ip-profiles {
2149       description
2150           "List of IP Profiles.
2151              IP Profile describes the IP characteristics for the Virtual-Link";
2152
2153       key "name";
2154
2155       leaf name {
2156         description "Name of the IP-Profile";
2157         type string;
2158       }
2159
2160       leaf description {
2161         description "Description for IP profile";
2162         type string;
2163       }
2164
2165       uses ip-profile-info;
2166     }
2167   }
2168
2169   grouping config-file {
2170     description "Grouping for files needed to be mounted into an additional drive";
2171     list config-file {
2172       description
2173           "List of configuration files to be written on an additional drive";
2174       key "source";
2175       leaf source {
2176         description "Name of the configuration file";
2177         type string;
2178       }
2179       leaf dest {
2180         description "Full path of the destination in the guest";
2181         type string;
2182       }
2183     }
2184   }
2185
2186   grouping supplemental-boot-data {
2187     description "Grouping for custom vim data";
2188     container supplemental-boot-data {
2189 //    uses manotypes:config-file;
2190       leaf boot-data-drive {
2191         description "Some VIMs implement additional drives to host config-files or meta-data";
2192         type boolean;
2193         default false;
2194       }
2195     }
2196   }
2197
2198   grouping volume-info {
2199     description "Grouping for Volume-info";
2200
2201     leaf description {
2202       description "Description for Volume";
2203       type string;
2204     }
2205
2206     leaf size {
2207       description "Size of disk in GB";
2208       type uint64;
2209     }
2210
2211     choice volume-source {
2212       description
2213             "Defines the source of the volume. Possible options are
2214              1. Ephemeral -- Empty disk
2215              2. Image     -- Refer to image to be used for volume
2216              3. Volume    -- Reference of pre-existing volume to be used
2217             ";
2218
2219       case ephemeral {
2220         leaf ephemeral {
2221           type empty;
2222         }
2223       }
2224
2225       case image {
2226         uses image-properties;
2227       }
2228     }
2229
2230     leaf device-bus {
2231       description "Type of disk-bus on which this disk is exposed to guest";
2232       type enumeration {
2233         enum ide;
2234         enum usb;
2235         enum virtio;
2236         enum scsi;
2237       }
2238     }
2239
2240     leaf device-type {
2241       description "The type of device as exposed to guest";
2242       type enumeration {
2243           enum disk;
2244           enum cdrom;
2245           enum floppy;
2246           enum lun;
2247       }
2248     }
2249   }
2250
2251   grouping rpc-project-name {
2252     leaf project-name {
2253       default "default";
2254       description
2255         "Project to which this belongs";
2256       type leafref {
2257         path "/rw-project:project/rw-project:name";
2258       }
2259     }
2260   }
2261 }