feat(configurations): now VNF/VDU/KDU configurations are in the same place, compatibl...
[osm/IM.git] / models / augments / scaling.yang
1 /*
2   Copyright 2020 Whitestack LLC
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13   implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16 */
17
18 module scaling {
19     yang-version 1.1;
20     namespace "urn:etsi:osm:yang:augments:scaling";
21     prefix "scaling";
22
23     import etsi-nfv-vnfd {
24         prefix vnfd;
25     }
26
27     import common-augments {
28         prefix common;
29     }
30
31     import day1-2 {
32         prefix day1-2;
33     }
34
35     grouping extended-scaling {
36         list scaling-policy {
37
38             key "name";
39
40             leaf name {
41                 description
42                   "Name of the scaling policy";
43                 type string;
44             }
45
46             leaf scaling-type {
47                 description
48                   "Type of scaling";
49                 type common:scaling-policy-type;
50             }
51
52             leaf enabled {
53                 description
54                   "Specifies if the scaling policy can be applied";
55                 type boolean;
56                 default true;
57             }
58
59             leaf scale-in-operation-type {
60                 description
61                   "Operation to be applied to check between scaling criterias to
62                    check if the scale in threshold condition has been met.
63                    Defaults to AND";
64                 type common:scaling-criteria-operation;
65                 default AND;
66             }
67
68             leaf scale-out-operation-type {
69                 description
70                   "Operation to be applied to check between scaling criterias to
71                    check if the scale out threshold condition has been met.
72                    Defauls to OR";
73                 type common:scaling-criteria-operation;
74                 default OR;
75             }
76
77             leaf threshold-time {
78                 description
79                   "The duration for which the criteria must hold true";
80                 type uint32;
81                 mandatory true;
82             }
83
84             leaf cooldown-time {
85                 description
86                   "The duration after a scaling-in/scaling-out action has been
87                    triggered, for which there will be no further optional";
88                 type uint32;
89                 mandatory true;
90             }
91
92             list scaling-criteria {
93                 description
94                   "list of conditions to be met for generating scaling
95                      requests";
96                 key "name";
97
98                 leaf name {
99                     type string;
100                 }
101
102                 leaf scale-in-threshold {
103                     description
104                       "Value below which scale-in requests are generated";
105                     type decimal64{
106                         fraction-digits 10;
107                     }
108                 }
109
110                 leaf scale-in-relational-operation {
111                     description
112                       "The relational operator used to compare the monitoring param
113                        against the scale-in-threshold.";
114                     type common:relational-operation-type;
115                     default LE;
116                 }
117
118                 leaf scale-out-threshold {
119                     description
120                       "Value above which scale-out requests are generated";
121                     type decimal64{
122                         fraction-digits 10;
123                     }
124                 }
125
126                 leaf scale-out-relational-operation {
127                     description
128                       "The relational operator used to compare the monitoring param
129                        against the scale-out-threshold.";
130                     type common:relational-operation-type;
131                     default GE;
132                 }
133
134                 leaf vnf-monitoring-param-ref {
135                     description
136                       "Reference to the VNF level monitoring parameter
137                        that is aggregated";
138                     type string;
139                     
140                 }
141             }
142         }
143
144         list scaling-config-action {
145             description
146               "List of scaling config actions";
147             key "trigger";
148
149             leaf trigger {
150                 description
151                   "scaling trigger";
152                 type common:scaling-trigger;
153             }
154
155             leaf vnf-config-primitive-name-ref {
156                 description
157                   "Reference to the VNF config primitive";
158                 type leafref {
159                     path "/vnfd:vnfd/vnfd:df/vnfd:lcm-operations-configuration/vnfd:operate-vnf-op-config/day1-2:day1-2/day1-2:config-primitive/day1-2:name";
160                 }
161             }
162         }
163     }
164
165     augment "/vnfd:vnfd/vnfd:df/vnfd:scaling-aspect" {
166         uses extended-scaling;
167     }
168 }