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