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