Add Day-1 and Day-2 configuration augment
[osm/IM.git] / augments / common-augments.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 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         }
155     } 
156
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     }
318 }