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