blob: 7beec8905ffba0a60109e6c56527b8dead902efc [file] [log] [blame]
Tomás Villaseca78f1c932020-01-28 16:27:35 -03001/*
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
18module common-augments {
19 yang-version 1.1;
20 namespace "urn:etsi:osm:yang:augments";
21 prefix "common";
22
23 typedef parameter-data-type {
24 type enumeration {
25 enum STRING;
26 enum INTEGER;
27 enum BOOLEAN;
28 }
29 }
30
31 grouping primitive-parameter-value {
32 list parameter {
33 description
34 "List of parameters to the configuration primitive.";
35 key "name";
36 leaf name {
37 description
38 "Name of the parameter.";
39 type string;
40 }
41
42 leaf data-type {
43 description
44 "Data type associated with the value.";
45 type common:parameter-data-type;
46 }
47
48 leaf value {
49 description
50 "Value associated with the name.";
51 type string;
52 }
53 }
54 }
55
56 grouping primitive-parameter {
57 leaf name {
58 description
59 "Name of the parameter.";
60 type string;
61 }
62
63 leaf data-type {
64 description
65 "Data type associated with the name.";
66 type common:parameter-data-type;
67 }
68
69 leaf mandatory {
70 description
71 "Is this field mandatory";
72 type boolean;
73 default false;
74 }
75
76 leaf default-value {
77 description
78 "The default value for this field";
79 type string;
80 }
81
82 leaf parameter-pool {
83 description
84 "NSD parameter pool name to use for this parameter";
85 type string;
86 }
87
88 leaf read-only {
89 description
90 "The value should be dimmed by the UI.
91 Only applies to parameters with default values.";
92 type boolean;
93 default false;
94 }
95
96 leaf hidden {
97 description
98 "The value should be hidden by the UI.
99 Only applies to parameters with default values.";
100 type boolean;
101 default false;
102 }
103 }
104
105 grouping vnfc-relations {
106 list relation {
107 description
108 "List of relations between elements in this descriptor.";
109 key "name";
110
111 leaf name {
112 description
113 "Name of the relation.";
114
115 type string;
116 }
117
118 list entities {
119 description
120 "List of two elements to be related.
121 Elements to be related are identified by a pair (id, endpoint).
122 The relation will relate (id1, endpoint1) to (id2, endpoint2).";
123 key "id";
124
125 leaf id {
126 description
127 "A string, reference to the element id in the descriptor.
128 It could be a vnfd-id or a vdu-id in a VNFD,
129 or a nsd-id or member-vnf-index in a NSD.";
130 type string;
131 }
132
133 leaf endpoint {
134 description
135 "Endpoint name defining the relation.";
136 type string;
137 }
138 }
139 }
140 }
141
142 grouping vnfc-metrics {
143 description
144 "Information about the VNF or VDU metrics";
145 list metrics {
146 description
147 "List of VNFC related metrics";
148 key "name";
149 leaf name {
150 description
151 "Name of the metric, as defined in the Juju charm.";
152 type string;
153 }
154 }
Tomás Villasecaf8821fc2020-02-18 15:04:02 -0300155 }
Tomás Villaseca78f1c932020-01-28 16:27:35 -0300156
157 grouping configuration-method {
158 choice config-method {
159 description
160 "Defines the configuration method for the VNF or VDU.";
161 case script {
162 description
163 "Use custom script for configuring the VNF or VDU.
164 This script is executed in the context of
165 Orchestrator (The same system and environment
166 as the Launchpad).";
167 container script {
168 leaf script-type {
169 description
170 "Script type - currently supported - Scripts confirming to Rift CA plugin";
171 type enumeration {
172 enum rift;
173 }
174 }
175 }
176 }
177
178 case juju {
179 description
180 "Configure the VNF or VDU through Juju.";
181 container juju {
182 leaf charm {
183 description
184 "Juju charm to use with the VNF or VDU.";
185 type string;
186 }
187 leaf proxy {
188 description
189 "Is this a proxy charm?";
190 type boolean;
191 default true;
192 }
193 }
194 }
195 }
196 }
197
198 grouping vdu-config-access {
199
200 container config-access {
201
202 description
203 "Indicates the way to access to the xNF or xDU for VCA configuration.
204 For the moment there is a single way (ssh-access).";
205
206 container ssh-access {
207
208 description
209 "If the xNF requires ssh and this parameter is set, SSH keys
210 will be injected so that VCA can configure the xNF or xDU via ssh.";
211
212 leaf required {
213 description
214 "whether ssh access is needed or not";
215 type boolean;
216 default false;
217 }
218
219 leaf default-user {
220 description
221 "Default user for ssh";
222 type string;
223 }
224 }
225 }
226 }
227
228 grouping vnfc-configuration {
229 description
230 "Common information in the descriptors for NS, VNF or VDU configuration.
231 Note: If the NS contains multiple instances of the
232 same VNF or VDU, each instance could have a different
233 configuration.";
234
235 uses common:configuration-method;
236
237 list config-primitive {
238 description
239 "List of config primitives supported by the
240 configuration agent for this VNF or VDU.";
241 key "name";
242
243 leaf name {
244 description
245 "Name of the config primitive.";
246 type string;
247 }
248
249 list parameter {
250 description
251 "List of parameters to the config primitive.";
252 key "name";
253 uses primitive-parameter;
254 }
255
256 leaf user-defined-script {
257 description
258 "A user defined script. If user defined script is defined,
259 the script will be executed using bash";
260 type string;
261 }
262 }
263
264 list initial-config-primitive {
265 description
266 "Initial set of configuration primitives.";
267 key "seq";
268 leaf seq {
269 description
270 "Sequence number for the configuration primitive.";
271 type uint64;
272 }
273
274 choice primitive-type {
275 case primitive-definition {
276 leaf name {
277 description
278 "Name of the configuration primitive.";
279 type string;
280 }
281
282 uses primitive-parameter-value;
283
284 leaf user-defined-script {
285 description
286 "A user defined script.";
287 type string;
288 }
289 }
290 }
291 }
292
293 list terminate-config-primitive {
294 description
295 "Terminate set of configuration primitives.";
296 key "seq";
297 leaf seq {
298 description
299 "Sequence number for the configuration primitive.";
300 type uint64;
301 }
302 leaf name {
303 description
304 "Name of the configuration primitive.";
305 type string;
306 }
307
308 uses primitive-parameter-value;
309
310 leaf user-defined-script {
311 description
312 "A user defined script.";
313 type string;
314 }
315 }
316 uses common:vnfc-metrics;
317 }
Tomás Villasecaf8821fc2020-02-18 15:04:02 -0300318
319 typedef alarm-severity-type {
320 description
321 "An indication of the importance or urgency of the alarm";
322 type enumeration {
323 enum LOW;
324 enum MODERATE;
325 enum CRITICAL;
326 }
327 }
328
329 typedef alarm-statistic-type {
330 description
331 "Statistic type to use to determine threshold crossing
332 for an alarm.";
333 type enumeration {
334 enum AVERAGE;
335 enum MINIMUM;
336 enum MAXIMUM;
337 enum COUNT;
338 enum SUM;
339 }
340 }
341
342 typedef relational-operation-type {
343 description
344 "The relational operator used to define whether an alarm,
345 scaling event, etc. should be triggered in certain scenarios,
346 such as if the metric statistic goes above or below a specified
347 value.";
348 type enumeration {
349 enum GE; // greater than or equal
350 enum LE; // less than or equal
351 enum GT; // greater than
352 enum LT; // less than
353 enum EQ; // equal
354 }
355 }
356
357 grouping alarm-properties {
358 leaf name {
359 description
360 "A human readable string to identify the alarm";
361 type string;
362 }
363
364 leaf description {
365 description
366 "A description of this alarm";
367 type string;
368 }
369
370 leaf vdur-id {
371 description
372 "The identifier of the VDUR that the alarm is associated with";
373 type string;
374 }
375
376 container actions {
377 list ok {
378 key "url";
379 leaf url {
380 type string;
381 }
382 }
383
384 list insufficient-data {
385 key "url";
386 leaf url {
387 type string;
388 }
389 }
390
391 list alarm {
392 key "url";
393 leaf url {
394 type string;
395 }
396 }
397 }
398
399 leaf repeat {
400 description
401 "This flag indicates whether the alarm should be repeatedly emitted
402 while the associated threshold has been crossed.";
403
404 type boolean;
405 default true;
406 }
407
408 leaf enabled {
409 description
410 "This flag indicates whether the alarm has been enabled or
411 disabled.";
412
413 type boolean;
414 default true;
415 }
416
417 leaf severity {
418 description
419 "A measure of the importance or urgency of the alarm";
420 type alarm-severity-type;
421 }
422
423 leaf statistic {
424 description
425 "The type of metric statistic that is tracked by this alarm";
426 type alarm-statistic-type;
427 }
428
429 leaf operation {
430 description
431 "The relational operator used to define whether an alarm should be
432 triggered in certain scenarios, such as if the metric statistic
433 goes above or below a specified value.";
434 type relational-operation-type;
435 }
436
437 leaf value {
438 description
439 "This value defines the threshold that, if crossed, will trigger
440 the alarm.";
441 type decimal64 {
442 fraction-digits 4;
443 }
444 }
445
446 leaf period {
447 description
448 "The period defines the length of time (seconds) that the metric
449 data are collected over in oreder to evaluate the chosen
450 statistic.";
451 type uint32;
452 }
453
454 leaf evaluations {
455 description
456 "Defines the length of time (seconds) in which metric data are
457 collected in order to evaluate the chosen statistic.";
458 type uint32;
459 }
460 }
Tomás Villasecad01dd4e2020-02-19 15:38:39 -0300461
462 grouping virtual-interface {
463 container virtual-interface {
464 description
465 "Container for the virtual interface properties";
466
467 leaf type {
468 description
469 "Specifies the type of virtual interface
470 between VM and host.
471 PARAVIRT : Use the default paravirtualized interface for the VIM (virtio, vmxnet3, etc.).
472 VIRTIO : Deprecated! Use the traditional VIRTIO interface.
473 PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
474 SR-IOV : Use SR-IOV interface.
475 E1000 : Emulate E1000 interface.
476 RTL8139 : Emulate RTL8139 interface.
477 PCNET : Emulate PCNET interface.
478 OM-MGMT : Deprecated! Use PARAVIRT instead and set the VNF management interface at vnfd:mgmt-interface:cp";
479
480 type enumeration {
481 enum PARAVIRT;
482 enum OM-MGMT;
483 enum PCI-PASSTHROUGH;
484 enum SR-IOV;
485 enum VIRTIO;
486 enum E1000;
487 enum RTL8139;
488 enum PCNET;
489 }
490 default "PARAVIRT";
491 }
492
493 leaf vpci {
494 description
495 "Specifies the virtual PCI address. Expressed in
496 the following format dddd:dd:dd.d. For example
497 0000:00:12.0. This information can be used to
498 pass as metadata during the VM creation.";
499 type string;
500 }
501
502 leaf bandwidth {
503 description
504 "Aggregate bandwidth of the NIC.";
505 type uint64;
506 }
507 }
508 }
Tomás Villasecab0673982020-02-19 17:04:12 -0300509
510 grouping description {
511 leaf description {
512 type string;
513 }
514 }
Tomás Villaseca000f8172020-02-20 20:01:56 -0300515
516 typedef scaling-trigger {
517 type enumeration {
518 enum pre-scale-in {
519 value 1;
520 }
521 enum post-scale-in {
522 value 2;
523 }
524 enum pre-scale-out {
525 value 3;
526 }
527 enum post-scale-out {
528 value 4;
529 }
530 }
531 }
532
533 typedef scaling-policy-type {
534 type enumeration {
535 enum manual {
536 value 1;
537 }
538 enum automatic {
539 value 2;
540 }
541 }
542 }
543
544 typedef scaling-criteria-operation {
545 type enumeration {
546 enum AND {
547 value 1;
548 }
549 enum OR {
550 value 2;
551 }
552 }
553 }
Tomás Villasecad01dd4e2020-02-19 15:38:39 -0300554}