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