e3569f12292e232a7838fdaff1ea41c6b4ad719c
[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                                             "type"
194                                         ],
195                                         "properties": {
196                                             "type": {
197                                                 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/type",
198                                                 "type": "string",
199                                                 "title": "Target Type",
200                                                 "examples": [
201                                                     "VNF"
202                                                 ],
203                                                 "pattern": "^(.+)$"
204                                             },
205                                             "resourceID": {
206                                                 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/resourceID",
207                                                 "type": "string",
208                                                 "title": "Resource ID",
209                                                 "examples": [
210                                                     "Eace933104d443b496b8.nodes.heat.vpg"
211                                                 ],
212                                                 "pattern": "^(.+)$"
213                                             }
214                                         }
215                                     },
216                                     "payload": {
217                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/payload",
218                                         "type": "object",
219                                         "title": "Payload",
220                                         "additionalProperties": {
221                                             "type": "string"
222                                         }
223                                     }
224                                 }
225                             },
226                             "timeout": {
227                                 "$id": "#/properties/properties/properties/operations/items/properties/timeout",
228                                 "type": "integer",
229                                 "title": "Operation Timeout in seconds",
230                                 "default": 10,
231                                 "minimum": 1,
232                                 "examples": [
233                                     1200
234                                 ]
235                             },
236                             "retries": {
237                                 "$id": "#/properties/properties/properties/operations/items/properties/retries",
238                                 "type": "integer",
239                                 "title": "Number of Retries",
240                                 "default": 0,
241                                 "examples": [
242                                     3
243                                 ]
244                             },
245                             "success": {
246                                 "$id": "#/properties/properties/properties/operations/items/properties/success",
247                                 "type": "string",
248                                 "title": "Success Treatment",
249                                 "default": "final_success",
250                                 "examples": [
251                                     "final_success",
252                                     "unique-policy-id-2"
253                                 ],
254                                 "pattern": "^(.+)$"
255                             },
256                             "failure": {
257                                 "$id": "#/properties/properties/properties/operations/items/properties/failure",
258                                 "type": "string",
259                                 "title": "Failure Treatment",
260                                 "default": "final_failure",
261                                 "examples": [
262                                     "final_failure",
263                                     "unique-policy-id-2"
264                                 ],
265                                 "pattern": "^(.+)$"
266                             },
267                             "failure_timeout": {
268                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_timeout",
269                                 "type": "string",
270                                 "title": "Failure Timeout Treatment",
271                                 "default": "final_failure_timeout",
272                                 "examples": [
273                                     "final_failure_timeout",
274                                     "unique-policy-id-2"
275                                 ],
276                                 "pattern": "^(.+)$"
277                             },
278                             "failure_retries": {
279                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_retries",
280                                 "type": "string",
281                                 "title": "Failure Retry Treatment",
282                                 "default": "final_failure_retries",
283                                 "examples": [
284                                     "final_failure_retries",
285                                     "unique-policy-id-2"
286                                 ],
287                                 "pattern": "^(.+)$"
288                             },
289                             "failure_exception": {
290                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_exception",
291                                 "type": "string",
292                                 "title": "Failure Exception Treatment",
293                                 "default": "",
294                                 "examples": [
295                                     "final_failure_exception",
296                                     "unique-policy-id-2"
297                                 ],
298                                 "pattern": "^(.+)$"
299                             },
300                             "failure_guard": {
301                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_guard",
302                                 "type": "string",
303                                 "title": "Failure Guard Treatment",
304                                 "default": "final_failure_guard",
305                                 "examples": [
306                                     "final_failure_guard",
307                                     "unique-policy-id-2"
308                                 ],
309                                 "pattern": "^(.+)$"
310                             }
311                         }
312                     }
313                 },
314                 "controllerName": {
315                     "$id": "#/properties/properties/properties/controllerName",
316                     "type": "string",
317                     "title": "Controller Name",
318                     "default": "",
319                     "examples": [
320                         "usecases"
321                     ],
322                     "pattern": "^(.+)$"
323                 }
324             }
325         }
326     }
327 }