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