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