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