5d032f0664d484451d86a2b76c282aa7d456955e
[policy/drools-applications.git] /
1 {
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",
83                 "operations",
84                 "controllerName"
85             ],
86             "properties": {
87                 "id": {
88                     "$id": "#/properties/properties/properties/id",
89                     "type": "string",
90                     "title": "Control Loop Name",
91                     "examples": [
92                         "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e"
93                     ],
94                     "pattern": "^(.+)$"
95                 },
96                 "timeout": {
97                     "$id": "#/properties/properties/properties/timeout",
98                     "type": "integer",
99                     "title": "Timeout in seconds",
100                     "minimum": 1,
101                     "default": 30,
102                     "examples": [
103                         3600
104                     ]
105                 },
106                 "abatement": {
107                     "$id": "#/properties/properties/properties/abatement",
108                     "type": "boolean",
109                     "title": "Abatement",
110                     "default": false,
111                     "examples": [
112                         true
113                     ]
114                 },
115                 "trigger": {
116                     "$id": "#/properties/properties/properties/trigger",
117                     "type": "string",
118                     "title": "Trigger Operation",
119                     "examples": [
120                         "unique-policy-id-1-restart"
121                     ],
122                     "pattern": "^(.+)$"
123                 },
124                 "operations": {
125                     "$id": "#/properties/properties/properties/operations",
126                     "type": "array",
127                     "title": "Operations",
128                     "items": {
129                         "$id": "#/properties/properties/properties/operations/items",
130                         "type": "object",
131                         "title": "Items",
132                         "uniqueItems": true,
133                         "required": [
134                             "id",
135                             "operation",
136                             "timeout",
137                             "retries",
138                             "success",
139                             "failure"
140                         ],
141                         "properties": {
142                             "id": {
143                                 "$id": "#/properties/properties/properties/operations/items/properties/id",
144                                 "type": "string",
145                                 "title": "Operation Identifier",
146                                 "examples": [
147                                     "unique-policy-id-1-restart"
148                                 ],
149                                 "pattern": "^(.+)$"
150                             },
151                             "description": {
152                                 "$id": "#/properties/properties/properties/operations/items/properties/description",
153                                 "type": "string",
154                                 "title": "Description",
155                                 "examples": [
156                                     "Restart the VM"
157                                 ],
158                                 "pattern": "^(.+)$"
159                             },
160                             "operation": {
161                                 "$id": "#/properties/properties/properties/operations/items/properties/operation",
162                                 "type": "object",
163                                 "title": "Operation",
164                                 "required": [
165                                     "actor",
166                                     "operation",
167                                     "target"
168                                 ],
169                                 "properties": {
170                                     "actor": {
171                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/actor",
172                                         "type": "string",
173                                         "title": "Actor",
174                                         "examples": [
175                                             "APPC"
176                                         ],
177                                         "pattern": "^(.+)$"
178                                     },
179                                     "operation": {
180                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/operation",
181                                         "type": "string",
182                                         "title": "Operation Name",
183                                         "examples": [
184                                             "Restart"
185                                         ],
186                                         "pattern": "^(.+)$"
187                                     },
188                                     "target": {
189                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target",
190                                         "type": "object",
191                                         "title": "Target",
192                                         "required": [
193                                             "targetType"
194                                         ],
195                                         "properties": {
196                                             "targetType": {
197                                                 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/targetType",
198                                                 "type": "string",
199                                                 "title": "Target Type",
200                                                 "examples": [
201                                                     "VNF"
202                                                 ],
203                                                 "pattern": "^(.+)$"
204                                             },
205                                             "entityIds": {
206                                                 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/entityIds",
207                                                 "type": "object",
208                                                 "title": "Arbitrary Resource Identities",
209                                                 "examples": [
210                                                     "Eace933104d443b496b8.nodes.heat.vpg"
211                                                 ],
212                                                 "additionalProperties": {
213                                                     "type": "string",
214                                                     "pattern": "^(.+)$"
215                                                 }
216                                             }
217                                         }
218                                     },
219                                     "payload": {
220                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/payload",
221                                         "type": "object",
222                                         "title": "Payload",
223                                         "additionalProperties": {
224                                             "type": "string",
225                                             "pattern": "^(.+)$"
226                                         }
227                                     }
228                                 }
229                             },
230                             "timeout": {
231                                 "$id": "#/properties/properties/properties/operations/items/properties/timeout",
232                                 "type": "integer",
233                                 "title": "Operation Timeout in seconds",
234                                 "default": 10,
235                                 "minimum": 1,
236                                 "examples": [
237                                     1200
238                                 ]
239                             },
240                             "retries": {
241                                 "$id": "#/properties/properties/properties/operations/items/properties/retries",
242                                 "type": "integer",
243                                 "title": "Number of Retries",
244                                 "default": 0,
245                                 "examples": [
246                                     3
247                                 ]
248                             },
249                             "success": {
250                                 "$id": "#/properties/properties/properties/operations/items/properties/success",
251                                 "type": "string",
252                                 "title": "Success Treatment",
253                                 "default": "final_success",
254                                 "examples": [
255                                     "final_success",
256                                     "unique-policy-id-2"
257                                 ],
258                                 "pattern": "^(.+)$"
259                             },
260                             "failure": {
261                                 "$id": "#/properties/properties/properties/operations/items/properties/failure",
262                                 "type": "string",
263                                 "title": "Failure Treatment",
264                                 "default": "final_failure",
265                                 "examples": [
266                                     "final_failure",
267                                     "unique-policy-id-2"
268                                 ],
269                                 "pattern": "^(.+)$"
270                             },
271                             "failure_timeout": {
272                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_timeout",
273                                 "type": "string",
274                                 "title": "Failure Timeout Treatment",
275                                 "default": "final_failure_timeout",
276                                 "examples": [
277                                     "final_failure_timeout",
278                                     "unique-policy-id-2"
279                                 ],
280                                 "pattern": "^(.+)$"
281                             },
282                             "failure_retries": {
283                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_retries",
284                                 "type": "string",
285                                 "title": "Failure Retry Treatment",
286                                 "default": "final_failure_retries",
287                                 "examples": [
288                                     "final_failure_retries",
289                                     "unique-policy-id-2"
290                                 ],
291                                 "pattern": "^(.+)$"
292                             },
293                             "failure_exception": {
294                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_exception",
295                                 "type": "string",
296                                 "title": "Failure Exception Treatment",
297                                 "default": "",
298                                 "examples": [
299                                     "final_failure_exception",
300                                     "unique-policy-id-2"
301                                 ],
302                                 "pattern": "^(.+)$"
303                             },
304                             "failure_guard": {
305                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_guard",
306                                 "type": "string",
307                                 "title": "Failure Guard Treatment",
308                                 "default": "final_failure_guard",
309                                 "examples": [
310                                     "final_failure_guard",
311                                     "unique-policy-id-2"
312                                 ],
313                                 "pattern": "^(.+)$"
314                             }
315                         }
316                     }
317                 },
318                 "controllerName": {
319                     "$id": "#/properties/properties/properties/controllerName",
320                     "type": "string",
321                     "title": "Controller Name",
322                     "default": "",
323                     "examples": [
324                         "usecases"
325                     ],
326                     "pattern": "^(.+)$"
327                 }
328             }
329         }
330     }
331 }