Add scaling augment
Change-Id: Ief06a8edf3071f0bbb0586c2c03c1511a333a1ed
Signed-off-by: Tomás Villaseca <tvillaseca@whitestack.com>
diff --git a/augments/common-augments.yang b/augments/common-augments.yang
index c0bbb82..7beec89 100644
--- a/augments/common-augments.yang
+++ b/augments/common-augments.yang
@@ -512,4 +512,43 @@
type string;
}
}
+
+ typedef scaling-trigger {
+ type enumeration {
+ enum pre-scale-in {
+ value 1;
+ }
+ enum post-scale-in {
+ value 2;
+ }
+ enum pre-scale-out {
+ value 3;
+ }
+ enum post-scale-out {
+ value 4;
+ }
+ }
+ }
+
+ typedef scaling-policy-type {
+ type enumeration {
+ enum manual {
+ value 1;
+ }
+ enum automatic {
+ value 2;
+ }
+ }
+ }
+
+ typedef scaling-criteria-operation {
+ type enumeration {
+ enum AND {
+ value 1;
+ }
+ enum OR {
+ value 2;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/augments/scaling.yang b/augments/scaling.yang
new file mode 100644
index 0000000..049ebc7
--- /dev/null
+++ b/augments/scaling.yang
@@ -0,0 +1,169 @@
+/*
+ Copyright 2020 Whitestack LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+module scaling {
+ yang-version 1.1;
+ namespace "urn:etsi:osm:yang:augments:scaling";
+ prefix "scaling";
+
+ import etsi-nfv-vnfd {
+ prefix vnfd;
+ }
+
+ import common-augments {
+ prefix common;
+ }
+
+ import day1-2 {
+ prefix day1-2;
+ }
+
+ grouping extended-scaling {
+ list scaling-policy {
+
+ key "name";
+
+ leaf name {
+ description
+ "Name of the scaling policy";
+ type string;
+ }
+
+ leaf scaling-type {
+ description
+ "Type of scaling";
+ type common:scaling-policy-type;
+ }
+
+ leaf enabled {
+ description
+ "Specifies if the scaling policy can be applied";
+ type boolean;
+ default true;
+ }
+
+ leaf scale-in-operation-type {
+ description
+ "Operation to be applied to check between scaling criterias to
+ check if the scale in threshold condition has been met.
+ Defaults to AND";
+ type common:scaling-criteria-operation;
+ default AND;
+ }
+
+ leaf scale-out-operation-type {
+ description
+ "Operation to be applied to check between scaling criterias to
+ check if the scale out threshold condition has been met.
+ Defauls to OR";
+ type common:scaling-criteria-operation;
+ default OR;
+ }
+
+ leaf threshold-time {
+ description
+ "The duration for which the criteria must hold true";
+ type uint32;
+ mandatory true;
+ }
+
+ leaf cooldown-time {
+ description
+ "The duration after a scaling-in/scaling-out action has been
+ triggered, for which there will be no further optional";
+ type uint32;
+ mandatory true;
+ }
+
+ list scaling-criteria {
+ description
+ "list of conditions to be met for generating scaling
+ requests";
+ key "name";
+
+ leaf name {
+ type string;
+ }
+
+ leaf scale-in-threshold {
+ description
+ "Value below which scale-in requests are generated";
+ type decimal64{
+ fraction-digits 10;
+ }
+ }
+
+ leaf scale-in-relational-operation {
+ description
+ "The relational operator used to compare the monitoring param
+ against the scale-in-threshold.";
+ type common:relational-operation-type;
+ default LE;
+ }
+
+ leaf scale-out-threshold {
+ description
+ "Value above which scale-out requests are generated";
+ type decimal64{
+ fraction-digits 10;
+ }
+ }
+
+ leaf scale-out-relational-operation {
+ description
+ "The relational operator used to compare the monitoring param
+ against the scale-out-threshold.";
+ type common:relational-operation-type;
+ default GE;
+ }
+
+ leaf vnf-monitoring-param-ref {
+ description
+ "Reference to the VNF level monitoring parameter
+ that is aggregated";
+ type leafref {
+ path "/vnfd:vnfd/vnfd:df/vnfd:monitoring-parameter/vnfd:id";
+ }
+ }
+ }
+ }
+
+ list scaling-config-action {
+ description
+ "List of scaling config actions";
+ key "trigger";
+
+ leaf trigger {
+ description
+ "scaling trigger";
+ type common:scaling-trigger;
+ }
+
+ leaf vnf-config-primitive-name-ref {
+ description
+ "Reference to the VNF config primitive";
+ type leafref {
+ path "/vnfd:vnfd/day1-2:vnf-configuration/day1-2:config-primitive/day1-2:name";
+ }
+ }
+ }
+ }
+
+ augment "/vnfd:vnfd/vnfd:df/vnfd:scaling-aspect" {
+ uses extended-scaling;
+ }
+}
\ No newline at end of file