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