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