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