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