3fd0da213a12e659455794396d0839a874b45824
[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         type leafref {
1204           path "../../http-endpoint/path";
1205         }
1206       }
1207
1208       leaf json-query-method {
1209         type json-query-method;
1210         default "NAMEKEY";
1211       }
1212
1213       container json-query-params {
1214         leaf json-path {
1215           description
1216             "The jsonpath to use to extract value from JSON structure";
1217           type string;
1218         }
1219         leaf object-path {
1220           description
1221             "The objectpath to use to extract value from JSON structure";
1222           type string;
1223         }
1224       }
1225
1226       uses monitoring-param-ui-data;
1227       uses monitoring-param-value;
1228
1229     }
1230   }
1231
1232   grouping monitoring-param-aggregation {
1233     typedef aggregation-type {
1234       description "aggregation-type";
1235       type enumeration {
1236         enum AVERAGE;
1237         enum MINIMUM;
1238         enum MAXIMUM;
1239         enum COUNT;
1240         enum SUM;
1241       }
1242     }
1243
1244     leaf aggregation-type {
1245       type aggregation-type;
1246     }
1247   }
1248
1249   grouping monitoring-param-ui-data {
1250       leaf description {
1251         type string;
1252       }
1253
1254       leaf group-tag {
1255         description "A simple tag to group monitoring parameters";
1256         type string;
1257       }
1258
1259
1260       leaf widget-type {
1261         type manotypes:widget-type;
1262       }
1263
1264       leaf units {
1265         type string;
1266       }
1267   }
1268
1269   grouping monitoring-param-value {
1270       leaf value-type {
1271         type param-value-type;
1272         default "INT";
1273       }
1274
1275       container numeric-constraints {
1276         leaf min-value {
1277           description
1278               "Minimum value for the parameter";
1279           type uint64;
1280         }
1281         leaf max-value {
1282           description
1283               "Maxium value for the parameter";
1284           type uint64;
1285         }
1286       }
1287
1288       container text-constraints {
1289         leaf min-length {
1290           description
1291               "Minimum string length for the parameter";
1292           type uint8;
1293         }
1294         leaf max-length {
1295           description
1296               "Maximum string length for the parameter";
1297           type uint8;
1298         }
1299       }
1300
1301       leaf value-integer {
1302         description
1303             "Current value for an integer parameter";
1304         type int64;
1305       }
1306
1307       leaf value-decimal {
1308         description
1309             "Current value for a decimal parameter";
1310         type decimal64 {
1311           fraction-digits 4;
1312         }
1313       }
1314
1315       leaf value-string {
1316         description
1317             "Current value for a string parameter";
1318         type string;
1319       }
1320   }
1321
1322   grouping control-param {
1323     list control-param {
1324       description
1325           "List of control parameters to manage and
1326            update the running configuration of the VNF";
1327       key id;
1328
1329       leaf id {
1330         type string;
1331       }
1332
1333       leaf name {
1334         type string;
1335       }
1336
1337       leaf description {
1338         type string;
1339       }
1340
1341       leaf group-tag {
1342         description "A simple tag to group control parameters";
1343         type string;
1344       }
1345
1346       leaf min-value {
1347         description
1348             "Minimum value for the parameter";
1349         type uint64;
1350       }
1351
1352       leaf max-value {
1353         description
1354             "Maxium value for the parameter";
1355         type uint64;
1356       }
1357
1358       leaf current-value {
1359         description
1360             "Current value for the parameter";
1361         type uint64;
1362       }
1363
1364       leaf step-value {
1365         description
1366             "Step value for the parameter";
1367         type uint64;
1368       }
1369
1370       leaf units {
1371         type string;
1372       }
1373
1374       leaf widget-type {
1375         type manotypes:widget-type;
1376       }
1377
1378       leaf url {
1379         description
1380           "This is the URL where to perform the operation";
1381
1382         type inet:uri;
1383       }
1384
1385       leaf method {
1386         description
1387           "This is the method to be performed at the uri.
1388            POST by default for action";
1389
1390         type manotypes:http-method;
1391         default "POST";
1392       }
1393
1394       leaf payload {
1395         description
1396           "This is the operation payload or payload template as stringified
1397            JSON. This field provides the data  to be sent for this operation
1398            call";
1399
1400         type string;
1401       }
1402     }
1403   }
1404
1405   grouping action-param {
1406     list action-param {
1407       description
1408           "List of action parameters to
1409            control VNF";
1410       key id;
1411       leaf id {
1412         type string;
1413       }
1414
1415       leaf name {
1416         type string;
1417       }
1418
1419       leaf description {
1420         type string;
1421       }
1422
1423       leaf group-tag {
1424         description "A simple tag to group monitoring parameter";
1425         type string;
1426       }
1427
1428       leaf url {
1429         description
1430           "This is the URL where to perform the operation";
1431         type inet:uri;
1432       }
1433
1434       leaf method {
1435         description
1436           "This is the method to be performed at the uri.
1437            POST by default for action";
1438
1439         type manotypes:http-method;
1440         default "POST";
1441       }
1442
1443       leaf payload {
1444         description
1445           "This is the operation payload or payload template to be sent in
1446            the data for this operation call";
1447
1448         type string;
1449       }
1450     }
1451   }
1452
1453   grouping input-parameter {
1454     description "";
1455
1456     list input-parameter {
1457       description
1458           "List of input parameters";
1459
1460       key xpath;
1461
1462
1463       leaf xpath {
1464         description
1465           "A an xpath that specfies which element in a descriptor is to be
1466           modified.";
1467         type string;
1468       }
1469
1470       leaf value {
1471         description
1472           "The value that the element specified by the xpath should take when a
1473           record is created.";
1474         type string;
1475       }
1476     }
1477   }
1478
1479   grouping input-parameter-xpath {
1480     list input-parameter-xpath {
1481       description
1482           "List of xpaths to parameters inside the NSD
1483            the can be customized during the instantiation.";
1484
1485       key "xpath";
1486       leaf xpath {
1487         description
1488             "An xpath that specifies the element in a descriptor.";
1489         type string;
1490       }
1491
1492       leaf label {
1493         description "A descriptive string";
1494         type string;
1495       }
1496
1497       leaf default-value {
1498         description " A default value for this input parameter";
1499         type string;
1500       }
1501     }
1502   }
1503
1504   grouping nfvi-metrics {
1505     container vcpu {
1506       leaf label {
1507         description
1508           "Label to show in UI";
1509         type string;
1510         default "VCPU";
1511       }
1512
1513       leaf total {
1514         description
1515           "The total number of VCPUs available.";
1516         type uint64;
1517       }
1518
1519       leaf utilization {
1520         description
1521           "The VCPU utilization (percentage).";
1522         type decimal64 {
1523           fraction-digits 2;
1524           range "0 .. 100";
1525         }
1526       }
1527     }
1528
1529     container memory {
1530       leaf label {
1531         description
1532           "Label to show in UI";
1533         type string;
1534         default "MEMORY";
1535       }
1536
1537       leaf used {
1538         description
1539           "The amount of memory (bytes) currently in use.";
1540         type uint64;
1541       }
1542
1543       leaf total {
1544         description
1545           "The amount of memory (bytes) available.";
1546         type uint64;
1547       }
1548
1549       leaf utilization {
1550         description
1551           "The memory utilization (percentage).";
1552         type decimal64 {
1553           fraction-digits 2;
1554           range "0 .. 100";
1555         }
1556       }
1557     }
1558
1559     container storage {
1560       leaf label {
1561         description
1562           "Label to show in UI";
1563         type string;
1564         default "STORAGE";
1565       }
1566
1567       leaf used {
1568         description
1569           "The amount of storage (bytes) currently in use.";
1570         type uint64;
1571       }
1572
1573       leaf total {
1574         description
1575           "The amount of storage (bytes) available.";
1576         type uint64;
1577       }
1578
1579       leaf utilization {
1580         description
1581           "The storage utilization (percentage).";
1582         type decimal64 {
1583           fraction-digits 2;
1584           range "0 .. 100";
1585         }
1586       }
1587     }
1588
1589     container external-ports {
1590       leaf label {
1591         description
1592           "Label to show in UI";
1593         type string;
1594         default "EXTERNAL PORTS";
1595       }
1596
1597       leaf total {
1598         description
1599           "The total number of external ports.";
1600         type uint64;
1601       }
1602     }
1603
1604     container internal-ports {
1605       leaf label {
1606         description
1607           "Label to show in UI";
1608         type string;
1609         default "INTERNAL PORTS";
1610       }
1611
1612       leaf total {
1613         description
1614           "The total number of internal ports.";
1615         type uint64;
1616       }
1617     }
1618
1619     container network {
1620       leaf label {
1621         description
1622           "Label to show in UI";
1623         type string;
1624         default "NETWORK TRAFFIC";
1625       }
1626
1627       container incoming {
1628         leaf label {
1629           description
1630             "Label to show in UI";
1631           type string;
1632           default "INCOMING NETWORK TRAFFIC";
1633         }
1634
1635         leaf bytes {
1636           description
1637             "The cumulative number of incoming bytes.";
1638           type uint64;
1639         }
1640
1641         leaf packets {
1642           description
1643             "The cumulative number of incoming packets.";
1644           type uint64;
1645         }
1646
1647         leaf byte-rate {
1648           description
1649             "The current incoming byte-rate (bytes per second).";
1650           type decimal64 {
1651             fraction-digits 2;
1652           }
1653         }
1654
1655         leaf packet-rate {
1656           description
1657             "The current incoming packet (packets per second).";
1658           type decimal64 {
1659             fraction-digits 2;
1660           }
1661         }
1662       }
1663
1664       container outgoing {
1665         leaf label {
1666           description
1667             "Label to show in UI";
1668           type string;
1669           default "OUTGOING NETWORK TRAFFIC";
1670         }
1671
1672         leaf bytes {
1673           description
1674             "The cumulative number of outgoing bytes.";
1675           type uint64;
1676         }
1677
1678         leaf packets {
1679           description
1680             "The cumulative number of outgoing packets.";
1681           type uint64;
1682         }
1683
1684         leaf byte-rate {
1685           description
1686             "The current outgoing byte-rate (bytes per second).";
1687           type decimal64 {
1688             fraction-digits 2;
1689           }
1690         }
1691
1692         leaf packet-rate {
1693           description
1694             "The current outgoing packet (packets per second).";
1695           type decimal64 {
1696             fraction-digits 2;
1697           }
1698         }
1699       }
1700     }
1701   }
1702
1703   typedef alarm-severity-type {
1704     description "An indication of the importance or ugency of the alarm";
1705     type enumeration {
1706       enum LOW;
1707       enum MODERATE;
1708       enum CRITICAL;
1709     }
1710   }
1711
1712   typedef alarm-metric-type {
1713     description "The type of metrics to register the alarm for";
1714     type enumeration {
1715       enum CPU_UTILIZATION;
1716       enum MEMORY_UTILIZATION;
1717       enum STORAGE_UTILIZATION;
1718     }
1719   }
1720
1721   typedef alarm-statistic-type {
1722     description
1723         "The type of statistic to used to measure a metric to determine
1724         threshold crossing for an alarm.";
1725     type enumeration {
1726       enum AVERAGE;
1727       enum MINIMUM;
1728       enum MAXIMUM;
1729       enum COUNT;
1730       enum SUM;
1731     }
1732   }
1733
1734   typedef alarm-operation-type {
1735     description
1736         "The relational operator used to define whether an alarm should be
1737         triggered when, say, the metric statistic goes above or below a
1738         specified value.";
1739     type enumeration {
1740       enum GE; // greater than or equal
1741       enum LE; // less than or equal
1742       enum GT; // greater than
1743       enum LT; // less than
1744       enum EQ; // equal
1745     }
1746   }
1747
1748   grouping alarm {
1749     leaf alarm-id {
1750       description
1751           "This field is reserved for the identifier assigned by the cloud
1752           provider";
1753
1754       type string;
1755     }
1756
1757     leaf name {
1758       description "A human readable string to identify the alarm";
1759       type string;
1760     }
1761
1762     leaf description {
1763       description "A string containing a description of this alarm";
1764       type string;
1765     }
1766
1767     leaf vdur-id {
1768       description
1769           "The identifier of the VDUR that the alarm is associated with";
1770       type string;
1771     }
1772
1773     container actions {
1774       list ok {
1775         key "url";
1776         leaf url {
1777           type string;
1778         }
1779       }
1780
1781       list insufficient-data {
1782         key "url";
1783         leaf url {
1784           type string;
1785         }
1786       }
1787
1788       list alarm {
1789         key "url";
1790         leaf url {
1791           type string;
1792         }
1793       }
1794     }
1795
1796     leaf repeat {
1797       description
1798           "This flag indicates whether the alarm should be repeatedly emitted
1799           while the associated threshold has been crossed.";
1800
1801       type boolean;
1802       default true;
1803     }
1804
1805     leaf enabled {
1806       description
1807           "This flag indicates whether the alarm has been enabled or
1808           disabled.";
1809
1810       type boolean;
1811       default true;
1812     }
1813
1814     leaf severity {
1815       description "A measure of the important or urgency of the alarm";
1816       type alarm-severity-type;
1817     }
1818
1819     leaf metric {
1820       description "The metric to be tracked by this alarm.";
1821       type alarm-metric-type;
1822     }
1823
1824     leaf statistic {
1825       description "The type of metric statistic that is tracked by this alarm";
1826       type alarm-statistic-type;
1827     }
1828
1829     leaf operation {
1830       description
1831           "The relational operator that defines whether the alarm should be
1832           triggered when the metric statistic is, say, above or below the
1833           specified threshold value.";
1834       type alarm-operation-type;
1835     }
1836
1837     leaf value {
1838       description
1839           "This value defines the threshold that, if crossed, will trigger
1840           the alarm.";
1841       type decimal64 {
1842         fraction-digits 4;
1843       }
1844     }
1845
1846     leaf period {
1847       description
1848           "The period defines the length of time (seconds) that the metric
1849           data are collected over in oreder to evaluate the chosen
1850           statistic.";
1851       type uint32;
1852     }
1853
1854     leaf evaluations {
1855       description
1856           "This is the number of samples of the metric statistic used to
1857           evaluate threshold crossing. Each sample or evaluation is equal to
1858           the metric statistic obtained for a given period. This can be used
1859           to mitigate spikes in the metric that may skew the statistic of
1860           interest.";
1861       type uint32;
1862     }
1863   }
1864
1865   typedef cloud-account-type {
1866     description "cloud account type";
1867     type enumeration {
1868       enum aws;
1869       enum cloudsim;
1870       enum cloudsim_proxy;
1871       enum mock;
1872       enum openmano;
1873       enum openstack;
1874       enum vsphere;
1875       enum openvim;
1876     }
1877   }
1878   
1879   grouping host-aggregate {
1880     list host-aggregate {
1881       description "Name of the Host Aggregate";
1882       key "metadata-key";
1883       
1884       leaf metadata-key {
1885         type string;
1886       }
1887       leaf metadata-value {
1888         type string;
1889       }
1890     }
1891   }
1892   
1893   grouping placement-group-input {
1894     leaf cloud-type {
1895       type manotypes:cloud-account-type;
1896     }
1897     choice cloud-provider {
1898       case openstack {           
1899         container availability-zone {
1900           description "Name of the Availability Zone";
1901           leaf name {
1902             type string;
1903           }
1904         }
1905         container server-group {
1906           description "Name of the Affinity/Anti-Affinity Server Group";
1907           leaf name {
1908             type string;
1909           }
1910         }
1911         uses host-aggregate;
1912       }
1913       case aws {
1914         leaf aws-construct {
1915           type empty;
1916         }
1917       }
1918       case openmano {
1919         leaf openmano-construct {
1920           type empty;
1921         }        
1922       }
1923       case vsphere {
1924         leaf vsphere-construct {
1925           type empty;
1926         }
1927       }
1928       case mock {
1929         leaf mock-construct {
1930           type empty;
1931         }
1932       }
1933       case cloudsim {
1934         leaf cloudsim-construct {
1935           type empty;
1936         }
1937       }
1938     }
1939   }
1940   
1941   grouping placement-group-info {
1942     description "";
1943
1944     leaf name {
1945       description
1946           "Place group construct to define the compute resource placement strategy
1947            in cloud environment";
1948       type string;
1949     }
1950
1951     leaf requirement {
1952       description "This is free text space used to describe the intent/rationale
1953                    behind this placement group. This is for human consumption only";
1954       type string;
1955     }
1956     
1957     leaf strategy {
1958       description
1959           "Strategy associated with this placement group
1960              Following values are possible
1961                - COLOCATION: Colocation strategy imply intent to share the physical
1962                              infrastructure (hypervisor/network) among all members
1963                              of this group.
1964                - ISOLATION: Isolation strategy imply intent to not share the physical
1965                             infrastructure (hypervisor/network) among the members
1966                             of this group.
1967              ";
1968       type enumeration {
1969         enum COLOCATION;
1970         enum ISOLATION;
1971       }
1972       default "COLOCATION";
1973     }
1974   }
1975
1976   grouping ip-profile-info {
1977     description "Grouping for IP-Profile";
1978     container ip-profile-params {
1979       
1980       leaf ip-version {
1981         type inet:ip-version;
1982         default ipv4;
1983       }
1984
1985       leaf subnet-address {
1986         description "Subnet IP prefix associated with IP Profile";
1987         type inet:ip-prefix;
1988       }
1989
1990       leaf gateway-address {
1991         description "IP Address of the default gateway associated with IP Profile";
1992         type inet:ip-address;
1993       }
1994
1995       leaf security-group {
1996         description "Name of the security group";
1997         type string;
1998       }
1999
2000       list dns-server {
2001         key "address";
2002         leaf address {
2003                                         description "List of DNS Servers associated with IP Profile";
2004                                         type inet:ip-address;
2005         }
2006       }
2007
2008       container dhcp-params {  
2009         leaf enabled {
2010           description "This flag indicates if DHCP is enabled or not";
2011           type boolean;
2012           default true;
2013         }
2014
2015         leaf start-address {
2016           description "Start IP address of the IP-Address range associated with DHCP domain";
2017           type inet:ip-address;
2018         }
2019
2020         leaf count {
2021           description "Size of the DHCP pool associated with DHCP domain";
2022           type uint32;
2023         }
2024       }
2025
2026       leaf subnet-prefix-pool {
2027         description "VIM Specific reference to pre-created subnet prefix";
2028         type string;
2029       }
2030     }
2031   }
2032
2033   grouping ip-profile-list {
2034     list ip-profiles {
2035       description
2036           "List of IP Profiles.
2037              IP Profile describes the IP characteristics for the Virtual-Link";
2038     
2039       key "name";
2040
2041       leaf name {
2042         description "Name of the IP-Profile";
2043         type string;
2044       }
2045       
2046       leaf description {
2047         description "Description for IP profile";
2048         type string;
2049       }
2050       
2051       uses ip-profile-info;
2052     }
2053   }
2054
2055   grouping config-file {
2056     description "Grouping for files needed to be mounted into an additional drive";
2057     list config-file {
2058       description
2059           "List of configuration files to be written on an additional drive";
2060       key "source";
2061       leaf source {
2062         description "Name of the configuration file";
2063         type string;
2064       }
2065       leaf dest {
2066         description "Full path of the destination in the guest";
2067         type string;
2068       }
2069     }
2070   }
2071
2072   grouping supplemental-boot-data {
2073     description "Grouping for custom vim data";
2074     container supplemental-boot-data {
2075       uses manotypes:config-file;
2076       leaf boot-data-drive {
2077         description "Some VIMs implement additional drives to host config-files or meta-data";
2078         type boolean;
2079         default false;
2080       } 
2081     }
2082   }
2083
2084   grouping volume-info {
2085     description "Grouping for Volume-info";
2086
2087     leaf description {
2088       description "Description for Volume";
2089       type string;
2090     }
2091
2092     leaf size {
2093       description "Size of disk in GB";
2094       type uint64;
2095     }
2096
2097     choice volume-source {
2098       description
2099             "Defines the source of the volume. Possible options are
2100              1. Ephemeral -- Empty disk
2101              2. Image     -- Refer to image to be used for volume
2102              3. Volume    -- Reference of pre-existing volume to be used
2103             ";
2104
2105       case ephemeral {
2106         leaf ephemeral {
2107           type empty;
2108         }
2109       }
2110
2111       case image {
2112         uses image-properties;
2113       }
2114
2115     }
2116
2117     leaf device_bus {
2118       description "Type of disk-bus on which this disk is exposed to guest";
2119       type enumeration {
2120         enum ide;
2121         enum usb;
2122         enum virtio;
2123         enum scsi;
2124       }
2125     }
2126
2127     leaf device_type {
2128       description "The type of device as exposed to guest";
2129       type enumeration {
2130           enum disk;
2131           enum cdrom;
2132           enum floppy;
2133           enum lun;
2134       }
2135     }
2136
2137   }
2138
2139   grouping rpc-project-name {
2140     leaf project-name {
2141       mandatory true;
2142       description
2143         "Project to which this belongs";
2144       type leafref {
2145         path "/rw-project:project/rw-project:name";
2146       }
2147     }
2148   }
2149 }