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