blob: a7dbf8b0ebacf60f404355e506920bc1c2295cc5 [file] [log] [blame]
jhhbaa4e922020-01-30 18:57:13 -06001{
2 "definitions": {},
3 "$schema": "http://json-schema.org/draft-07/schema#",
4 "$id": "http://www.onap.org/policy/models/schemas/onap.policies.controlloop.operational.common.Drools.schema.json",
5 "type": "object",
6 "title": "The Root Schema",
7 "required": [
8 "type",
9 "type_version",
10 "version",
11 "metadata",
12 "properties"
13 ],
14 "properties": {
15 "type": {
16 "$id": "#/properties/type",
17 "type": "string",
18 "title": "Policy Type",
19 "default": "onap.policies.controlloop.operational.common.Drools",
20 "examples": [
21 "onap.policies.controlloop.operational.common.Drools"
22 ],
23 "pattern": "^(.+)$"
24 },
25 "type_version": {
26 "$id": "#/properties/type_version",
27 "type": "string",
28 "title": "Policy Type Version",
29 "default": "1.0.0",
30 "examples": [
31 "1.0.0"
32 ],
33 "pattern": "^(.+)$"
34 },
35 "name": {
36 "$id": "#/properties/name",
37 "type": "string",
38 "title": "Policy Name",
39 "default": "",
40 "examples": [
41 "example"
42 ],
43 "pattern": "^(.*)$"
44 },
45 "version": {
46 "$id": "#/properties/version",
47 "type": "string",
48 "title": "Policy Version",
49 "default": "1.0.0",
50 "examples": [
51 "1.0.0"
52 ],
53 "pattern": "^(.+)$"
54 },
55 "metadata": {
56 "$id": "#/properties/metadata",
57 "type": "object",
58 "title": "Metadata",
59 "required": [
60 "policy-id"
61 ],
62 "properties": {
63 "policy-id": {
64 "$id": "#/properties/metadata/properties/policy-id",
65 "type": "string",
66 "title": "Policy ID",
67 "examples": [
68 "operational.restart"
69 ],
70 "pattern": "^(.+)$"
71 }
72 }
73 },
74 "properties": {
75 "$id": "#/properties/properties",
76 "type": "object",
77 "title": "Properties",
78 "required": [
79 "id",
80 "timeout",
81 "abatement",
82 "trigger",
jhh3f563fe2020-03-05 22:32:58 -060083 "operations"
jhhbaa4e922020-01-30 18:57:13 -060084 ],
85 "properties": {
86 "id": {
87 "$id": "#/properties/properties/properties/id",
88 "type": "string",
89 "title": "Control Loop Name",
90 "examples": [
91 "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e"
92 ],
93 "pattern": "^(.+)$"
94 },
95 "timeout": {
96 "$id": "#/properties/properties/properties/timeout",
97 "type": "integer",
98 "title": "Timeout in seconds",
99 "minimum": 1,
100 "default": 30,
101 "examples": [
102 3600
103 ]
104 },
105 "abatement": {
106 "$id": "#/properties/properties/properties/abatement",
107 "type": "boolean",
108 "title": "Abatement",
109 "default": false,
110 "examples": [
111 true
112 ]
113 },
114 "trigger": {
115 "$id": "#/properties/properties/properties/trigger",
116 "type": "string",
117 "title": "Trigger Operation",
118 "examples": [
119 "unique-policy-id-1-restart"
120 ],
121 "pattern": "^(.+)$"
122 },
123 "operations": {
124 "$id": "#/properties/properties/properties/operations",
125 "type": "array",
126 "title": "Operations",
127 "items": {
128 "$id": "#/properties/properties/properties/operations/items",
129 "type": "object",
130 "title": "Items",
131 "uniqueItems": true,
132 "required": [
133 "id",
jhhbaa4e922020-01-30 18:57:13 -0600134 "operation",
135 "timeout",
136 "retries",
137 "success",
jhhea642542020-02-06 15:17:20 -0600138 "failure"
jhhbaa4e922020-01-30 18:57:13 -0600139 ],
140 "properties": {
141 "id": {
142 "$id": "#/properties/properties/properties/operations/items/properties/id",
143 "type": "string",
144 "title": "Operation Identifier",
145 "examples": [
146 "unique-policy-id-1-restart"
147 ],
148 "pattern": "^(.+)$"
149 },
150 "description": {
151 "$id": "#/properties/properties/properties/operations/items/properties/description",
152 "type": "string",
153 "title": "Description",
154 "examples": [
155 "Restart the VM"
156 ],
157 "pattern": "^(.+)$"
158 },
159 "operation": {
160 "$id": "#/properties/properties/properties/operations/items/properties/operation",
161 "type": "object",
162 "title": "Operation",
163 "required": [
164 "actor",
jhhea642542020-02-06 15:17:20 -0600165 "operation",
jhhbaa4e922020-01-30 18:57:13 -0600166 "target"
167 ],
168 "properties": {
169 "actor": {
170 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/actor",
171 "type": "string",
172 "title": "Actor",
173 "examples": [
174 "APPC"
175 ],
176 "pattern": "^(.+)$"
177 },
jhhea642542020-02-06 15:17:20 -0600178 "operation": {
179 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/operation",
jhhbaa4e922020-01-30 18:57:13 -0600180 "type": "string",
jhhea642542020-02-06 15:17:20 -0600181 "title": "Operation Name",
jhhbaa4e922020-01-30 18:57:13 -0600182 "examples": [
183 "Restart"
184 ],
185 "pattern": "^(.+)$"
186 },
187 "target": {
188 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target",
189 "type": "object",
190 "title": "Target",
191 "required": [
jhhad08c162020-02-20 18:15:40 -0600192 "targetType"
jhhbaa4e922020-01-30 18:57:13 -0600193 ],
194 "properties": {
jhhad08c162020-02-20 18:15:40 -0600195 "targetType": {
196 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/targetType",
jhhbaa4e922020-01-30 18:57:13 -0600197 "type": "string",
198 "title": "Target Type",
199 "examples": [
200 "VNF"
201 ],
202 "pattern": "^(.+)$"
jhhfe4f6e12020-02-26 18:30:18 -0600203 },
204 "entityIds": {
205 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/entityIds",
206 "type": "object",
207 "title": "Arbitrary Resource Identities",
208 "examples": [
209 "Eace933104d443b496b8.nodes.heat.vpg"
210 ],
211 "additionalProperties": {
212 "type": "string",
213 "pattern": "^(.+)$"
214 }
jhhbaa4e922020-01-30 18:57:13 -0600215 }
216 }
jhhea642542020-02-06 15:17:20 -0600217 },
218 "payload": {
219 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/payload",
220 "type": "object",
221 "title": "Payload",
222 "additionalProperties": {
jhhfe4f6e12020-02-26 18:30:18 -0600223 "type": "string",
224 "pattern": "^(.+)$"
jhhea642542020-02-06 15:17:20 -0600225 }
jhhbaa4e922020-01-30 18:57:13 -0600226 }
227 }
228 },
229 "timeout": {
230 "$id": "#/properties/properties/properties/operations/items/properties/timeout",
231 "type": "integer",
232 "title": "Operation Timeout in seconds",
233 "default": 10,
234 "minimum": 1,
235 "examples": [
236 1200
237 ]
238 },
239 "retries": {
240 "$id": "#/properties/properties/properties/operations/items/properties/retries",
241 "type": "integer",
242 "title": "Number of Retries",
243 "default": 0,
244 "examples": [
245 3
246 ]
247 },
248 "success": {
249 "$id": "#/properties/properties/properties/operations/items/properties/success",
250 "type": "string",
251 "title": "Success Treatment",
252 "default": "final_success",
253 "examples": [
254 "final_success",
255 "unique-policy-id-2"
256 ],
257 "pattern": "^(.+)$"
258 },
259 "failure": {
260 "$id": "#/properties/properties/properties/operations/items/properties/failure",
261 "type": "string",
262 "title": "Failure Treatment",
263 "default": "final_failure",
264 "examples": [
265 "final_failure",
266 "unique-policy-id-2"
267 ],
268 "pattern": "^(.+)$"
269 },
270 "failure_timeout": {
271 "$id": "#/properties/properties/properties/operations/items/properties/failure_timeout",
272 "type": "string",
273 "title": "Failure Timeout Treatment",
274 "default": "final_failure_timeout",
275 "examples": [
276 "final_failure_timeout",
277 "unique-policy-id-2"
278 ],
279 "pattern": "^(.+)$"
280 },
281 "failure_retries": {
282 "$id": "#/properties/properties/properties/operations/items/properties/failure_retries",
283 "type": "string",
jhhea642542020-02-06 15:17:20 -0600284 "title": "Failure Retry Treatment",
jhhbaa4e922020-01-30 18:57:13 -0600285 "default": "final_failure_retries",
286 "examples": [
287 "final_failure_retries",
288 "unique-policy-id-2"
289 ],
290 "pattern": "^(.+)$"
291 },
292 "failure_exception": {
293 "$id": "#/properties/properties/properties/operations/items/properties/failure_exception",
294 "type": "string",
295 "title": "Failure Exception Treatment",
296 "default": "",
297 "examples": [
298 "final_failure_exception",
299 "unique-policy-id-2"
300 ],
301 "pattern": "^(.+)$"
302 },
303 "failure_guard": {
304 "$id": "#/properties/properties/properties/operations/items/properties/failure_guard",
305 "type": "string",
306 "title": "Failure Guard Treatment",
307 "default": "final_failure_guard",
308 "examples": [
309 "final_failure_guard",
310 "unique-policy-id-2"
311 ],
312 "pattern": "^(.+)$"
313 }
314 }
315 }
316 },
317 "controllerName": {
318 "$id": "#/properties/properties/properties/controllerName",
319 "type": "string",
320 "title": "Controller Name",
321 "default": "",
322 "examples": [
323 "usecases"
324 ],
325 "pattern": "^(.+)$"
326 }
327 }
328 }
329 }
330}