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