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