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