Merge "Add unittest to exercise python compatibility"
[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 "aggregation-type";
1228       type enumeration {
1229         enum AVERAGE;
1230         enum MINIMUM;
1231         enum MAXIMUM;
1232         enum COUNT;
1233         enum SUM;
1234       }
1235     }
1236
1237     leaf aggregation-type {
1238       type aggregation-type;
1239     }
1240   }
1241
1242   grouping monitoring-param-ui-data {
1243       leaf description {
1244         type string;
1245       }
1246
1247       leaf group-tag {
1248         description "A tag to group monitoring parameters";
1249         type string;
1250       }
1251
1252
1253       leaf widget-type {
1254         description "Defines the UI Display variant of measured counters.";
1255         type manotypes:widget-type;
1256         default "COUNTER";
1257       }
1258
1259       leaf units {
1260         description "Measured Counter Units (e.g., Packets, Kbps, Mbps, etc.)";
1261         type string;
1262       }
1263   }
1264
1265   grouping monitoring-param-value {
1266       leaf value-type {
1267         type param-value-type;
1268         default "INT";
1269       }
1270
1271       container numeric-constraints {
1272         leaf min-value {
1273           description
1274               "Minimum value for the parameter";
1275           type uint64;
1276         }
1277         leaf max-value {
1278           description
1279               "Maximum value for the parameter";
1280           type uint64;
1281         }
1282       }
1283
1284       container text-constraints {
1285         leaf min-length {
1286           description
1287               "Minimum string length for the parameter";
1288           type uint8;
1289         }
1290         leaf max-length {
1291           description
1292               "Maximum string length for the parameter";
1293           type uint8;
1294         }
1295       }
1296
1297       leaf value-integer {
1298         description
1299             "Current value for an integer parameter";
1300         type int64;
1301       }
1302
1303       leaf value-decimal {
1304         description
1305             "Current value for a decimal parameter";
1306         type decimal64 {
1307           fraction-digits 4;
1308         }
1309       }
1310
1311       leaf value-string {
1312         description
1313             "Current value for a string parameter";
1314         type string;
1315       }
1316   }
1317
1318   grouping control-param {
1319     list control-param {
1320       description
1321           "List of control parameters to manage and
1322            update the running configuration of the VNF";
1323       key id;
1324
1325       leaf id {
1326         description "Identifier for control parameter";
1327         type string;
1328       }
1329
1330       leaf name {
1331         description "Name of a control parameter";
1332         type string;
1333       }
1334
1335       leaf description {
1336         description "A description of the control parameter";
1337         type string;
1338       }
1339
1340       leaf group-tag {
1341         description "A tag to group control parameters";
1342         type string;
1343       }
1344
1345       leaf min-value {
1346         description
1347             "Minimum value for the parameter";
1348         type uint64;
1349       }
1350
1351       leaf max-value {
1352         description
1353             "Maximum value for the parameter";
1354         type uint64;
1355       }
1356
1357       leaf current-value {
1358         description
1359             "Current value for the parameter";
1360         type uint64;
1361       }
1362
1363       leaf step-value {
1364         description
1365             "Step value for the parameter";
1366         type uint64;
1367       }
1368
1369       leaf units {
1370         type string;
1371       }
1372
1373       leaf widget-type {
1374         type manotypes:widget-type;
1375       }
1376
1377       leaf url {
1378         description
1379           "This is the URL where the operation should be performed.";
1380
1381         type inet:uri;
1382       }
1383
1384       leaf method {
1385         description
1386           "Method that the URI should perform.
1387            Default Action is POST";
1388
1389         type manotypes:http-method;
1390         default "POST";
1391       }
1392
1393       leaf payload {
1394         description
1395           "This is the operation payload or payload template as stringified
1396            JSON. This field provides the data  to be sent for this operation
1397            call";
1398
1399         type string;
1400       }
1401     }
1402   }
1403
1404   grouping action-param {
1405     list action-param {
1406       description
1407           "List of action parameters to
1408            control VNF";
1409       key id;
1410       leaf id {
1411         type string;
1412       }
1413
1414       leaf name {
1415         type string;
1416       }
1417
1418       leaf description {
1419         type string;
1420       }
1421
1422       leaf group-tag {
1423         description "A tag to group monitoring parameter";
1424         type string;
1425       }
1426
1427       leaf url {
1428         description
1429           "This is the URL where to perform the operation";
1430         type inet:uri;
1431       }
1432
1433       leaf method {
1434         description
1435           "This is the method to be performed at the uri.
1436            POST by default for action";
1437
1438         type manotypes:http-method;
1439         default "POST";
1440       }
1441
1442       leaf payload {
1443         description
1444           "This is the operation payload or payload template to be sent in
1445            the data for this operation call";
1446
1447         type string;
1448       }
1449     }
1450   }
1451
1452   grouping input-parameter {
1453     description "List of input parameters that can be specified when instantiating a network service.";
1454
1455     list input-parameter {
1456       description
1457           "List of input parameters";
1458
1459       key xpath;
1460
1461
1462       leaf xpath {
1463         description
1464           "An xpath that specfies which element in a descriptor is to be
1465           modified.";
1466         type string;
1467       }
1468
1469       leaf value {
1470         description
1471           "The value that the element specified by the xpath should take when a
1472           record is created.";
1473         type string;
1474       }
1475     }
1476   }
1477
1478   grouping input-parameter-xpath {
1479     list input-parameter-xpath {
1480       description
1481           "List of xpaths to parameters inside the NSD
1482            the can be customized during the instantiation.";
1483
1484       key "xpath";
1485       leaf xpath {
1486         description
1487             "An xpath that specifies the element in a descriptor.";
1488         type string;
1489       }
1490
1491       leaf label {
1492         description "A descriptive string";
1493         type string;
1494       }
1495
1496       leaf default-value {
1497         description "Default Value for the Input Parameter";
1498         type string;
1499       }
1500     }
1501   }
1502
1503   grouping nfvi-metrics {
1504     container vcpu {
1505       leaf label {
1506         description
1507           "Label to show in UI";
1508         type string;
1509         default "VCPU";
1510       }
1511
1512       leaf total {
1513         description
1514           "The total number of VCPUs available.";
1515         type uint64;
1516       }
1517
1518       leaf utilization {
1519         description
1520           "The VCPU utilization (percentage).";
1521         type decimal64 {
1522           fraction-digits 2;
1523           range "0 .. 100";
1524         }
1525       }
1526     }
1527
1528     container memory {
1529       leaf label {
1530         description
1531           "Label to show in UI";
1532         type string;
1533         default "MEMORY";
1534       }
1535
1536       leaf used {
1537         description
1538           "The amount of memory (bytes) currently in use.";
1539         type uint64;
1540       }
1541
1542       leaf total {
1543         description
1544           "The amount of memory (bytes) available.";
1545         type uint64;
1546       }
1547
1548       leaf utilization {
1549         description
1550           "The memory utilization (percentage).";
1551         type decimal64 {
1552           fraction-digits 2;
1553           range "0 .. 100";
1554         }
1555       }
1556     }
1557
1558     container storage {
1559       leaf label {
1560         description
1561           "Label to show in UI";
1562         type string;
1563         default "STORAGE";
1564       }
1565
1566       leaf used {
1567         description
1568           "The amount of storage (bytes) currently in use.";
1569         type uint64;
1570       }
1571
1572       leaf total {
1573         description
1574           "The amount of storage (bytes) available.";
1575         type uint64;
1576       }
1577
1578       leaf utilization {
1579         description
1580           "The storage utilization (percentage).";
1581         type decimal64 {
1582           fraction-digits 2;
1583           range "0 .. 100";
1584         }
1585       }
1586     }
1587
1588     container external-ports {
1589       leaf label {
1590         description
1591           "Label to show in UI";
1592         type string;
1593         default "EXTERNAL PORTS";
1594       }
1595
1596       leaf total {
1597         description
1598           "The total number of external ports.";
1599         type uint64;
1600       }
1601     }
1602
1603     container internal-ports {
1604       leaf label {
1605         description
1606           "Label to show in UI";
1607         type string;
1608         default "INTERNAL PORTS";
1609       }
1610
1611       leaf total {
1612         description
1613           "The total number of internal ports.";
1614         type uint64;
1615       }
1616     }
1617
1618     container network {
1619       leaf label {
1620         description
1621           "Label to show in UI";
1622         type string;
1623         default "NETWORK TRAFFIC";
1624       }
1625
1626       container incoming {
1627         leaf label {
1628           description
1629             "Label to show in UI";
1630           type string;
1631           default "INCOMING NETWORK TRAFFIC";
1632         }
1633
1634         leaf bytes {
1635           description
1636             "The cumulative number of incoming bytes.";
1637           type uint64;
1638         }
1639
1640         leaf packets {
1641           description
1642             "The cumulative number of incoming packets.";
1643           type uint64;
1644         }
1645
1646         leaf byte-rate {
1647           description
1648             "The current incoming byte-rate (bytes per second).";
1649           type decimal64 {
1650             fraction-digits 2;
1651           }
1652         }
1653
1654         leaf packet-rate {
1655           description
1656             "The current incoming packet (packets per second).";
1657           type decimal64 {
1658             fraction-digits 2;
1659           }
1660         }
1661       }
1662
1663       container outgoing {
1664         leaf label {
1665           description
1666             "Label to show in UI";
1667           type string;
1668           default "OUTGOING NETWORK TRAFFIC";
1669         }
1670
1671         leaf bytes {
1672           description
1673             "The cumulative number of outgoing bytes.";
1674           type uint64;
1675         }
1676
1677         leaf packets {
1678           description
1679             "The cumulative number of outgoing packets.";
1680           type uint64;
1681         }
1682
1683         leaf byte-rate {
1684           description
1685             "The current outgoing byte-rate (bytes per second).";
1686           type decimal64 {
1687             fraction-digits 2;
1688           }
1689         }
1690
1691         leaf packet-rate {
1692           description
1693             "The current outgoing packet (packets per second).";
1694           type decimal64 {
1695             fraction-digits 2;
1696           }
1697         }
1698       }
1699     }
1700   }
1701
1702   typedef alarm-severity-type {
1703     description "An indication of the importance or urgency of the alarm";
1704     type enumeration {
1705       enum LOW;
1706       enum MODERATE;
1707       enum CRITICAL;
1708     }
1709   }
1710
1711   typedef alarm-metric-type {
1712     description "The type of metrics to register the alarm for";
1713     type enumeration {
1714       enum CPU_UTILIZATION;
1715       enum MEMORY_UTILIZATION;
1716       enum STORAGE_UTILIZATION;
1717     }
1718   }
1719
1720   typedef alarm-statistic-type {
1721     description
1722         "Statistic type to use to determine threshold crossing
1723          for an alarm.";
1724     type enumeration {
1725       enum AVERAGE;
1726       enum MINIMUM;
1727       enum MAXIMUM;
1728       enum COUNT;
1729       enum SUM;
1730     }
1731   }
1732
1733   typedef alarm-operation-type {
1734     description
1735         "The relational operator used to define whether an alarm
1736         should be triggered in certain scenarios, such as if the
1737         metric statistic goes above or below a specified value.";
1738     type enumeration {
1739       enum GE; // greater than or equal
1740       enum LE; // less than or equal
1741       enum GT; // greater than
1742       enum LT; // less than
1743       enum EQ; // equal
1744     }
1745   }
1746
1747   grouping alarm {
1748     leaf alarm-id {
1749       description
1750           "This field is reserved for the identifier assigned by the VIM provider";
1751
1752       type string;
1753     }
1754
1755     leaf name {
1756       description "A human readable string to identify the alarm";
1757       type string;
1758     }
1759
1760     leaf description {
1761       description "A description of this alarm";
1762       type string;
1763     }
1764
1765     leaf vdur-id {
1766       description
1767           "The identifier of the VDUR that the alarm is associated with";
1768       type string;
1769     }
1770
1771     container actions {
1772       list ok {
1773         key "url";
1774         leaf url {
1775           type string;
1776         }
1777       }
1778
1779       list insufficient-data {
1780         key "url";
1781         leaf url {
1782           type string;
1783         }
1784       }
1785
1786       list alarm {
1787         key "url";
1788         leaf url {
1789           type string;
1790         }
1791       }
1792     }
1793
1794     leaf repeat {
1795       description
1796           "This flag indicates whether the alarm should be repeatedly emitted
1797           while the associated threshold has been crossed.";
1798
1799       type boolean;
1800       default true;
1801     }
1802
1803     leaf enabled {
1804       description
1805           "This flag indicates whether the alarm has been enabled or
1806           disabled.";
1807
1808       type boolean;
1809       default true;
1810     }
1811
1812     leaf severity {
1813       description "A measure of the importance or urgency of the alarm";
1814       type alarm-severity-type;
1815     }
1816
1817     leaf metric {
1818       description "The metric to be tracked by this alarm.";
1819       type alarm-metric-type;
1820     }
1821
1822     leaf statistic {
1823       description "The type of metric statistic that is tracked by this alarm";
1824       type alarm-statistic-type;
1825     }
1826
1827     leaf operation {
1828       description
1829           "The relational operator used to define whether an alarm should be
1830            triggered in certain scenarios, such as if the metric statistic
1831            goes above or below a specified value.";
1832       type alarm-operation-type;
1833     }
1834
1835     leaf value {
1836       description
1837           "This value defines the threshold that, if crossed, will trigger
1838           the alarm.";
1839       type decimal64 {
1840         fraction-digits 4;
1841       }
1842     }
1843
1844     leaf period {
1845       description
1846           "The period defines the length of time (seconds) that the metric
1847           data are collected over in oreder to evaluate the chosen
1848           statistic.";
1849       type uint32;
1850     }
1851
1852     leaf evaluations {
1853       description
1854           "Defines the length of time (seconds) in which metric data are
1855            collected in order to evaluate the chosen statistic.";
1856       type uint32;
1857     }
1858   }
1859
1860   typedef cloud-account-type {
1861     description "VIM account type";
1862     type enumeration {
1863       enum aws;
1864       enum cloudsim;
1865       enum cloudsim_proxy;
1866       enum mock;
1867       enum openmano;
1868       enum openstack;
1869       enum vsphere;
1870       enum openvim;
1871     }
1872   }
1873
1874   grouping host-aggregate {
1875     list host-aggregate {
1876       description "Name of the Host Aggregate";
1877       key "metadata-key";
1878
1879       leaf metadata-key {
1880         description
1881             "Name of the additional information attached to the host-aggregate";
1882         type string;
1883       }
1884       leaf metadata-value {
1885         description
1886             "Value of the corresponding metadata-key";
1887         type string;
1888       }
1889     }
1890   }
1891
1892   grouping placement-group-input {
1893     leaf cloud-type {
1894       type manotypes:cloud-account-type;
1895     }
1896     choice cloud-provider {
1897       case openstack {
1898         container availability-zone {
1899           description "Name of the Availability Zone";
1900           leaf name {
1901             type string;
1902           }
1903         }
1904         container server-group {
1905           description "Name of the Affinity/Anti-Affinity Server Group";
1906           leaf name {
1907             type string;
1908           }
1909         }
1910         uses host-aggregate;
1911       }
1912       case aws {
1913         leaf aws-construct {
1914           type empty;
1915         }
1916       }
1917       case openmano {
1918         leaf openmano-construct {
1919           type empty;
1920         }
1921       }
1922       case vsphere {
1923         leaf vsphere-construct {
1924           type empty;
1925         }
1926       }
1927       case mock {
1928         leaf mock-construct {
1929           type empty;
1930         }
1931       }
1932       case cloudsim {
1933         leaf cloudsim-construct {
1934           type empty;
1935         }
1936       }
1937     }
1938   }
1939
1940   grouping cloud-config {
1941     list key-pair {
1942       key "name";
1943       description "Used to configure the list of public keys to be injected as part
1944           of ns instantiation";
1945
1946       leaf name {
1947         description "Name of this key pair";
1948         type string;
1949       }
1950
1951       leaf key {
1952         description "Key associated with this key pair";
1953         type string;
1954       }
1955     }
1956
1957     list user {
1958       key "name";
1959       description "List of users to be added through cloud-config";
1960
1961       leaf name {
1962         description "Name of the user ";
1963         type string;
1964       }
1965
1966       leaf user-info {
1967         description "The user name's real name";
1968         type string;
1969       }
1970
1971       list key-pair {
1972         key "name";
1973         description "Used to configure the list of public keys to be injected as part
1974             of ns instantiation";
1975
1976         leaf name {
1977           description "Name of this key pair";
1978           type string;
1979         }
1980
1981         leaf key {
1982           description "Key associated with this key pair";
1983           type string;
1984         }
1985       }
1986     }
1987   }
1988
1989   grouping placement-group-info {
1990     description "";
1991
1992     leaf name {
1993       description
1994           "Place group construct to define the compute resource placement strategy
1995            in cloud environment";
1996       type string;
1997     }
1998
1999     leaf requirement {
2000       description "This is free text space used to describe the intent/rationale
2001                    behind this placement group. This is for human consumption only";
2002       type string;
2003     }
2004
2005     leaf strategy {
2006       description
2007           "Strategy associated with this placement group
2008              Following values are possible
2009                - COLOCATION: Colocation strategy imply intent to share the physical
2010                              infrastructure (hypervisor/network) among all members
2011                              of this group.
2012                - ISOLATION: Isolation strategy imply intent to not share the physical
2013                             infrastructure (hypervisor/network) among the members
2014                             of this group.
2015              ";
2016       type enumeration {
2017         enum COLOCATION;
2018         enum ISOLATION;
2019       }
2020       default "COLOCATION";
2021     }
2022   }
2023
2024   grouping ip-profile-info {
2025     description "Grouping for IP-Profile";
2026     container ip-profile-params {
2027
2028       leaf ip-version {
2029         type inet:ip-version;
2030         default ipv4;
2031       }
2032
2033       leaf subnet-address {
2034         description "Subnet IP prefix associated with IP Profile";
2035         type inet:ip-prefix;
2036       }
2037
2038       leaf gateway-address {
2039         description "IP Address of the default gateway associated with IP Profile";
2040         type inet:ip-address;
2041       }
2042
2043       leaf security-group {
2044         description "Name of the security group";
2045         type string;
2046       }
2047
2048       list dns-server {
2049         key "address";
2050         leaf address {
2051           description "List of DNS Servers associated with IP Profile";
2052           type inet:ip-address;
2053         }
2054       }
2055
2056       container dhcp-params {
2057         leaf enabled {
2058           description "This flag indicates if DHCP is enabled or not";
2059           type boolean;
2060           default true;
2061         }
2062
2063         leaf start-address {
2064           description "Start IP address of the IP-Address range associated with DHCP domain";
2065           type inet:ip-address;
2066         }
2067
2068         leaf count {
2069           description "Size of the DHCP pool associated with DHCP domain";
2070           type uint32;
2071         }
2072       }
2073
2074       leaf subnet-prefix-pool {
2075         description "VIM Specific reference to pre-created subnet prefix";
2076         type string;
2077       }
2078     }
2079   }
2080
2081   grouping ip-profile-list {
2082     list ip-profiles {
2083       description
2084           "List of IP Profiles.
2085              IP Profile describes the IP characteristics for the Virtual-Link";
2086
2087       key "name";
2088
2089       leaf name {
2090         description "Name of the IP-Profile";
2091         type string;
2092       }
2093
2094       leaf description {
2095         description "Description for IP profile";
2096         type string;
2097       }
2098
2099       uses ip-profile-info;
2100     }
2101   }
2102
2103   grouping config-file {
2104     description "Grouping for files needed to be mounted into an additional drive";
2105     list config-file {
2106       description
2107           "List of configuration files to be written on an additional drive";
2108       key "source";
2109       leaf source {
2110         description "Name of the configuration file";
2111         type string;
2112       }
2113       leaf dest {
2114         description "Full path of the destination in the guest";
2115         type string;
2116       }
2117     }
2118   }
2119
2120   grouping supplemental-boot-data {
2121     description "Grouping for custom vim data";
2122     container supplemental-boot-data {
2123       uses manotypes:config-file;
2124       leaf boot-data-drive {
2125         description "Some VIMs implement additional drives to host config-files or meta-data";
2126         type boolean;
2127         default false;
2128       }
2129     }
2130   }
2131
2132   grouping volume-info {
2133     description "Grouping for Volume-info";
2134
2135     leaf description {
2136       description "Description for Volume";
2137       type string;
2138     }
2139
2140     leaf size {
2141       description "Size of disk in GB";
2142       type uint64;
2143     }
2144
2145     choice volume-source {
2146       description
2147             "Defines the source of the volume. Possible options are
2148              1. Ephemeral -- Empty disk
2149              2. Image     -- Refer to image to be used for volume
2150              3. Volume    -- Reference of pre-existing volume to be used
2151             ";
2152
2153       case ephemeral {
2154         leaf ephemeral {
2155           type empty;
2156         }
2157       }
2158
2159       case image {
2160         uses image-properties;
2161       }
2162     }
2163
2164     leaf device-bus {
2165       description "Type of disk-bus on which this disk is exposed to guest";
2166       type enumeration {
2167         enum ide;
2168         enum usb;
2169         enum virtio;
2170         enum scsi;
2171       }
2172     }
2173
2174     leaf device-type {
2175       description "The type of device as exposed to guest";
2176       type enumeration {
2177           enum disk;
2178           enum cdrom;
2179           enum floppy;
2180           enum lun;
2181       }
2182     }
2183   }
2184
2185   grouping rpc-project-name {
2186     leaf project-name {
2187       default "default";
2188       description
2189         "Project to which this belongs";
2190       type leafref {
2191         path "/rw-project:project/rw-project:name";
2192       }
2193     }
2194   }
2195 }