Revert "Revert "Re-enabling NS primitives, config-primitive over service-primitive...
[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:etsi:osm:yang:mano-types";
24   prefix "manotypes";
25
26   import ietf-inet-types {
27     prefix "inet";
28   }
29
30   import osm-project {
31     prefix "osm-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_in_dropped;
696       enum packets_out_dropped;
697     }
698   }
699
700   typedef scaling-trigger {
701     type enumeration {
702       enum pre-scale-in {
703         value 1;
704       }
705       enum post-scale-in {
706         value 2;
707       }
708       enum pre-scale-out {
709         value 3;
710       }
711       enum post-scale-out {
712         value 4;
713       }
714     }
715   }
716
717   typedef scaling-policy-type {
718     type enumeration {
719       enum manual {
720         value 1;
721       }
722       enum automatic {
723         value 2;
724       }
725     }
726   }
727
728   typedef scaling-criteria-operation {
729     type enumeration {
730       enum AND {
731         value 1;
732       }
733       enum OR {
734         value 2;
735       }
736     }
737   }
738
739   grouping vm-flavor {
740     container vm-flavor {
741       leaf vcpu-count {
742         description
743             "Number of VCPUs for the VM.";
744         type uint16;
745       }
746
747       leaf memory-mb {
748         description
749             "Amount of memory in MB.";
750         type uint64;
751       }
752
753       leaf storage-gb {
754         description
755             "Amount of disk space in GB.";
756         type uint64;
757       }
758     }
759   } //grouping vm-flavor
760
761   grouping vm-flavor-name {
762     leaf vm-flavor-name {
763       description "flavor name to be used while creating vm using cloud account";
764       type string;
765     }
766   }
767
768   grouping vswitch-epa {
769     container vswitch-epa {
770       leaf ovs-acceleration {
771         description
772             "Specifies Open vSwitch acceleration mode.
773              MANDATORY: OVS acceleration is required
774              PREFERRED: OVS acceleration is preferred";
775         type enumeration {
776           enum MANDATORY;
777           enum PREFERRED;
778           enum DISABLED;
779         }
780       }
781
782       leaf ovs-offload {
783         description
784             "Specifies Open vSwitch hardware offload mode.
785              MANDATORY: OVS offload is required
786              PREFERRED: OVS offload is preferred";
787         type enumeration {
788           enum MANDATORY;
789           enum PREFERRED;
790           enum DISABLED;
791         }
792       }
793     }
794   }
795
796   grouping hypervisor-epa {
797     container hypervisor-epa {
798       leaf type {
799         description
800             "Specifies the type of hypervisor.
801              KVM: KVM
802              XEN: XEN";
803         type enumeration {
804           enum PREFER_KVM;
805           enum REQUIRE_KVM;
806         }
807       }
808       leaf version {
809         type string;
810       }
811     }
812   }
813
814   grouping host-epa {
815     container host-epa {
816       description "Specifies the host level EPA attributes.";
817       leaf cpu-model {
818         description
819             "Host CPU model. Examples include: SandyBridge,
820              IvyBridge";
821         type enumeration {
822           enum PREFER_WESTMERE;
823           enum REQUIRE_WESTMERE;
824           enum PREFER_SANDYBRIDGE;
825           enum REQUIRE_SANDYBRIDGE;
826           enum PREFER_IVYBRIDGE;
827           enum REQUIRE_IVYBRIDGE;
828           enum PREFER_HASWELL;
829           enum REQUIRE_HASWELL;
830           enum PREFER_BROADWELL;
831           enum REQUIRE_BROADWELL;
832           enum PREFER_NEHALEM;
833           enum REQUIRE_NEHALEM;
834           enum PREFER_PENRYN;
835           enum REQUIRE_PENRYN;
836           enum PREFER_CONROE;
837           enum REQUIRE_CONROE;
838           enum PREFER_CORE2DUO;
839           enum REQUIRE_CORE2DUO;
840         }
841       }
842
843       leaf cpu-arch {
844         description "Host CPU architecture.";
845         type enumeration {
846           enum PREFER_X86;
847           enum REQUIRE_X86;
848           enum PREFER_X86_64;
849           enum REQUIRE_X86_64;
850           enum PREFER_I686;
851           enum REQUIRE_I686;
852           enum PREFER_IA64;
853           enum REQUIRE_IA64;
854           enum PREFER_ARMV7;
855           enum REQUIRE_ARMV7;
856           enum PREFER_ARMV8;
857           enum REQUIRE_ARMV8;
858         }
859       }
860
861       leaf cpu-vendor {
862         description "Host CPU Vendor.";
863         type enumeration {
864           enum PREFER_INTEL;
865           enum REQUIRE_INTEL;
866           enum PREFER_AMD;
867           enum REQUIRE_AMD;
868         }
869       }
870
871       leaf cpu-socket-count {
872         description "Number of sockets on the host.";
873         type uint64;
874       }
875
876       leaf cpu-core-count {
877         description "Number of cores on the host.";
878         type uint64;
879       }
880
881       leaf cpu-core-thread-count {
882         description "Number of threads per cores on the host.";
883         type uint64;
884       }
885
886       list cpu-feature {
887         key "feature";
888         description "List of CPU features.";
889         leaf feature {
890           description "CPU feature.";
891           type cpu-feature-type;
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
912   grouping guest-epa {
913     description "EPA attributes for the guest";
914     container guest-epa {
915       leaf trusted-execution {
916         description "This VM should be allocated from trusted pool";
917         type boolean;
918       }
919
920       leaf mempage-size {
921         description
922             "Memory page allocation size. If a VM requires
923              hugepages, it should choose LARGE or SIZE_2MB
924              or SIZE_1GB. If the VM prefers hugepages it
925              should choose PREFER_LARGE.
926              LARGE        : Require hugepages (either 2MB or 1GB)
927              SMALL        : Doesn't require hugepages
928              SIZE_2MB     : Requires 2MB hugepages
929              SIZE_1GB     : Requires 1GB hugepages
930              PREFER_LARGE : Application prefers hugepages";
931         type enumeration {
932           enum LARGE;
933           enum SMALL;
934           enum SIZE_2MB;
935           enum SIZE_1GB;
936           enum PREFER_LARGE;
937         }
938       }
939
940       choice cpu-policy {
941         case cpu-pinning {
942           leaf cpu-pinning-policy {
943             description
944                 "CPU pinning policy describes association
945                  between virtual CPUs in guest and the
946                  physical CPUs in the host.
947                  DEDICATED : Virtual CPUs are pinned to
948                              physical CPUs
949                  SHARED    : Multiple VMs may share the
950                              same physical CPUs.
951                  ANY       : Any policy is acceptable for the VM";
952             type enumeration {
953               enum DEDICATED;
954               enum SHARED;
955               enum ANY;
956             }
957             default "ANY";
958           }
959           leaf cpu-thread-pinning-policy {
960               description
961                 "CPU thread pinning policy describes how to
962                  place the guest CPUs when the host supports
963                  hyper threads:
964                  AVOID   : Avoids placing a guest on a host
965                            with threads.
966                  SEPARATE: Places vCPUs on separate cores,
967                            and avoids placing two vCPUs on
968                            two threads of same core.
969                  ISOLATE : Places each vCPU on a different core,
970                            and places no vCPUs from a different
971                            guest on the same core.
972                  PREFER  : Attempts to place vCPUs on threads
973                            of the same core.";
974             type enumeration {
975               enum AVOID;
976               enum SEPARATE;
977               enum ISOLATE;
978               enum PREFER;
979             }
980           }
981         }
982
983         case cpu-quota {
984           container cpu-quota {
985               description "CPU quota describes the CPU resource allocation policy.
986                            Limit and Reserve values are defined in MHz";
987               uses allocation-properties;
988           }
989         }
990       }
991
992       container mem-quota {
993           description "Memory quota describes the memory resource allocation policy.
994                        Limit and Reserve values are defined in MB";
995           uses allocation-properties;
996       }
997
998       container disk-io-quota {
999           description "Disk IO quota describes the disk IO operations resource allocation policy.
1000                        Limit and Reserve values are defined in IOPS";
1001           uses allocation-properties;
1002       }
1003
1004       container vif-quota {
1005           description "Virtual interfaces quota describes the virtual interface bandwidth resource allocation policy.
1006                        Limit and Reserve values are defined in Mbps";
1007           uses allocation-properties;
1008       }
1009
1010       list pcie-device {
1011         description
1012             "List of pcie passthrough devices.";
1013         key device-id;
1014         leaf device-id {
1015           description
1016               "Device identifier.";
1017           type string;
1018         }
1019         leaf count {
1020           description
1021               "Number of devices to attach to the VM.";
1022           type uint64;
1023         }
1024       }
1025
1026       choice numa-policy {
1027         case numa-unaware {
1028           leaf numa-unaware {
1029             type empty;
1030           }
1031         }
1032
1033         case numa-aware {
1034           container numa-node-policy {
1035             description
1036                 "This policy defines NUMA topology of the
1037                  guest. Specifically identifies if the guest
1038                  should be run on a host with one NUMA
1039                  node or multiple NUMA nodes. As an example
1040                  a guest might need 8 VCPUs and 4 GB of
1041                  memory. However, it might need the VCPUs
1042                  and memory distributed across multiple
1043                  NUMA nodes. In this scenario, NUMA node
1044                  1 could run with 6 VCPUs and 3GB, and
1045                  NUMA node 2 could run with 2 VCPUs and
1046                  1GB.";
1047
1048             leaf node-cnt {
1049               description
1050                   "The number of NUMA nodes to expose to the VM.";
1051               type uint16;
1052             }
1053
1054             leaf mem-policy {
1055               description
1056                   "This policy specifies how the memory should
1057                    be allocated in a multi-node scenario.
1058                    STRICT    : The memory must be allocated
1059                                strictly from the memory attached
1060                                to the NUMA node.
1061                    PREFERRED : The memory should be allocated
1062                                preferentially from the memory
1063                                attached to the NUMA node";
1064               type enumeration {
1065                 enum STRICT;
1066                 enum PREFERRED;
1067               }
1068             }
1069
1070            list node {
1071               key id;
1072               leaf id {
1073                 description
1074                     "NUMA node identification. Typically
1075                      it's 0 or 1";
1076                 type uint64;
1077               }
1078
1079               list vcpu {
1080                 key "id";
1081                 description
1082                     "List of VCPUs to allocate on
1083                      this NUMA node.";
1084                 leaf id {
1085                   type uint64;
1086                   description "List of VCPUs ids to allocate on
1087                                this NUMA node";
1088                 }
1089               }
1090
1091               leaf memory-mb {
1092                 description
1093                     "Memory size expressed in MB
1094                      for this NUMA node.";
1095                 type uint64;
1096               }
1097
1098               choice om-numa-type {
1099                 description
1100                     "OpenMANO Numa type selection";
1101
1102                 case cores {
1103                   leaf num-cores {
1104                     type uint8;
1105                   }
1106                 }
1107
1108                 case paired-threads {
1109                   container paired-threads {
1110                     leaf num-paired-threads {
1111                       type uint8;
1112                     }
1113
1114                     list paired-thread-ids {
1115                       description
1116                           "List of thread pairs to use in case of paired-thread NUMA";
1117                       max-elements 16;
1118                       key thread-a;
1119
1120                       leaf thread-a {
1121                           type uint8;
1122                       }
1123
1124                       leaf thread-b {
1125                           type uint8;
1126                       }
1127                     }
1128                   }
1129                 }
1130                 case threads {
1131                   leaf num-threads {
1132                     type uint8;
1133                   }
1134                 }
1135               }
1136             }
1137
1138           }
1139         }
1140       }
1141     }
1142   }
1143
1144   grouping allocation-properties {
1145     leaf limit {
1146       description "Defines the maximum allocation. The value 0 indicates that usage is not limited.
1147                    This parameter ensures that the instance never uses more than the defined amount of resource.";
1148       type uint64;
1149     }
1150
1151     leaf reserve {
1152       description "Defines the guaranteed minimum reservation.
1153                    If needed, the machine will definitely get allocated the reserved amount of resources.";
1154       type uint64;
1155     }
1156
1157     leaf shares {
1158       description "Number of shares allocated.
1159                    Specifies the proportional weighted share for the domain.
1160                    If this element is omitted, the service defaults to the OS provided defaults";
1161       type uint64;
1162     }
1163   }
1164
1165   grouping provider-network {
1166     container provider-network {
1167       description "Container for the provider network.";
1168       leaf physical-network {
1169         description
1170             "Name of the physical network on which the provider
1171              network is built.";
1172         type string;
1173       }
1174
1175       leaf segmentation_id {
1176         description
1177             "ID of segregated virtual networks";
1178             type uint32;
1179       }
1180     }
1181   }
1182
1183   grouping http-endpoints {
1184     list http-endpoint {
1185       description
1186           "List of http endpoints to be used by monitoring params";
1187       key path;
1188
1189       leaf path {
1190         description "The HTTP path on the management server";
1191         type string;
1192       }
1193
1194       leaf https {
1195         description "Pick HTTPS instead of HTTP , Default is false";
1196         type boolean;
1197         default "false";
1198       }
1199
1200       leaf port {
1201         description "The HTTP port to connect to";
1202         type inet:port-number;
1203       }
1204
1205       leaf username {
1206         description "The HTTP basic auth username";
1207         type string;
1208       }
1209
1210       leaf password {
1211         description "The HTTP basic auth password";
1212         type string;
1213       }
1214
1215       leaf polling-interval-secs {
1216         description "The HTTP polling interval in seconds";
1217         type uint8;
1218         default 2;
1219       }
1220
1221       leaf method {
1222         description
1223           "Method that the URI should perform.
1224            Deafult action is GET.";
1225
1226         type manotypes:http-method;
1227         default "GET";
1228       }
1229
1230       list headers {
1231         description "Custom HTTP headers to put on HTTP request";
1232         key key;
1233         leaf key{
1234           description "HTTP header key";
1235           type string;
1236         }
1237
1238         leaf value{
1239           description "HTTP header value";
1240           type string;
1241         }
1242       }
1243     }
1244   }
1245
1246   grouping monitoring-param-aggregation {
1247     typedef aggregation-type {
1248       description
1249           "aggregation-type, indicates the way to aggregate monitoring-params
1250           (e.g. how to aggregate CPU utilisation of all VNFs belonging to the
1251           same VNF group identified by member-vnf-index; or how to aggregate
1252           memory utilisation of all VDUs belonging to the same VDU group
1253           identified by vdu id)";
1254       type enumeration {
1255         enum AVERAGE;
1256         enum MINIMUM;
1257         enum MAXIMUM;
1258         enum COUNT;
1259         enum SUM;
1260       }
1261     }
1262
1263     leaf aggregation-type {
1264       type aggregation-type;
1265     }
1266   }
1267
1268   grouping monitoring-param-ui-data {
1269       leaf description {
1270         type string;
1271       }
1272
1273       leaf group-tag {
1274         description "A tag to group monitoring parameters";
1275         type string;
1276       }
1277
1278
1279       leaf widget-type {
1280         description "Defines the UI Display variant of measured counters.";
1281         type manotypes:widget-type;
1282         default "COUNTER";
1283       }
1284
1285       leaf units {
1286         description "Measured Counter Units (e.g., Packets, Kbps, Mbps, etc.)";
1287         type string;
1288       }
1289   }
1290
1291   grouping monitoring-param-value {
1292       leaf value-type {
1293         type param-value-type;
1294         default "INT";
1295       }
1296
1297       container numeric-constraints {
1298         leaf min-value {
1299           description
1300               "Minimum value for the parameter";
1301           type uint64;
1302         }
1303         leaf max-value {
1304           description
1305               "Maximum value for the parameter";
1306           type uint64;
1307         }
1308       }
1309
1310       container text-constraints {
1311         leaf min-length {
1312           description
1313               "Minimum string length for the parameter";
1314           type uint8;
1315         }
1316         leaf max-length {
1317           description
1318               "Maximum string length for the parameter";
1319           type uint8;
1320         }
1321       }
1322
1323       leaf value-integer {
1324         description
1325             "Current value for an integer parameter";
1326         type int64;
1327       }
1328
1329       leaf value-decimal {
1330         description
1331             "Current value for a decimal parameter";
1332         type decimal64 {
1333           fraction-digits 4;
1334         }
1335       }
1336
1337       leaf value-string {
1338         description
1339             "Current value for a string parameter";
1340         type string;
1341       }
1342   }
1343
1344   grouping control-param {
1345     list control-param {
1346       description
1347           "List of control parameters to manage and
1348            update the running configuration of the VNF";
1349       key id;
1350
1351       leaf id {
1352         description "Identifier for control parameter";
1353         type string;
1354       }
1355
1356       leaf name {
1357         description "Name of a control parameter";
1358         type string;
1359       }
1360
1361       leaf description {
1362         description "A description of the control parameter";
1363         type string;
1364       }
1365
1366       leaf group-tag {
1367         description "A tag to group control parameters";
1368         type string;
1369       }
1370
1371       leaf min-value {
1372         description
1373             "Minimum value for the parameter";
1374         type uint64;
1375       }
1376
1377       leaf max-value {
1378         description
1379             "Maximum value for the parameter";
1380         type uint64;
1381       }
1382
1383       leaf current-value {
1384         description
1385             "Current value for the parameter";
1386         type uint64;
1387       }
1388
1389       leaf step-value {
1390         description
1391             "Step value for the parameter";
1392         type uint64;
1393       }
1394
1395       leaf units {
1396         type string;
1397       }
1398
1399       leaf widget-type {
1400         type manotypes:widget-type;
1401       }
1402
1403       leaf url {
1404         description
1405           "This is the URL where the operation should be performed.";
1406
1407         type inet:uri;
1408       }
1409
1410       leaf method {
1411         description
1412           "Method that the URI should perform.
1413            Default Action is POST";
1414
1415         type manotypes:http-method;
1416         default "POST";
1417       }
1418
1419       leaf payload {
1420         description
1421           "This is the operation payload or payload template as stringified
1422            JSON. This field provides the data  to be sent for this operation
1423            call";
1424
1425         type string;
1426       }
1427     }
1428   }
1429
1430   grouping action-param {
1431     list action-param {
1432       description
1433           "List of action parameters to
1434            control VNF";
1435       key id;
1436       leaf id {
1437         type string;
1438       }
1439
1440       leaf name {
1441         type string;
1442       }
1443
1444       leaf description {
1445         type string;
1446       }
1447
1448       leaf group-tag {
1449         description "A tag to group monitoring parameter";
1450         type string;
1451       }
1452
1453       leaf url {
1454         description
1455           "This is the URL where to perform the operation";
1456         type inet:uri;
1457       }
1458
1459       leaf method {
1460         description
1461           "This is the method to be performed at the uri.
1462            POST by default for action";
1463
1464         type manotypes:http-method;
1465         default "POST";
1466       }
1467
1468       leaf payload {
1469         description
1470           "This is the operation payload or payload template to be sent in
1471            the data for this operation call";
1472
1473         type string;
1474       }
1475     }
1476   }
1477
1478   grouping input-parameter {
1479     description "List of input parameters that can be specified when instantiating a network service.";
1480
1481     list input-parameter {
1482       description
1483           "List of input parameters";
1484
1485       key xpath;
1486
1487
1488       leaf xpath {
1489         description
1490           "An xpath that specfies which element in a descriptor is to be
1491           modified.";
1492         type string;
1493       }
1494
1495       leaf value {
1496         description
1497           "The value that the element specified by the xpath should take when a
1498           record is created.";
1499         type string;
1500       }
1501     }
1502   }
1503
1504   grouping input-parameter-xpath {
1505     list input-parameter-xpath {
1506       description
1507           "List of xpaths to parameters inside the NSD
1508            the can be customized during the instantiation.";
1509
1510       key "xpath";
1511       leaf xpath {
1512         description
1513             "An xpath that specifies the element in a descriptor.";
1514         type string;
1515       }
1516
1517       leaf label {
1518         description "A descriptive string";
1519         type string;
1520       }
1521
1522       leaf default-value {
1523         description "Default Value for the Input Parameter";
1524         type string;
1525       }
1526     }
1527   }
1528
1529   grouping nfvi-metrics {
1530     container vcpu {
1531       leaf label {
1532         description
1533           "Label to show in UI";
1534         type string;
1535         default "VCPU";
1536       }
1537
1538       leaf total {
1539         description
1540           "The total number of VCPUs available.";
1541         type uint64;
1542       }
1543
1544       leaf utilization {
1545         description
1546           "The VCPU utilization (percentage).";
1547         type decimal64 {
1548           fraction-digits 2;
1549           range "0 .. 100";
1550         }
1551       }
1552     }
1553
1554     container memory {
1555       leaf label {
1556         description
1557           "Label to show in UI";
1558         type string;
1559         default "MEMORY";
1560       }
1561
1562       leaf used {
1563         description
1564           "The amount of memory (bytes) currently in use.";
1565         type uint64;
1566       }
1567
1568       leaf total {
1569         description
1570           "The amount of memory (bytes) available.";
1571         type uint64;
1572       }
1573
1574       leaf utilization {
1575         description
1576           "The memory utilization (percentage).";
1577         type decimal64 {
1578           fraction-digits 2;
1579           range "0 .. 100";
1580         }
1581       }
1582     }
1583
1584     container storage {
1585       leaf label {
1586         description
1587           "Label to show in UI";
1588         type string;
1589         default "STORAGE";
1590       }
1591
1592       leaf used {
1593         description
1594           "The amount of storage (bytes) currently in use.";
1595         type uint64;
1596       }
1597
1598       leaf total {
1599         description
1600           "The amount of storage (bytes) available.";
1601         type uint64;
1602       }
1603
1604       leaf utilization {
1605         description
1606           "The storage utilization (percentage).";
1607         type decimal64 {
1608           fraction-digits 2;
1609           range "0 .. 100";
1610         }
1611       }
1612     }
1613
1614     container external-ports {
1615       leaf label {
1616         description
1617           "Label to show in UI";
1618         type string;
1619         default "EXTERNAL PORTS";
1620       }
1621
1622       leaf total {
1623         description
1624           "The total number of external ports.";
1625         type uint64;
1626       }
1627     }
1628
1629     container internal-ports {
1630       leaf label {
1631         description
1632           "Label to show in UI";
1633         type string;
1634         default "INTERNAL PORTS";
1635       }
1636
1637       leaf total {
1638         description
1639           "The total number of internal ports.";
1640         type uint64;
1641       }
1642     }
1643
1644     container network {
1645       leaf label {
1646         description
1647           "Label to show in UI";
1648         type string;
1649         default "NETWORK TRAFFIC";
1650       }
1651
1652       container incoming {
1653         leaf label {
1654           description
1655             "Label to show in UI";
1656           type string;
1657           default "INCOMING NETWORK TRAFFIC";
1658         }
1659
1660         leaf bytes {
1661           description
1662             "The cumulative number of incoming bytes.";
1663           type uint64;
1664         }
1665
1666         leaf packets {
1667           description
1668             "The cumulative number of incoming packets.";
1669           type uint64;
1670         }
1671
1672         leaf byte-rate {
1673           description
1674             "The current incoming byte-rate (bytes per second).";
1675           type decimal64 {
1676             fraction-digits 2;
1677           }
1678         }
1679
1680         leaf packet-rate {
1681           description
1682             "The current incoming packet (packets per second).";
1683           type decimal64 {
1684             fraction-digits 2;
1685           }
1686         }
1687       }
1688
1689       container outgoing {
1690         leaf label {
1691           description
1692             "Label to show in UI";
1693           type string;
1694           default "OUTGOING NETWORK TRAFFIC";
1695         }
1696
1697         leaf bytes {
1698           description
1699             "The cumulative number of outgoing bytes.";
1700           type uint64;
1701         }
1702
1703         leaf packets {
1704           description
1705             "The cumulative number of outgoing packets.";
1706           type uint64;
1707         }
1708
1709         leaf byte-rate {
1710           description
1711             "The current outgoing byte-rate (bytes per second).";
1712           type decimal64 {
1713             fraction-digits 2;
1714           }
1715         }
1716
1717         leaf packet-rate {
1718           description
1719             "The current outgoing packet (packets per second).";
1720           type decimal64 {
1721             fraction-digits 2;
1722           }
1723         }
1724       }
1725     }
1726   }
1727
1728   typedef alarm-severity-type {
1729     description "An indication of the importance or urgency of the alarm";
1730     type enumeration {
1731       enum LOW;
1732       enum MODERATE;
1733       enum CRITICAL;
1734     }
1735   }
1736
1737   typedef alarm-metric-type {
1738     description "The type of metrics to register the alarm for";
1739     type enumeration {
1740       enum CPU_UTILIZATION;
1741       enum MEMORY_UTILIZATION;
1742       enum STORAGE_UTILIZATION;
1743     }
1744   }
1745
1746   typedef alarm-statistic-type {
1747     description
1748         "Statistic type to use to determine threshold crossing
1749          for an alarm.";
1750     type enumeration {
1751       enum AVERAGE;
1752       enum MINIMUM;
1753       enum MAXIMUM;
1754       enum COUNT;
1755       enum SUM;
1756     }
1757   }
1758
1759   typedef relational-operation-type {
1760     description
1761         "The relational operator used to define whether an alarm,
1762         scaling event, etc. should be triggered in certain scenarios,
1763         such as if the metric statistic goes above or below a specified
1764         value.";
1765     type enumeration {
1766       enum GE; // greater than or equal
1767       enum LE; // less than or equal
1768       enum GT; // greater than
1769       enum LT; // less than
1770       enum EQ; // equal
1771     }
1772   }
1773
1774   grouping alarm-properties {
1775     leaf name {
1776       description "A human readable string to identify the alarm";
1777       type string;
1778     }
1779
1780     leaf description {
1781       description "A description of this alarm";
1782       type string;
1783     }
1784
1785     leaf vdur-id {
1786       description
1787           "The identifier of the VDUR that the alarm is associated with";
1788       type string;
1789     }
1790
1791     container actions {
1792       list ok {
1793         key "url";
1794         leaf url {
1795           type string;
1796         }
1797       }
1798
1799       list insufficient-data {
1800         key "url";
1801         leaf url {
1802           type string;
1803         }
1804       }
1805
1806       list alarm {
1807         key "url";
1808         leaf url {
1809           type string;
1810         }
1811       }
1812     }
1813
1814     leaf repeat {
1815       description
1816           "This flag indicates whether the alarm should be repeatedly emitted
1817           while the associated threshold has been crossed.";
1818
1819       type boolean;
1820       default true;
1821     }
1822
1823     leaf enabled {
1824       description
1825           "This flag indicates whether the alarm has been enabled or
1826           disabled.";
1827
1828       type boolean;
1829       default true;
1830     }
1831
1832     leaf severity {
1833       description "A measure of the importance or urgency of the alarm";
1834       type alarm-severity-type;
1835     }
1836
1837     leaf statistic {
1838       description "The type of metric statistic that is tracked by this alarm";
1839       type alarm-statistic-type;
1840     }
1841
1842     leaf operation {
1843       description
1844           "The relational operator used to define whether an alarm should be
1845            triggered in certain scenarios, such as if the metric statistic
1846            goes above or below a specified value.";
1847       type relational-operation-type;
1848     }
1849
1850     leaf value {
1851       description
1852           "This value defines the threshold that, if crossed, will trigger
1853           the alarm.";
1854       type decimal64 {
1855         fraction-digits 4;
1856       }
1857     }
1858
1859     leaf period {
1860       description
1861           "The period defines the length of time (seconds) that the metric
1862           data are collected over in oreder to evaluate the chosen
1863           statistic.";
1864       type uint32;
1865     }
1866
1867     leaf evaluations {
1868       description
1869           "Defines the length of time (seconds) in which metric data are
1870            collected in order to evaluate the chosen statistic.";
1871       type uint32;
1872     }
1873   }
1874
1875   typedef cloud-account-type {
1876     description "VIM account type";
1877     type enumeration {
1878       enum aws;
1879       enum cloudsim;
1880       enum cloudsim_proxy;
1881       enum mock;
1882       enum openmano;
1883       enum openstack;
1884       enum vsphere;
1885       enum openvim;
1886     }
1887   }
1888
1889   grouping host-aggregate {
1890     list host-aggregate {
1891       description "Name of the Host Aggregate";
1892       key "metadata-key";
1893
1894       leaf metadata-key {
1895         description
1896             "Name of the additional information attached to the host-aggregate";
1897         type string;
1898       }
1899       leaf metadata-value {
1900         description
1901             "Value of the corresponding metadata-key";
1902         type string;
1903       }
1904     }
1905   }
1906
1907   grouping placement-group-input {
1908     leaf cloud-type {
1909       type manotypes:cloud-account-type;
1910     }
1911     choice cloud-provider {
1912       case openstack {
1913         container availability-zone {
1914           description "Name of the Availability Zone";
1915           leaf name {
1916             type string;
1917           }
1918         }
1919         container server-group {
1920           description "Name of the Affinity/Anti-Affinity Server Group";
1921           leaf name {
1922             type string;
1923           }
1924         }
1925         uses host-aggregate;
1926       }
1927       case aws {
1928         leaf aws-construct {
1929           type empty;
1930         }
1931       }
1932       case openmano {
1933         leaf openmano-construct {
1934           type empty;
1935         }
1936       }
1937       case vsphere {
1938         leaf vsphere-construct {
1939           type empty;
1940         }
1941       }
1942       case mock {
1943         leaf mock-construct {
1944           type empty;
1945         }
1946       }
1947       case cloudsim {
1948         leaf cloudsim-construct {
1949           type empty;
1950         }
1951       }
1952     }
1953   }
1954
1955   grouping cloud-config {
1956     list key-pair {
1957       key "name";
1958       description "Used to configure the list of public keys to be injected as part
1959           of ns instantiation";
1960
1961       leaf name {
1962         description "Name of this key pair";
1963         type string;
1964       }
1965
1966       leaf key {
1967         description "Key associated with this key pair";
1968         type string;
1969       }
1970     }
1971
1972     list user {
1973       key "name";
1974       description "List of users to be added through cloud-config";
1975
1976       leaf name {
1977         description "Name of the user ";
1978         type string;
1979       }
1980
1981       leaf user-info {
1982         description "The user name's real name";
1983         type string;
1984       }
1985
1986       list key-pair {
1987         key "name";
1988         description "Used to configure the list of public keys to be injected as part
1989             of ns instantiation";
1990
1991         leaf name {
1992           description "Name of this key pair";
1993           type string;
1994         }
1995
1996         leaf key {
1997           description "Key associated with this key pair";
1998           type string;
1999         }
2000       }
2001     }
2002   }
2003
2004   grouping placement-group-info {
2005     description "";
2006
2007     leaf name {
2008       description
2009           "Place group construct to define the compute resource placement strategy
2010            in cloud environment";
2011       type string;
2012     }
2013
2014     leaf requirement {
2015       description "This is free text space used to describe the intent/rationale
2016                    behind this placement group. This is for human consumption only";
2017       type string;
2018     }
2019
2020     leaf strategy {
2021       description
2022           "Strategy associated with this placement group
2023              Following values are possible
2024                - COLOCATION: Colocation strategy imply intent to share the physical
2025                              infrastructure (hypervisor/network) among all members
2026                              of this group.
2027                - ISOLATION: Isolation strategy imply intent to not share the physical
2028                             infrastructure (hypervisor/network) among the members
2029                             of this group.
2030              ";
2031       type enumeration {
2032         enum COLOCATION;
2033         enum ISOLATION;
2034       }
2035       default "COLOCATION";
2036     }
2037   }
2038
2039   grouping ip-profile-info {
2040     description "Grouping for IP-Profile";
2041     container ip-profile-params {
2042
2043       leaf ip-version {
2044         type inet:ip-version;
2045         default ipv4;
2046       }
2047
2048       leaf subnet-address {
2049         description "Subnet IP prefix associated with IP Profile";
2050         type inet:ip-prefix;
2051       }
2052
2053       leaf gateway-address {
2054         description "IP Address of the default gateway associated with IP Profile";
2055         type inet:ip-address;
2056       }
2057
2058       leaf security-group {
2059         description "Name of the security group";
2060         type string;
2061       }
2062
2063       list dns-server {
2064         key "address";
2065         leaf address {
2066           description "List of DNS Servers associated with IP Profile";
2067           type inet:ip-address;
2068         }
2069       }
2070
2071       container dhcp-params {
2072         leaf enabled {
2073           description "This flag indicates if DHCP is enabled or not";
2074           type boolean;
2075           default true;
2076         }
2077
2078         leaf start-address {
2079           description "Start IP address of the IP-Address range associated with DHCP domain";
2080           type inet:ip-address;
2081         }
2082
2083         leaf count {
2084           description "Size of the DHCP pool associated with DHCP domain";
2085           type uint32;
2086         }
2087       }
2088
2089       leaf subnet-prefix-pool {
2090         description "VIM Specific reference to pre-created subnet prefix";
2091         type string;
2092       }
2093     }
2094   }
2095
2096   grouping ip-profile-list {
2097     list ip-profiles {
2098       description
2099           "List of IP Profiles.
2100              IP Profile describes the IP characteristics for the Virtual-Link";
2101
2102       key "name";
2103
2104       leaf name {
2105         description "Name of the IP-Profile";
2106         type string;
2107       }
2108
2109       leaf description {
2110         description "Description for IP profile";
2111         type string;
2112       }
2113
2114       uses ip-profile-info;
2115     }
2116   }
2117
2118   grouping config-file {
2119     description "Grouping for files needed to be mounted into an additional drive";
2120     list config-file {
2121       description
2122           "List of configuration files to be written on an additional drive";
2123       key "source";
2124       leaf source {
2125         description "Name of the configuration file";
2126         type string;
2127       }
2128       leaf dest {
2129         description "Full path of the destination in the guest";
2130         type string;
2131       }
2132     }
2133   }
2134
2135   grouping supplemental-boot-data {
2136     description "Grouping for custom vim data";
2137     container supplemental-boot-data {
2138 //    uses manotypes:config-file;
2139       leaf boot-data-drive {
2140         description "Some VIMs implement additional drives to host config-files or meta-data";
2141         type boolean;
2142         default false;
2143       }
2144     }
2145   }
2146
2147   grouping volume-info {
2148     description "Grouping for Volume-info";
2149
2150     leaf description {
2151       description "Description for Volume";
2152       type string;
2153     }
2154
2155     leaf size {
2156       description "Size of disk in GB";
2157       type uint64;
2158     }
2159
2160     choice volume-source {
2161       description
2162             "Defines the source of the volume. Possible options are
2163              1. Ephemeral -- Empty disk
2164              2. Image     -- Refer to image to be used for volume
2165              3. Volume    -- Reference of pre-existing volume to be used
2166             ";
2167
2168       case ephemeral {
2169         leaf ephemeral {
2170           type empty;
2171         }
2172       }
2173
2174       case image {
2175         uses image-properties;
2176       }
2177     }
2178
2179     leaf device-bus {
2180       description "Type of disk-bus on which this disk is exposed to guest";
2181       type enumeration {
2182         enum ide;
2183         enum usb;
2184         enum virtio;
2185         enum scsi;
2186       }
2187     }
2188
2189     leaf device-type {
2190       description "The type of device as exposed to guest";
2191       type enumeration {
2192           enum disk;
2193           enum cdrom;
2194           enum floppy;
2195           enum lun;
2196       }
2197     }
2198   }
2199
2200   grouping rpc-project-name {
2201     leaf project-name {
2202       default "default";
2203       description
2204         "Project to which this belongs";
2205       type leafref {
2206         path "/osm-project:project/osm-project:name";
2207       }
2208     }
2209   }
2210 }