Day-2 primitives for CNF with 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               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     }
1941   }
1942
1943   grouping alarm-properties {
1944     leaf name {
1945       description "A human readable string to identify the alarm";
1946       type string;
1947     }
1948
1949     leaf description {
1950       description "A description of this alarm";
1951       type string;
1952     }
1953
1954     leaf vdur-id {
1955       description
1956           "The identifier of the VDUR that the alarm is associated with";
1957       type string;
1958     }
1959
1960     container actions {
1961       list ok {
1962         key "url";
1963         leaf url {
1964           type string;
1965         }
1966       }
1967
1968       list insufficient-data {
1969         key "url";
1970         leaf url {
1971           type string;
1972         }
1973       }
1974
1975       list alarm {
1976         key "url";
1977         leaf url {
1978           type string;
1979         }
1980       }
1981     }
1982
1983     leaf repeat {
1984       description
1985           "This flag indicates whether the alarm should be repeatedly emitted
1986           while the associated threshold has been crossed.";
1987
1988       type boolean;
1989       default true;
1990     }
1991
1992     leaf enabled {
1993       description
1994           "This flag indicates whether the alarm has been enabled or
1995           disabled.";
1996
1997       type boolean;
1998       default true;
1999     }
2000
2001     leaf severity {
2002       description "A measure of the importance or urgency of the alarm";
2003       type alarm-severity-type;
2004     }
2005
2006     leaf statistic {
2007       description "The type of metric statistic that is tracked by this alarm";
2008       type alarm-statistic-type;
2009     }
2010
2011     leaf operation {
2012       description
2013           "The relational operator used to define whether an alarm should be
2014            triggered in certain scenarios, such as if the metric statistic
2015            goes above or below a specified value.";
2016       type relational-operation-type;
2017     }
2018
2019     leaf value {
2020       description
2021           "This value defines the threshold that, if crossed, will trigger
2022           the alarm.";
2023       type decimal64 {
2024         fraction-digits 4;
2025       }
2026     }
2027
2028     leaf period {
2029       description
2030           "The period defines the length of time (seconds) that the metric
2031           data are collected over in oreder to evaluate the chosen
2032           statistic.";
2033       type uint32;
2034     }
2035
2036     leaf evaluations {
2037       description
2038           "Defines the length of time (seconds) in which metric data are
2039            collected in order to evaluate the chosen statistic.";
2040       type uint32;
2041     }
2042   }
2043
2044   typedef cloud-account-type {
2045     description "VIM account type";
2046     type enumeration {
2047       enum aws;
2048       enum cloudsim;
2049       enum cloudsim_proxy;
2050       enum mock;
2051       enum openmano;
2052       enum openstack;
2053       enum vsphere;
2054       enum openvim;
2055     }
2056   }
2057
2058   grouping host-aggregate {
2059     list host-aggregate {
2060       description "Name of the Host Aggregate";
2061       key "metadata-key";
2062
2063       leaf metadata-key {
2064         description
2065             "Name of the additional information attached to the host-aggregate";
2066         type string;
2067       }
2068       leaf metadata-value {
2069         description
2070             "Value of the corresponding metadata-key";
2071         type string;
2072       }
2073     }
2074   }
2075
2076   grouping placement-group-input {
2077     leaf cloud-type {
2078       type manotypes:cloud-account-type;
2079     }
2080     choice cloud-provider {
2081       case openstack {
2082         container availability-zone {
2083           description "Name of the Availability Zone";
2084           leaf name {
2085             type string;
2086           }
2087         }
2088         container server-group {
2089           description "Name of the Affinity/Anti-Affinity Server Group";
2090           leaf name {
2091             type string;
2092           }
2093         }
2094         uses host-aggregate;
2095       }
2096       case aws {
2097         leaf aws-construct {
2098           type empty;
2099         }
2100       }
2101       case openmano {
2102         leaf openmano-construct {
2103           type empty;
2104         }
2105       }
2106       case vsphere {
2107         leaf vsphere-construct {
2108           type empty;
2109         }
2110       }
2111       case mock {
2112         leaf mock-construct {
2113           type empty;
2114         }
2115       }
2116       case cloudsim {
2117         leaf cloudsim-construct {
2118           type empty;
2119         }
2120       }
2121     }
2122   }
2123
2124   grouping cloud-config {
2125     list key-pair {
2126       key "name";
2127       description "Used to configure the list of public keys to be injected as part
2128           of ns instantiation";
2129
2130       leaf name {
2131         description "Name of this key pair";
2132         type string;
2133       }
2134
2135       leaf key {
2136         description "Key associated with this key pair";
2137         type string;
2138       }
2139     }
2140
2141     list user {
2142       key "name";
2143       description "List of users to be added through cloud-config";
2144
2145       leaf name {
2146         description "Name of the user ";
2147         type string;
2148       }
2149
2150       leaf user-info {
2151         description "The user name's real name";
2152         type string;
2153       }
2154
2155       list key-pair {
2156         key "name";
2157         description "Used to configure the list of public keys to be injected as part
2158             of ns instantiation";
2159
2160         leaf name {
2161           description "Name of this key pair";
2162           type string;
2163         }
2164
2165         leaf key {
2166           description "Key associated with this key pair";
2167           type string;
2168         }
2169       }
2170     }
2171   }
2172
2173   grouping placement-group-info {
2174     description "";
2175
2176     leaf name {
2177       description
2178           "Place group construct to define the compute resource placement strategy
2179            in cloud environment";
2180       type string;
2181     }
2182
2183     leaf requirement {
2184       description "This is free text space used to describe the intent/rationale
2185                    behind this placement group. This is for human consumption only";
2186       type string;
2187     }
2188
2189     leaf strategy {
2190       description
2191           "Strategy associated with this placement group
2192              Following values are possible
2193                - COLOCATION: Colocation strategy imply intent to share the physical
2194                              infrastructure (hypervisor/network) among all members
2195                              of this group.
2196                - ISOLATION: Isolation strategy imply intent to not share the physical
2197                             infrastructure (hypervisor/network) among the members
2198                             of this group.
2199              ";
2200       type enumeration {
2201         enum COLOCATION;
2202         enum ISOLATION;
2203       }
2204       default "COLOCATION";
2205     }
2206   }
2207
2208   grouping ip-profile-info {
2209     description "Grouping for IP-Profile";
2210     container ip-profile-params {
2211
2212       leaf ip-version {
2213         type inet:ip-version;
2214         default ipv4;
2215       }
2216
2217       leaf subnet-address {
2218         description "Subnet IP prefix associated with IP Profile";
2219         type inet:ip-prefix;
2220       }
2221
2222       leaf gateway-address {
2223         description "IP Address of the default gateway associated with IP Profile";
2224         type inet:ip-address;
2225       }
2226
2227       leaf security-group {
2228         description "Name of the security group";
2229         type string;
2230       }
2231
2232       list dns-server {
2233         key "address";
2234         leaf address {
2235           description "List of DNS Servers associated with IP Profile";
2236           type inet:ip-address;
2237         }
2238       }
2239
2240       container dhcp-params {
2241         leaf enabled {
2242           description "This flag indicates if DHCP is enabled or not";
2243           type boolean;
2244           default true;
2245         }
2246
2247         leaf start-address {
2248           description "Start IP address of the IP-Address range associated with DHCP domain";
2249           type inet:ip-address;
2250         }
2251
2252         leaf count {
2253           description "Size of the DHCP pool associated with DHCP domain";
2254           type uint32;
2255         }
2256       }
2257
2258       leaf subnet-prefix-pool {
2259         description "VIM Specific reference to pre-created subnet prefix";
2260         type string;
2261       }
2262     }
2263   }
2264
2265   grouping ip-profile-list {
2266     list ip-profiles {
2267       description
2268           "List of IP Profiles.
2269              IP Profile describes the IP characteristics for the Virtual-Link";
2270
2271       key "name";
2272
2273       leaf name {
2274         description "Name of the IP-Profile";
2275         type string;
2276       }
2277
2278       leaf description {
2279         description "Description for IP profile";
2280         type string;
2281       }
2282
2283       uses ip-profile-info;
2284     }
2285   }
2286
2287   grouping config-file {
2288     description "Grouping for files needed to be mounted into an additional drive";
2289     list config-file {
2290       description
2291           "List of configuration files to be written on an additional drive";
2292       key "source";
2293       leaf source {
2294         description "Name of the configuration file";
2295         type string;
2296       }
2297       leaf dest {
2298         description "Full path of the destination in the guest";
2299         type string;
2300       }
2301     }
2302   }
2303
2304   grouping supplemental-boot-data {
2305     description "Grouping for custom vim data";
2306     container supplemental-boot-data {
2307 //    uses manotypes:config-file;
2308       leaf boot-data-drive {
2309         description "Some VIMs implement additional drives to host config-files or meta-data";
2310         type boolean;
2311         default false;
2312       }
2313     }
2314   }
2315
2316   grouping volume-info {
2317     description "Grouping for Volume-info";
2318
2319     leaf description {
2320       description "Description for Volume";
2321       type string;
2322     }
2323
2324     leaf size {
2325       description "Size of disk in GB";
2326       type uint64;
2327     }
2328
2329     choice volume-source {
2330       description
2331             "Defines the source of the volume. Possible options are
2332              1. Ephemeral -- Empty disk
2333              2. Image     -- Refer to image to be used for volume
2334              3. Volume    -- Reference of pre-existing volume to be used
2335             ";
2336
2337       case ephemeral {
2338         leaf ephemeral {
2339           type empty;
2340         }
2341       }
2342
2343       case image {
2344         uses image-properties;
2345       }
2346     }
2347
2348     leaf device-bus {
2349       description "Type of disk-bus on which this disk is exposed to guest";
2350       type enumeration {
2351         enum ide;
2352         enum usb;
2353         enum virtio;
2354         enum scsi;
2355       }
2356     }
2357
2358     leaf device-type {
2359       description "The type of device as exposed to guest";
2360       type enumeration {
2361           enum disk;
2362           enum cdrom;
2363           enum floppy;
2364           enum lun;
2365       }
2366     }
2367   }
2368
2369   grouping rpc-project-name {
2370     leaf project-name {
2371       default "default";
2372       description
2373         "Project to which this belongs";
2374       type leafref {
2375         path "/osm-project:project/osm-project:name";
2376       }
2377     }
2378   }
2379 }