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