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