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