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