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