-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathpolicy-schema.yml
341 lines (337 loc) · 11.4 KB
/
policy-schema.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
## Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO
## ALL RIGHTS RESERVED.
##
## 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.
##
## Neither the name of the SONATA-NFV, 5GTANGO
## nor the names of its contributors may be used to endorse or promote
## products derived from this software without specific prior written
## permission.
##
## This work has been performed in the framework of the SONATA project,
## funded by the European Commission under Grant number 671517 through
## the Horizon 2020 and 5G-PPP programmes. The authors would like to
## acknowledge the contributions of their colleagues of the SONATA
## partner consortium (www.sonata-nfv.eu).
##
## This work has been performed in the framework of the 5GTANGO project,
## funded by the European Commission under Grant number 761493 through
## the Horizon 2020 and 5G-PPP programmes. The authors would like to
## acknowledge the contributions of their colleagues of the 5GTANGO
## partner consortium (www.5gtango.eu).
---
$schema: "http://json-schema.org/draft-04/schema#"
title: "Policy Descriptor Schema"
version: 0.1
description: "The core schema for SONATA policy descriptors."
##
## Some definitions used later on.
##
definitions:
time_units:
enum:
- "s" # seconds
- "m" # minutes
- "h" # hours
- "d" # days
aggregation_function:
enum:
- "avg" # average
- "min" # min
- "max" # max
operator:
enum:
- "less" # less
- "equal" # equal
- "greater" # greater
input:
enum:
- "number" # number
- "select" # select
logicalOperator:
enum:
- "AND" # AND
- "OR" # OR
profile_tag:
enum:
- "under_attack" # under_attack
- "mis_performed" # mis_performed
- "low_energy" # mis_performed
- "Green" # mis_performed
action_object:
enum:
- "ComponentResourceAllocationAction" # ComponentResourceAllocationAction
- "NetworkManagementAction" # NetworkManagementAction
- "ElasticityAction" # ElasticityAction
action_type:
enum:
- "Infrastracture" # InfraAction can be applied to a VNF/VDU. Is infrastracture related and can be either a new flavoId or a migration
- "Orchestration" # ElasticityAction. Is a loadBalancerAction such as setBalancingAlgorith or Spawn, Deprovision
- "LifecycleManagement" # LifecycleManagement
- "NetworkMechanism" # ActivateNetworkMechanism
- "AlterConfiguration" # AlterConfigurationAction
- "Profile" # Add/remove a new profile
- "Log" # Log
action_description:
enum:
- "ApplyFlavour" # Infrastracture
- "Migrate" # Infrastracture
- "LoadBalancer.setBalancingAlgorithm" # Orchestration
- "LoadBalancer.Spawn" # Orchestration
- "LoadBalancer.Deprovision" # Orchestration
- "start" # LifecycleManagement
- "stop" # LifecycleManagement
- "restart" # LifecycleManagement
- "MonitorEndToEndDelay" # NetworkMechanism
- "ProvideDedicatedBandwidth" # NetworkMechanism
- "setProfile" # Profile
- "other" # AlterConfiguration && Log
expression:
type: "object"
properties:
id:
description: "The name of the expression parameter. The name has to be supported by the service platform or the FSM."
type: "string"
field:
description: "The field name of the expression parameter. The name has to be supported by the service platform or the FSM."
type: "string"
type:
description: "The type of the parameter."
type: "string"
input:
description: "The input type of the parameter."
$ref: "#/definitions/input"
operator:
description: "The operator of the expression."
$ref: "#/definitions/operator"
value:
description: "The threshold value of the parameter."
type: "string"
required:
- id
- field
- type
- operator
- value
fullExpression:
description: "A set of expressions bind between them with logical operators."
type: "object"
properties:
condition:
description: "The operator AND / OR."
$ref: "#/definitions/logicalOperator"
rules:
description: "The set of expressions."
type: "array"
items:
description: "An FSM object of this VNF. FSMs are always Docker containers."
$ref: "#/definitions/expression"
required:
- condition
- rules
setOfExpressions:
description: "An expression with the optional condition."
type: "object"
properties:
rules:
description: "The set of expressions."
type: "array"
items:
description: "An FSM object of this VNF. FSMs are always Docker containers."
$ref: "#/definitions/fullExpression"
required:
- rules
##
## The actual document description.
##
type: "object"
properties:
descriptor_schema:
description: "Reference to the schema corresponding to the descriptor (e.g., URL or local path)."
type: "string"
name:
description: "The name of the policy description."
type: "string"
pattern: "^[A-Za-z0-9\\-_.]+$"
vendor:
description: "The vendor id allows to identify a policy descriptor uniquely across all policy descriptor vendors."
type: "string"
pattern: "^[A-Za-z0-9\\-_.]+$"
version:
description: "The version of the service descriptor."
type: "string"
pattern: "^[0-9\\-_.]+$"
description:
description: "A longer description of the policy."
type: "string"
author:
description: "The person or organization that created the policy descriptor."
type: "string"
network_service:
description: "The network service this policy is applied to."
type: "object"
properties:
vendor:
description: "The vendor id allows to identify a VNF descriptor uniquely across all function descriptor vendors."
type: "string"
pattern: "^[A-Za-z0-9\\-_.]+$"
name:
description: "The name of the network service description."
type: "string"
pattern: "^[A-Za-z0-9\\-_.]+$"
version:
description: "The version of the service descriptor."
type: "string"
pattern: "^[0-9\\-_.]+$"
monitoring_rules:
type: "array"
items:
type: "object"
properties:
name:
description: "The name of the monitoring rule."
type: "string"
description:
description: "An arbitrary descritpion of this monitoring rule."
type: "string"
duration:
description: "The duration the condtion has to be met before an event is fired."
type: "number"
duration_unit:
description: "The unit of the durration."
ref: "#/definitions/time_units"
condition:
description: "The condition that must be met to fire the event."
type: "string"
threshold:
description: "The threshold that must be met to fire the event."
type: "string"
required:
- name
- duration
- condition
- threshold
required:
- vendor
- name
- version
policyRules:
description: "A list of Policy rules used to compose this Policy."
type: "array"
items:
description: "A rule of the current policy"
type: "object"
properties:
name:
description: "The name of the policy rule."
type: "string"
salience:
description: "The salience of the policy rule."
type: "number"
inertia:
description: "The inertia period of the policy rule."
type: "object"
properties:
value:
description: "The duration value of the inertia period."
type: "number"
duration_unit:
description: "The unit of the duration."
ref: "#/definitions/time_units"
required:
- value
- duration_unit
duration:
description: "The duration the condition has to be met before an event is fired."
type: "object"
properties:
value:
description: "The duration value."
type: "number"
duration_unit:
description: "The unit of the duration."
ref: "#/definitions/time_units"
required:
- value
- duration_unit
aggregation:
description: "The unit of the duration."
ref: "#/definitions/aggregation_function"
conditions:
description: "The set of conditions, that must be met to fire the event."
ref: "#/definitions/setOfExpressions"
actions:
description: "A list of notifications that are fired when the condition is met."
type: "array"
items:
type: "object"
properties:
action_type:
description: "The type of the action that is send to the message bus."
ref: "#/definitions/action_type"
name:
description: "The description of the action"
ref: "#/definitions/action_description"
value:
description: "The value of the action"
type: "string"
profile_tag:
description: "A profile tag"
ref: "#/definitions/profile_tag"
target:
description: "The component to apply the action"
type: "object"
properties:
vendor:
description: "The vendor id allows to identify a VNF descriptor uniquely across all function descriptor vendors."
type: "string"
pattern: "^[A-Za-z0-9\\-_.]+$"
name:
description: "The name of the network service description."
type: "string"
pattern: "^[A-Za-z0-9\\-_.]+$"
version:
description: "The version of the service descriptor."
type: "string"
pattern: "^[0-9\\-_.]+$"
stability_period:
description: "The inertia period of the policy rule."
type: "object"
properties:
value:
description: "The duration value of the inertia period."
type: "number"
duration_unit:
description: "The unit of the duration."
ref: "#/definitions/time_units"
required:
- value
- duration_unit
required:
- action_type
- name
- target
required:
- name
- conditions
- actions
uniqueItems: true
minItems: 1
required:
- descriptor_schema
- name
- vendor
- version
- network_service
- policyRules
additionalProperties: false