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