Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / schemas / yang / mano-types.yang.src
1
2 /*
3  * 
4  *   Copyright 2016 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:ietf:params:xml:ns:yang:nfvo:mano-types";
24   prefix "manotypes";
25
26   import ietf-inet-types {
27     prefix "inet";
28   }
29
30   import rw-pb-ext {
31     prefix "rwpb";
32   }
33
34   revision 2015-04-23 {
35     description
36       "Initial revision. This YANG file defines
37        the reusable base types for VNF Management
38        and Orchestration (MANO).";
39     reference
40       "Derived from earlier versions of base YANG files";
41   }
42
43   typedef parameter-data-type {
44     type enumeration {
45       enum STRING;
46       enum INTEGER;
47       enum BOOLEAN;
48     }
49   }
50
51   grouping primitive-parameter {
52     leaf name {
53       description
54           "Name of the parameter.";
55       type string;
56     }
57
58     leaf data-type {
59       description
60           "Data type associated with the name.";
61       type manotypes:parameter-data-type;
62     }
63
64     leaf mandatory {
65       description "Is this field mandatory";
66       type boolean;
67       default false;
68     }
69
70     leaf default-value {
71       description "The default value for this field";
72       type string;
73     }
74
75     leaf parameter-pool {
76       description "NSD Parameter pool name to use for this paramter";
77       type string;
78     }
79
80     leaf read-only {
81       description
82         "The value should be greyed out by the UI.
83         Only applies to parameters with default values.";
84       type boolean;
85     }
86
87     leaf hidden {
88       description
89         "The value should be hidden by the UI.
90         Only applies to parameters with default values.";
91       type boolean;
92     }
93   }
94
95
96   grouping vnf-configuration {
97     container vnf-configuration {
98       ////rwpb:msg-new VnfConfiguration;
99       description
100           "Information regarding the VNF configuration
101            is captured here. ";
102
103       choice config-method {
104         description
105             "Defines the configuration method for the VNF.";
106         case netconf {
107           description
108               "Use NETCONF for configuring the VNF.";
109           container netconf {
110             leaf target {
111               description
112                   "Netconf configuration target";
113               type enumeration {
114                 enum running;
115                 enum candidate;
116               }
117             }
118
119             leaf protocol {
120               description
121                   "Protocol to use for netconf (e.g. ssh)";
122               type enumeration {
123                 enum None;
124                 enum ssh;
125               }
126             }
127
128             leaf port {
129               description
130                   "Port for the netconf server.";
131               type inet:port-number;
132             }
133           }
134         }
135
136         case rest {
137           description
138               "Use REST for configuring the VNF.";
139           container rest {
140             leaf port {
141               description
142                   "Port for the REST server.";
143               type inet:port-number;
144             }
145           }
146         }
147
148         case script {
149           description
150               "Use custom script for configuring the VNF.
151                This script is executed in the context of
152                Orchestrator.";
153           container script {
154             leaf script-type {
155               description
156                   "Script type - currently supported : bash, expect";
157               type enumeration {
158                 enum bash;
159                 enum expect;
160               }
161             }
162           }
163         }
164
165         case juju {
166           description
167             "Configure the VNF through Juju.";
168           container juju {
169             leaf charm {
170               description "Juju charm to use with the VNF.";
171               type string;
172             }
173           }
174         }
175       }
176
177       container config-access {
178         leaf mgmt-ip-address {
179           description
180               "IP address to be used to configure this VNF,
181                optional if it is possible to resolve dynamically.";
182           type inet:ip-address;
183         }
184
185         leaf username {
186           description
187               "username for configuration.";
188           type string;
189         }
190
191         leaf password {
192           description
193               "Password for configuration access authentication.";
194           type string;
195         }
196       }
197
198       container config-attributes {
199         description
200             "Miscelaneous input parameters to be considered
201              while processing the NSD to apply configuration";
202
203         leaf config-priority {
204           description
205               "Configuration priority - order of confgiration
206                to be applied to each VNF in this NS,
207                low number gets precedence over high number";
208           type uint64;
209         }
210
211         leaf config-delay {
212           description
213               "Wait (seconds) before applying the configuration to VNF";
214           type uint64;
215         }
216       }
217
218       list config-primitive {
219         ////rwpb:msg-new ConfigPrimitive;
220         description
221             "List of configuration primitives supported by the
222             configuration agent for this VNF.";
223         key "name";
224
225         leaf name {
226           description
227               "Name of the configuration primitive.";
228           type string;
229         }
230
231         list parameter {
232           description
233               "List of parameters to the configuration primitive.";
234           key "name";
235           uses primitive-parameter;
236         }
237       }
238
239       list initial-config-primitive {
240         ////rwpb:msg-new InitialConfigPrimitive;
241         description
242             "Initial set of configuration primitives.";
243         key "seq";
244         leaf seq {
245           description
246               "Sequence number for the configuration primitive.";
247           type uint64;
248         }
249
250         leaf name {
251           description
252               "Name of the configuration primitive.";
253           type string;
254         }
255
256         list parameter {
257           key "name";
258           leaf name {
259             type string;
260           }
261
262           leaf value {
263             type string;
264           }
265         }
266       }
267
268       leaf config-template {
269         description
270             "Configuration template for each VNF";
271         type string;
272       }
273     }
274   } // END - grouping vnf-configuration
275
276   typedef virtual-link-type {
277     description
278         "Type of virtual link
279          ELAN: A multipoint service connecting a set of VNFs
280          // ELINE: For a simple point to point connection
281          //        between a VNF and the existing network.
282          // ETREE: A multipoint service connecting one or
283          //        more roots and a set of leaves, but
284          //        preventing inter-leaf communication.";
285     type enumeration {
286       enum ELAN;
287       // enum ETREE;
288       // enum ELINE;
289     }
290   }
291
292   grouping named-value {
293     leaf name {
294       type string;
295     }
296
297     leaf value {
298       type string;
299     }
300   }
301
302   typedef http-method {
303     description
304       "Type of HTTP operation";
305
306     type enumeration {
307       enum POST;
308       enum PUT;
309       enum GET;
310       enum DELETE;
311       enum OPTIONS;
312       enum PATCH;
313     }
314   }
315
316   typedef api-type {
317     description
318       "Type of API to fetch monitoring params";
319
320     type enumeration {
321       enum HTTP;
322       enum NETCONF;
323       enum SOAP;
324     }
325   }
326
327   typedef json-query-method {
328     description
329       "The method to extract a value from a JSON response
330
331        NAMEKEY - Use the name as the key for a non-nested value.
332        JSONPATH - Use jsonpath-rw implemenation to extract a value.
333        OBJECTPATH - Use objectpath implemenation to extract a value.";
334       type enumeration {
335         enum NAMEKEY;
336         enum JSONPATH;
337         enum OBJECTPATH;
338       }
339   }
340
341   typedef param-value-type {
342     description
343       "The type of the parameter value";
344     type enumeration {
345        enum INT;
346        enum DECIMAL;
347        enum STRING;
348     }
349   }
350
351   typedef connection-point-type {
352     description
353         "Type of connection point
354         VPORT: Virtual Port
355         // VNIC_ADDR: Virtual NIC Address
356         // PNIC_ADDR: Physical NIC Address
357         // PPORT: Phsical Port.";
358
359     type enumeration {
360       enum VPORT;
361     }
362   }
363
364   typedef widget-type {
365     description
366         "Type of the widget, typically used by the UI.";
367     type enumeration {
368       enum HISTOGRAM;
369       enum BAR;
370       enum GAUGE;
371       enum SLIDER;
372       enum COUNTER;
373       enum TEXTBOX;
374     }
375   }
376
377   typedef cpu-feature-type {
378     description
379         "Enumeration for CPU features.
380
381          AES: CPU supports advanced instruction set for
382          AES (Advanced Encryption Standard).
383
384          CAT: Cache Allocation Technology (CAT) allows
385          an Operating System, Hypervisor, or similar
386          system management agent to specify the amount
387          of L3 cache (currently the last-level cache
388          in most server and client platforms) space an
389          application can fill (as a hint to hardware
390          functionality, certain features such as power
391          management may override CAT settings).
392
393          CMT: Cache Monitoring Technology (CMT) allows
394          an Operating System, Hypervisor, or similar
395          system management agent to determine the
396          usage of cache based on applications running
397          on the platform. The implementation is
398          directed at L3 cache monitoring (currently
399          the last-level cache in most server and
400          client platforms).
401
402          DDIO: Intel Data Direct I/O (DDIO) enables
403          Ethernet server NICs and controllers talk
404          directly to the processor cache without a
405          detour via system memory. This enumeration
406          specifies if the VM requires a DDIO
407          capable host.";
408
409     type enumeration {
410       enum PREFER_AES;
411       enum REQUIRE_AES;
412       enum PREFER_CAT;
413       enum REQUIRE_CAT;
414       enum PREFER_CMT;
415       enum REQUIRE_CMT;
416       enum PREFER_DDIO;
417       enum REQUIRE_DDIO;
418       enum REQUIRE_VME;
419       enum PREFER_VME;
420       enum REQUIRE_DE;
421       enum PREFER_DE;
422       enum REQUIRE_PSE;
423       enum PREFER_PSE;
424       enum REQUIRE_TSC;
425       enum PREFER_TSC;
426       enum REQUIRE_MSR;
427       enum PREFER_MSR;
428       enum REQUIRE_PAE;
429       enum PREFER_PAE;
430       enum REQUIRE_MCE;
431       enum PREFER_MCE;
432       enum REQUIRE_CX8;
433       enum PREFER_CX8;
434       enum REQUIRE_APIC;
435       enum PREFER_APIC;
436       enum REQUIRE_SEP;
437       enum PREFER_SEP;
438       enum REQUIRE_MTRR;
439       enum PREFER_MTRR;
440       enum REQUIRE_PGE;
441       enum PREFER_PGE;
442       enum REQUIRE_MCA;
443       enum PREFER_MCA;
444       enum REQUIRE_CMOV;
445       enum PREFER_CMOV;
446       enum REQUIRE_PAT;
447       enum PREFER_PAT;
448       enum REQUIRE_PSE36;
449       enum PREFER_PSE36;
450       enum REQUIRE_CLFLUSH;
451       enum PREFER_CLFLUSH;
452       enum REQUIRE_DTS;
453       enum PREFER_DTS;
454       enum REQUIRE_ACPI;
455       enum PREFER_ACPI;
456       enum REQUIRE_MMX;
457       enum PREFER_MMX;
458       enum REQUIRE_FXSR;
459       enum PREFER_FXSR;
460       enum REQUIRE_SSE;
461       enum PREFER_SSE;
462       enum REQUIRE_SSE2;
463       enum PREFER_SSE2;
464       enum REQUIRE_SS;
465       enum PREFER_SS;
466       enum REQUIRE_HT;
467       enum PREFER_HT;
468       enum REQUIRE_TM;
469       enum PREFER_TM;
470       enum REQUIRE_IA64;
471       enum PREFER_IA64;
472       enum REQUIRE_PBE;
473       enum PREFER_PBE;
474       enum REQUIRE_RDTSCP;
475       enum PREFER_RDTSCP;
476       enum REQUIRE_PNI;
477       enum PREFER_PNI;
478       enum REQUIRE_PCLMULQDQ;
479       enum PREFER_PCLMULQDQ;
480       enum REQUIRE_DTES64;
481       enum PREFER_DTES64;
482       enum REQUIRE_MONITOR;
483       enum PREFER_MONITOR;
484       enum REQUIRE_DS_CPL;
485       enum PREFER_DS_CPL;
486       enum REQUIRE_VMX;
487       enum PREFER_VMX;
488       enum REQUIRE_SMX;
489       enum PREFER_SMX;
490       enum REQUIRE_EST;
491       enum PREFER_EST;
492       enum REQUIRE_TM2;
493       enum PREFER_TM2;
494       enum REQUIRE_SSSE3;
495       enum PREFER_SSSE3;
496       enum REQUIRE_CID;
497       enum PREFER_CID;
498       enum REQUIRE_FMA;
499       enum PREFER_FMA;
500       enum REQUIRE_CX16;
501       enum PREFER_CX16;
502       enum REQUIRE_XTPR;
503       enum PREFER_XTPR;
504       enum REQUIRE_PDCM;
505       enum PREFER_PDCM;
506       enum REQUIRE_PCID;
507       enum PREFER_PCID;
508       enum REQUIRE_DCA;
509       enum PREFER_DCA;
510       enum REQUIRE_SSE4_1;
511       enum PREFER_SSE4_1;
512       enum REQUIRE_SSE4_2;
513       enum PREFER_SSE4_2;
514       enum REQUIRE_X2APIC;
515       enum PREFER_X2APIC;
516       enum REQUIRE_MOVBE;
517       enum PREFER_MOVBE;
518       enum REQUIRE_POPCNT;
519       enum PREFER_POPCNT;
520       enum REQUIRE_TSC_DEADLINE_TIMER;
521       enum PREFER_TSC_DEADLINE_TIMER;
522       enum REQUIRE_XSAVE;
523       enum PREFER_XSAVE;
524       enum REQUIRE_AVX;
525       enum PREFER_AVX;
526       enum REQUIRE_F16C;
527       enum PREFER_F16C;
528       enum REQUIRE_RDRAND;
529       enum PREFER_RDRAND;
530       enum REQUIRE_FSGSBASE;
531       enum PREFER_FSGSBASE;
532       enum REQUIRE_BMI1;
533       enum PREFER_BMI1;
534       enum REQUIRE_HLE;
535       enum PREFER_HLE;
536       enum REQUIRE_AVX2;
537       enum PREFER_AVX2;
538       enum REQUIRE_SMEP;
539       enum PREFER_SMEP;
540       enum REQUIRE_BMI2;
541       enum PREFER_BMI2;
542       enum REQUIRE_ERMS;
543       enum PREFER_ERMS;
544       enum REQUIRE_INVPCID;
545       enum PREFER_INVPCID;
546       enum REQUIRE_RTM;
547       enum PREFER_RTM;
548       enum REQUIRE_MPX;
549       enum PREFER_MPX;
550       enum REQUIRE_RDSEED;
551       enum PREFER_RDSEED;
552       enum REQUIRE_ADX;
553       enum PREFER_ADX;
554       enum REQUIRE_SMAP;
555       enum PREFER_SMAP;
556     }
557   }
558
559   grouping vm-flavor {
560     container vm-flavor {
561       leaf vcpu-count {
562         description
563             "Number of vcpus for the VM.";
564         type uint16;
565       }
566
567       leaf memory-mb {
568         description
569             "Amount of memory in MB.";
570         type uint64;
571       }
572
573       leaf storage-gb {
574         description
575             "Amount of disk space in GB.";
576         type uint64;
577       }
578     }
579   } //grouping vm-flavor
580
581   grouping vswitch-epa {
582     container vswitch-epa {
583       leaf ovs-acceleration {
584         description
585             "Specifies Open vSwitch acceleration mode.
586              MANDATORY: OVS acceleration is required
587              PREFERRED: OVS acceleration is preferred";
588         type enumeration {
589           enum MANDATORY;
590           enum PREFERRED;
591           enum DISABLED;
592         }
593       }
594
595       leaf ovs-offload {
596         description
597             "Specifies Open vSwitch hardware offload mode.
598              MANDATORY: OVS offload is required
599              PREFERRED: OVS offload is preferred";
600         type enumeration {
601           enum MANDATORY;
602           enum PREFERRED;
603           enum DISABLED;
604         }
605       }
606     }
607   }
608
609   grouping hypervisor-epa {
610     container hypervisor-epa {
611       leaf type {
612         description
613             "Specifies the type of hypervisor.
614              KVM: KVM
615              XEN: XEN";
616         type enumeration {
617           enum PREFER_KVM;
618           enum REQUIRE_KVM;
619         }
620       }
621       leaf version {
622         type string;
623       }
624     }
625   }
626
627   grouping host-epa {
628     container host-epa {
629       description "Specifies the host level EPA attributes.";
630       leaf cpu-model {
631         description
632             "Host CPU model. Examples include: SandyBridge,
633              IvyBridge";
634         type enumeration {
635           enum PREFER_WESTMERE;
636           enum REQUIRE_WESTMERE;
637           enum PREFER_SANDYBRIDGE;
638           enum REQUIRE_SANDYBRIDGE;
639           enum PREFER_IVYBRIDGE;
640           enum REQUIRE_IVYBRIDGE;
641           enum PREFER_HASWELL;
642           enum REQUIRE_HASWELL;
643           enum PREFER_BROADWELL;
644           enum REQUIRE_BROADWELL;
645           enum PREFER_NEHALEM;
646           enum REQUIRE_NEHALEM;
647           enum PREFER_PENRYN;
648           enum REQUIRE_PENRYN;
649           enum PREFER_CONROE;
650           enum REQUIRE_CONROE;
651           enum PREFER_CORE2DUO;
652           enum REQUIRE_CORE2DUO;
653         }
654       }
655
656       leaf cpu-arch {
657         description "Host CPU architecture.";
658         type enumeration {
659           enum PREFER_X86;
660           enum REQUIRE_X86;
661           enum PREFER_X86_64;
662           enum REQUIRE_X86_64;
663           enum PREFER_I686;
664           enum REQUIRE_I686;
665           enum PREFER_IA64;
666           enum REQUIRE_IA64;
667           enum PREFER_ARMV7;
668           enum REQUIRE_ARMV7;
669           enum PREFER_ARMV8;
670           enum REQUIRE_ARMV8;
671         }
672       }
673
674       leaf cpu-vendor {
675         description "Host CPU Vendor.";
676         type enumeration {
677           enum PREFER_INTEL;
678           enum REQUIRE_INTEL;
679           enum PREFER_AMD;
680           enum REQUIRE_AMD;
681         }
682       }
683
684       leaf cpu-socket-count {
685         description "Number of sockets on the host.";
686         type uint64;
687       }
688
689       leaf cpu-core-count {
690         description "Number of cores on the host.";
691         type uint64;
692       }
693
694       leaf cpu-core-thread-count {
695         description "Number of threads per cores on the host.";
696         type uint64;
697       }
698
699       leaf-list cpu-feature {
700         description
701             "List of CPU features.";
702         type manotypes:cpu-feature-type;
703       }
704
705
706       leaf om-cpu-model-string {
707         description "Openmano CPU model string";
708         type string;
709       }
710
711       leaf-list om-cpu-feature {
712         description "Openmano CPU features";
713         type string;
714       }
715     }
716   }
717
718   grouping guest-epa {
719     description "EPA attributes for the guest";
720     container guest-epa {
721       leaf trusted-execution {
722         description "This VM should be allocated from trusted pool";
723         type boolean;
724       }
725
726       leaf mempage-size {
727         description
728             "Memory page allocation size. If a VM requires
729              hugepages, it should choose LARGE or SIZE_2MB
730              or SIZE_1GB. If the VM prefers hugepages it
731              should chose PREFER_LARGE.
732              LARGE        : Require hugepages (either 2MB or 1GB)
733              SMALL        : Doesn't require hugepages
734              SIZE_2MB     : Requires 2MB hugepages
735              SIZE_1GB     : Requires 1GB hugepages
736              PREFER_LARGE : Application perfers hugepages";
737         type enumeration {
738           enum LARGE;
739           enum SMALL;
740           enum SIZE_2MB;
741           enum SIZE_1GB;
742           enum PREFER_LARGE;
743         }
744       }
745
746       leaf cpu-pinning-policy {
747         description
748             "CPU pinning policy describes association
749              between virtual CPUs in guest and the
750              physical CPUs in the host.
751              DEDICATED : Virtual CPUs are pinned to
752                          physical CPUs
753              SHARED    : Multiple VMs may share the
754                          same physical CPUs.
755              ANY       : Any policy is acceptable for the VM";
756         type enumeration {
757           enum DEDICATED;
758           enum SHARED;
759           enum ANY;
760         }
761         default "ANY";
762       }
763
764       leaf cpu-thread-pinning-policy {
765           description
766             "CPU thread pinning policy describes how to
767              place the guest CPUs when the host supports
768              hyper threads:
769              AVOID   : Avoids placing a guest on a host
770                        with threads.
771              SEPARATE: Places vCPUs on separate cores,
772                        and avoids placing two vCPUs on
773                        two threads of same core.
774              ISOLATE : Places each vCPU on a different core,
775                        and places no vCPUs from a different
776                        guest on the same core.
777              PREFER  : Attempts to place vCPUs on threads
778                        of the same core.";
779         type enumeration {
780           enum AVOID;
781           enum SEPARATE;
782           enum ISOLATE;
783           enum PREFER;
784         }
785       }
786
787       list pcie-device {
788         description
789             "List of pcie passthrough devices.";
790         key device-id;
791         leaf device-id {
792           description
793               "Device identifier.";
794           type string;
795         }
796         leaf count {
797           description
798               "Number of devices to attach to the VM.";
799           type uint64;
800         }
801       }
802
803       choice numa-policy {
804         case numa-unware {
805           leaf numa-unware {
806             type empty;
807           }
808         }
809
810         case numa-aware {
811           container numa-node-policy {
812             description
813                 "This policy defines numa topology of the
814                  guest. Specifically identifies if the guest
815                  should be run on a host with one numa
816                  node or multiple numa nodes. As an example
817                  a guest may want 8 vcpus and 4 GB of
818                  memory. But may want the vcpus and memory
819                  distributed across multiple numa nodes.
820                  The NUMA node 1 may run with 6 vcpus and
821                  3GB, and NUMA node 2 may run with 2 vcpus
822                  and 1GB.";
823
824             leaf node-cnt {
825               description
826                   "The number of numa nodes to expose to the VM.";
827               type uint16;
828             }
829
830             leaf mem-policy {
831               description
832                   "This policy specifies how the memory should
833                    be allocated in a multi-node scenario.
834                    STRICT    : The memory must be allocated
835                                strictly from the memory attached
836                                to the NUMA node.
837                    PREFERRED : The memory should be allocated
838                                perferentially from the memory
839                                attached to the NUMA node";
840               type enumeration {
841                 enum STRICT;
842                 enum PREFERRED;
843               }
844             }
845
846            list node {
847               key id;
848               leaf id {
849                 description
850                     "NUMA node identification. Typically
851                      it's 0 or 1";
852                 type uint64;
853               }
854
855               leaf-list vcpu {
856                 description
857                     "List of vcpus to allocate on
858                      this numa node.";
859                 type uint64;
860               }
861
862               leaf memory-mb {
863                 description
864                     "Memory size expressed in MB
865                      for this NUMA node.";
866                 type uint64;
867               }
868
869               choice om-numa-type {
870                 description
871                     "Openmano Numa type selection";
872
873                 case cores {
874                   leaf num-cores {
875                     type uint8;
876                   }
877                 }
878
879                 case paired-threads {
880                   container paired-threads {
881                     leaf num-paired-threads {
882                       type uint8;
883                     }
884
885                     list paired-thread-ids {
886                       description
887                           "List of thread pairs to use in case of paired-thread numa";
888                       max-elements 16;
889                       key thread-a;
890
891                       leaf thread-a {
892                           type uint8;
893                       }
894
895                       leaf thread-b {
896                           type uint8;
897                       }
898                     }
899                   }
900                 }
901                 case threads {
902                   leaf num-threads {
903                     type uint8;
904                   }
905                 }
906               }
907             }
908
909           }
910         }
911       }
912     }
913   }
914
915   grouping provider-network {
916     container provider-network {
917       description "Container for the provider network.";
918       leaf physical-network {
919         description
920             "Name of the phsyical network on which the provider
921              network is built.";
922         type string;
923       }
924
925       leaf overlay-type {
926         description
927             "Type of the overlay network.";
928         type enumeration {
929           enum LOCAL;
930           enum FLAT;
931           enum VLAN;
932           enum VXLAN;
933           enum GRE;
934         }
935       }
936       leaf segmentation_id {
937         description
938             "Segmentation ID";
939             type uint32;
940       }
941     }
942   }
943   grouping config-primitive {
944     list config-primitive {
945       description
946           "Network service level configuration primitives.";
947
948       key "name";
949
950       leaf name {
951         description
952             "Name of the configuration primitive.";
953         type string;
954       }
955
956       list parameter {
957         description
958             "List of parameters to the configuration primitive.";
959
960         key "name";
961         uses manotypes:primitive-parameter;
962       }
963
964       list parameter-group {
965         description
966             "Grouping of parameters which are logically grouped in UI";
967         key "name";
968
969         leaf name {
970           description
971               "Name of the parameter group";
972           type string;
973         }
974
975         list parameter {
976           description
977               "List of parameters to the configuration primitive.";
978           key "name";
979           uses manotypes:primitive-parameter;
980         }
981
982         leaf mandatory {
983           description "Is this parameter group mandatory";
984           type boolean;
985           default true;
986         }
987       }
988
989       list vnf-primitive-group {
990         description
991             "List of configuration primitives grouped by VNF.";
992
993         key "member-vnf-index-ref";
994         leaf member-vnf-index-ref {
995           description
996               "Reference to member-vnf within constituent-vnfds";
997           type uint64;
998         }
999
1000         leaf vnfd-id-ref {
1001           description
1002               "A reference to a vnfd. This is a
1003                leafref to path:
1004                    ../../../../nsd:constituent-vnfd
1005                    + [nsd:id = current()/../nsd:id-ref]
1006                    + /nsd:vnfd-id-ref
1007                NOTE: An issue with confd is preventing the
1008                use of xpath. Seems to be an issue with leafref
1009                to leafref, whose target is in a different module.
1010                Once that is resovled this will switched to use
1011                leafref";
1012
1013           type string;
1014         }
1015
1016         leaf vnfd-name {
1017           description
1018               "Name of the VNFD";
1019           type string;
1020         }
1021
1022         list primitive {
1023           key "index";
1024
1025           leaf index {
1026             description "Index of this primitive";
1027             type uint32;
1028           }
1029
1030           leaf name {
1031             description "Name of the primitive in the VNF primitive ";
1032             type string;
1033           }
1034         }
1035       }
1036
1037       leaf user-defined-script {
1038         description
1039             "A user defined script.";
1040         type string;
1041       }
1042       }
1043   }
1044
1045   grouping monitoring-param {
1046     list http-endpoint {
1047       description
1048           "List of http endpoints to be used by monitoring params";
1049       key path;
1050
1051       leaf path {
1052         description "The HTTP path on the management server";
1053         type string;
1054       }
1055
1056       leaf https {
1057         description "Pick HTTPS instead of HTTP , Default is false";
1058         type boolean;
1059         default "false";
1060       }
1061
1062       leaf port {
1063         description "The HTTP port to connect to";
1064         type inet:port-number;
1065       }
1066
1067       leaf username {
1068         description "The HTTP basic auth username";
1069         type string;
1070       }
1071
1072       leaf password {
1073         description "The HTTP basic auth password";
1074         type string;
1075       }
1076
1077       leaf polling_interval_secs {
1078         description "The HTTP polling interval in seconds";
1079         type uint8;
1080         default 2;
1081       }
1082
1083       leaf method {
1084         description
1085           "This is the method to be performed at the uri.
1086            GET by default for action";
1087
1088         type manotypes:http-method;
1089         default "GET";
1090       }
1091
1092       list headers {
1093         description "Custom HTTP headers to put on HTTP request";
1094         key key;
1095         leaf key{
1096           description "HTTP header key";
1097           type string;
1098         }
1099
1100         leaf value{
1101           description "HTTP header value";
1102           type string;
1103         }
1104       }
1105     }
1106
1107     list monitoring-param {
1108       description
1109           "List of monitoring parameters at the NS level";
1110       key id;
1111       leaf id {
1112         type string;
1113       }
1114
1115       leaf name {
1116         type string;
1117       }
1118
1119       leaf http-endpoint-ref {
1120         type leafref {
1121           path "../../http-endpoint/path";
1122         }
1123       }
1124
1125       leaf json-query-method {
1126         type manotypes:json-query-method;
1127         default "NAMEKEY";
1128       }
1129
1130       container json-query-params {
1131         leaf json-path {
1132           description
1133             "The jsonpath to use to extract value from JSON structure";
1134           type string;
1135         }
1136         leaf object-path {
1137           description
1138             "The objectpath to use to extract value from JSON structure";
1139           type string;
1140         }
1141       }
1142
1143       leaf description {
1144         type string;
1145       }
1146
1147       leaf group-tag {
1148         description "A simple tag to group monitoring parameters";
1149         type string;
1150       }
1151
1152       leaf value-type {
1153         type manotypes:param-value-type;
1154         default "INT";
1155       }
1156
1157       container numeric-constraints {
1158         leaf min-value {
1159           description
1160               "Minimum value for the parameter";
1161           type uint64;
1162         }
1163         leaf max-value {
1164           description
1165               "Maxium value for the parameter";
1166           type uint64;
1167         }
1168       }
1169
1170       container text-constraints {
1171         leaf min-length {
1172           description
1173               "Minimum string length for the parameter";
1174           type uint8;
1175         }
1176         leaf max-length {
1177           description
1178               "Maximum string length for the parameter";
1179           type uint8;
1180         }
1181       }
1182
1183       leaf value-integer {
1184         description
1185             "Current value for an integer parameter";
1186         type int64;
1187       }
1188
1189       leaf value-decimal {
1190         description
1191             "Current value for a decimal parameter";
1192         type decimal64 {
1193           fraction-digits 4;
1194         }
1195       }
1196
1197       leaf value-string {
1198         description
1199             "Current value for a string parameter";
1200         type string;
1201       }
1202
1203       leaf widget-type {
1204         type manotypes:widget-type;
1205       }
1206
1207       leaf units {
1208         type string;
1209       }
1210     }
1211   }
1212
1213   grouping control-param {
1214     list control-param {
1215       description
1216           "List of control parameters to manage and
1217            update the running configuration of the VNF";
1218       key id;
1219
1220       leaf id {
1221         type string;
1222       }
1223
1224       leaf name {
1225         type string;
1226       }
1227
1228       leaf description {
1229         type string;
1230       }
1231
1232       leaf group-tag {
1233         description "A simple tag to group control parameters";
1234         type string;
1235       }
1236
1237       leaf min-value {
1238         description
1239             "Minimum value for the parameter";
1240         type uint64;
1241       }
1242
1243       leaf max-value {
1244         description
1245             "Maxium value for the parameter";
1246         type uint64;
1247       }
1248
1249       leaf current-value {
1250         description
1251             "Current value for the parameter";
1252         type uint64;
1253       }
1254
1255       leaf step-value {
1256         description
1257             "Step value for the parameter";
1258         type uint64;
1259       }
1260
1261       leaf units {
1262         type string;
1263       }
1264
1265       leaf widget-type {
1266         type manotypes:widget-type;
1267       }
1268
1269       leaf url {
1270         description
1271           "This is the URL where to perform the operation";
1272
1273         type inet:uri;
1274       }
1275
1276       leaf method {
1277         description
1278           "This is the method to be performed at the uri.
1279            POST by default for action";
1280
1281         type manotypes:http-method;
1282         default "POST";
1283       }
1284
1285       leaf payload {
1286         description
1287           "This is the operation payload or payload template as stringified
1288            JSON. This field provides the data  to be sent for this operation
1289            call";
1290
1291         type string;
1292       }
1293     }
1294   }
1295
1296   grouping action-param {
1297     list action-param {
1298       description
1299           "List of action parameters to
1300            control VNF";
1301       key id;
1302       leaf id {
1303         type string;
1304       }
1305
1306       leaf name {
1307         type string;
1308       }
1309
1310       leaf description {
1311         type string;
1312       }
1313
1314       leaf group-tag {
1315         description "A simple tag to group monitoring parameter";
1316         type string;
1317       }
1318
1319       leaf url {
1320         description
1321           "This is the URL where to perform the operation";
1322         type inet:uri;
1323       }
1324
1325       leaf method {
1326         description
1327           "This is the method to be performed at the uri.
1328            POST by default for action";
1329
1330         type manotypes:http-method;
1331         default "POST";
1332       }
1333
1334       leaf payload {
1335         description
1336           "This is the operation payload or payload template to be sent in
1337            the data for this operation call";
1338
1339         type string;
1340       }
1341     }
1342   }
1343
1344   grouping input-parameter {
1345     description "";
1346
1347     list input-parameter {
1348       description
1349           "List of input parameters";
1350
1351       key xpath;
1352
1353
1354       leaf xpath {
1355         description
1356           "A an xpath that specfies which element in a descriptor is to be
1357           modified.";
1358         type string;
1359       }
1360
1361       leaf value {
1362         description
1363           "The value that the element specified by the xpath should take when a
1364           record is created.";
1365         type string;
1366       }
1367     }
1368   }
1369
1370   grouping input-parameter-xpath {
1371     list input-parameter-xpath {
1372       description
1373           "List of xpaths to parameters inside the NSD
1374            the can be customized during the instantiation.";
1375
1376       key "xpath";
1377       leaf xpath {
1378         description
1379             "An xpath that specifies the element in a descriptor.";
1380         type string;
1381       }
1382
1383       leaf label {
1384         description "A descriptive string";
1385         type string;
1386       }
1387
1388       leaf default-value {
1389         description " A default value for this input parameter";
1390         type string;
1391       }
1392     }
1393   }
1394
1395   grouping nfvi-metrics {
1396     container vcpu {
1397       leaf label {
1398         description
1399           "Label to show in UI";
1400         type string;
1401         default "VCPU";
1402       }
1403
1404       leaf total {
1405         description
1406           "The total number of VCPUs available.";
1407         type uint64;
1408       }
1409
1410       leaf utilization {
1411         description
1412           "The VCPU utilization (percentage).";
1413         type decimal64 {
1414           fraction-digits 2;
1415           range "0 .. 100";
1416         }
1417       }
1418     }
1419
1420     container memory {
1421       leaf label {
1422         description
1423           "Label to show in UI";
1424         type string;
1425         default "MEMORY";
1426       }
1427
1428       leaf used {
1429         description
1430           "The amount of memory (bytes) currently in use.";
1431         type uint64;
1432       }
1433
1434       leaf total {
1435         description
1436           "The amount of memory (bytes) available.";
1437         type uint64;
1438       }
1439
1440       leaf utilization {
1441         description
1442           "The memory utilization (percentage).";
1443         type decimal64 {
1444           fraction-digits 2;
1445           range "0 .. 100";
1446         }
1447       }
1448     }
1449
1450     container storage {
1451       leaf label {
1452         description
1453           "Label to show in UI";
1454         type string;
1455         default "STORAGE";
1456       }
1457
1458       leaf used {
1459         description
1460           "The amount of storage (bytes) currently in use.";
1461         type uint64;
1462       }
1463
1464       leaf total {
1465         description
1466           "The amount of storage (bytes) available.";
1467         type uint64;
1468       }
1469
1470       leaf utilization {
1471         description
1472           "The storage utilization (percentage).";
1473         type decimal64 {
1474           fraction-digits 2;
1475           range "0 .. 100";
1476         }
1477       }
1478     }
1479
1480     container external-ports {
1481       leaf label {
1482         description
1483           "Label to show in UI";
1484         type string;
1485         default "EXTERNAL PORTS";
1486       }
1487
1488       leaf total {
1489         description
1490           "The total number of external ports.";
1491         type uint64;
1492       }
1493     }
1494
1495     container internal-ports {
1496       leaf label {
1497         description
1498           "Label to show in UI";
1499         type string;
1500         default "INTERNAL PORTS";
1501       }
1502
1503       leaf total {
1504         description
1505           "The total number of internal ports.";
1506         type uint64;
1507       }
1508     }
1509
1510     container network {
1511       leaf label {
1512         description
1513           "Label to show in UI";
1514         type string;
1515         default "NETWORK TRAFFIC";
1516       }
1517
1518       container incoming {
1519         leaf label {
1520           description
1521             "Label to show in UI";
1522           type string;
1523           default "INCOMING NETWORK TRAFFIC";
1524         }
1525
1526         leaf bytes {
1527           description
1528             "The cumulative number of incoming bytes.";
1529           type uint64;
1530         }
1531
1532         leaf packets {
1533           description
1534             "The cumulative number of incoming packets.";
1535           type uint64;
1536         }
1537
1538         leaf byte-rate {
1539           description
1540             "The current incoming byte-rate (bytes per second).";
1541           type decimal64 {
1542             fraction-digits 2;
1543           }
1544         }
1545
1546         leaf packet-rate {
1547           description
1548             "The current incoming packet (packets per second).";
1549           type decimal64 {
1550             fraction-digits 2;
1551           }
1552         }
1553       }
1554
1555       container outgoing {
1556         leaf label {
1557           description
1558             "Label to show in UI";
1559           type string;
1560           default "OUTGOING NETWORK TRAFFIC";
1561         }
1562
1563         leaf bytes {
1564           description
1565             "The cumulative number of outgoing bytes.";
1566           type uint64;
1567         }
1568
1569         leaf packets {
1570           description
1571             "The cumulative number of outgoing packets.";
1572           type uint64;
1573         }
1574
1575         leaf byte-rate {
1576           description
1577             "The current outgoing byte-rate (bytes per second).";
1578           type decimal64 {
1579             fraction-digits 2;
1580           }
1581         }
1582
1583         leaf packet-rate {
1584           description
1585             "The current outgoing packet (packets per second).";
1586           type decimal64 {
1587             fraction-digits 2;
1588           }
1589         }
1590       }
1591     }
1592   }
1593
1594   typedef alarm-severity-type {
1595     description "An indication of the importance or ugency of the alarm";
1596     type enumeration {
1597       enum LOW;
1598       enum MODERATE;
1599       enum CRITICAL;
1600     }
1601   }
1602
1603   typedef alarm-metric-type {
1604     description "The type of metrics to register the alarm for";
1605     type enumeration {
1606       enum CPU_UTILIZATION;
1607       enum MEMORY_UTILIZATION;
1608       enum STORAGE_UTILIZATION;
1609     }
1610   }
1611
1612   typedef alarm-statistic-type {
1613     description
1614         "The type of statistic to used to measure a metric to determine
1615         threshold crossing for an alarm.";
1616     type enumeration {
1617       enum AVERAGE;
1618       enum MINIMUM;
1619       enum MAXIMUM;
1620       enum COUNT;
1621       enum SUM;
1622     }
1623   }
1624
1625   typedef alarm-operation-type {
1626     description
1627         "The relational operator used to define whether an alarm should be
1628         triggered when, say, the metric statistic goes above or below a
1629         specified value.";
1630     type enumeration {
1631       enum GE; // greater than or equal
1632       enum LE; // less than or equal
1633       enum GT; // greater than
1634       enum LT; // less than
1635       enum EQ; // equal
1636     }
1637   }
1638
1639   grouping alarm {
1640     leaf alarm-id {
1641       description
1642           "This field is reserved for the identifier assigned by the cloud
1643           provider";
1644
1645       type string;
1646     }
1647
1648     leaf name {
1649       description "A human readable string to identify the alarm";
1650       type string;
1651     }
1652
1653     leaf description {
1654       description "A string containing a description of this alarm";
1655       type string;
1656     }
1657
1658     leaf vdur-id {
1659       description
1660           "The identifier of the VDUR that the alarm is associated with";
1661       type string;
1662     }
1663
1664     container actions {
1665       list ok {
1666         key "url";
1667         leaf url {
1668           type string;
1669         }
1670       }
1671
1672       list insufficient-data {
1673         key "url";
1674         leaf url {
1675           type string;
1676         }
1677       }
1678
1679       list alarm {
1680         key "url";
1681         leaf url {
1682           type string;
1683         }
1684       }
1685     }
1686
1687     leaf repeat {
1688       description
1689           "This flag indicates whether the alarm should be repeatedly emitted
1690           while the associated threshold has been crossed.";
1691
1692       type boolean;
1693       default true;
1694     }
1695
1696     leaf enabled {
1697       description
1698           "This flag indicates whether the alarm has been enabled or
1699           disabled.";
1700
1701       type boolean;
1702       default true;
1703     }
1704
1705     leaf severity {
1706       description "A measure of the important or urgency of the alarm";
1707       type manotypes:alarm-severity-type;
1708     }
1709
1710     leaf metric {
1711       description "The metric to be tracked by this alarm.";
1712       type manotypes:alarm-metric-type;
1713     }
1714
1715     leaf statistic {
1716       description "The type of metric statistic that is tracked by this alarm";
1717       type manotypes:alarm-statistic-type;
1718     }
1719
1720     leaf operation {
1721       description
1722           "The relational operator that defines whether the alarm should be
1723           triggered when the metric statistic is, say, above or below the
1724           specified threshold value.";
1725       type manotypes:alarm-operation-type;
1726     }
1727
1728     leaf value {
1729       description
1730           "This value defines the threshold that, if crossed, will trigger
1731           the alarm.";
1732       type decimal64 {
1733         fraction-digits 4;
1734       }
1735     }
1736
1737     leaf period {
1738       description
1739           "The period defines the length of time (seconds) that the metric
1740           data are collected over in oreder to evaluate the chosen
1741           statistic.";
1742       type uint32;
1743     }
1744
1745     leaf evaluations {
1746       description
1747           "This is the number of samples of the metric statistic used to
1748           evaluate threshold crossing. Each sample or evaluation is equal to
1749           the metric statistic obtained for a given period. This can be used
1750           to mitigate spikes in the metric that may skew the statistic of
1751           interest.";
1752       type uint32;
1753     }
1754   }
1755
1756   typedef cloud-account-type {
1757     description "cloud account type";
1758     type enumeration {
1759       enum aws;
1760       enum cloudsim;
1761       enum cloudsim_proxy;
1762       enum mock;
1763       enum openmano;
1764       enum openstack;
1765       enum vsphere;
1766     }
1767   }
1768
1769   grouping host-aggregate {
1770     list host-aggregate {
1771       description "Name of the Host Aggregate";
1772       key "metadata-key";
1773
1774       leaf metadata-key {
1775         type string;
1776       }
1777       leaf metadata-value {
1778         type string;
1779       }
1780     }
1781   }
1782
1783   grouping placement-group-input {
1784     leaf cloud-type {
1785       type manotypes:cloud-account-type;
1786     }
1787     choice cloud-provider {
1788       case openstack {
1789         container availability-zone {
1790           description "Name of the Availability Zone";
1791           leaf name {
1792             type string;
1793           }
1794         }
1795         container server-group {
1796           description "Name of the Affinity/Anti-Affinity Server Group";
1797           leaf name {
1798             type string;
1799           }
1800         }
1801         uses host-aggregate;
1802       }
1803       case aws {
1804         leaf aws-construct {
1805           type empty;
1806         }
1807       }
1808       case openmano {
1809         leaf openmano-construct {
1810           type empty;
1811         }
1812       }
1813       case vsphere {
1814         leaf vsphere-construct {
1815           type empty;
1816         }
1817       }
1818       case mock {
1819         leaf mock-construct {
1820           type empty;
1821         }
1822       }
1823       case cloudsim {
1824         leaf cloudsim-construct {
1825           type empty;
1826         }
1827       }
1828     }
1829   }
1830
1831   grouping placement-group-info {
1832     description "";
1833
1834     leaf name {
1835       description
1836           "Place group construct to define the compute resource placement strategy
1837            in cloud environment";
1838       type string;
1839     }
1840
1841     leaf requirement {
1842       description "This is free text space used to describe the intent/rationale
1843                    behind this placement group. This is for human consumption only";
1844       type string;
1845     }
1846
1847     leaf strategy {
1848       description
1849           "Strategy associated with this placement group
1850              Following values are possible
1851                - COLOCATION: Colocation strategy imply intent to share the physical
1852                              infrastructure (hypervisor/network) among all members
1853                              of this group.
1854                - ISOLATION: Isolation strategy imply intent to not share the physical
1855                             infrastructure (hypervisor/network) among the members
1856                             of this group.
1857              ";
1858       type enumeration {
1859         enum COLOCATION;
1860         enum ISOLATION;
1861       }
1862       default "COLOCATION";
1863     }
1864   }
1865 }