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