8548f7f765aa3d50643e2a86c58a735860f6d7f6
[policy/drools-pdp.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                             "description",
136                             "operation",
137                             "timeout",
138                             "retries",
139                             "success",
140                             "failure",
141                             "failure_timeout",
142                             "failure_retries",
143                             "failure_exception",
144                             "failure_guard"
145                         ],
146                         "properties": {
147                             "id": {
148                                 "$id": "#/properties/properties/properties/operations/items/properties/id",
149                                 "type": "string",
150                                 "title": "Operation Identifier",
151                                 "examples": [
152                                     "unique-policy-id-1-restart"
153                                 ],
154                                 "pattern": "^(.+)$"
155                             },
156                             "description": {
157                                 "$id": "#/properties/properties/properties/operations/items/properties/description",
158                                 "type": "string",
159                                 "title": "Description",
160                                 "examples": [
161                                     "Restart the VM"
162                                 ],
163                                 "pattern": "^(.+)$"
164                             },
165                             "operation": {
166                                 "$id": "#/properties/properties/properties/operations/items/properties/operation",
167                                 "type": "object",
168                                 "title": "Operation",
169                                 "required": [
170                                     "actor",
171                                     "recipe",
172                                     "target"
173                                 ],
174                                 "properties": {
175                                     "actor": {
176                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/actor",
177                                         "type": "string",
178                                         "title": "Actor",
179                                         "examples": [
180                                             "APPC"
181                                         ],
182                                         "pattern": "^(.+)$"
183                                     },
184                                     "recipe": {
185                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/recipe",
186                                         "type": "string",
187                                         "title": "Recipe",
188                                         "examples": [
189                                             "Restart"
190                                         ],
191                                         "pattern": "^(.+)$"
192                                     },
193                                     "target": {
194                                         "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target",
195                                         "type": "object",
196                                         "title": "Target",
197                                         "required": [
198                                             "type"
199                                         ],
200                                         "properties": {
201                                             "type": {
202                                                 "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/type",
203                                                 "type": "string",
204                                                 "title": "Target Type",
205                                                 "examples": [
206                                                     "VNF"
207                                                 ],
208                                                 "pattern": "^(.+)$"
209                                             }
210                                         }
211                                     }
212                                 }
213                             },
214                             "timeout": {
215                                 "$id": "#/properties/properties/properties/operations/items/properties/timeout",
216                                 "type": "integer",
217                                 "title": "Operation Timeout in seconds",
218                                 "default": 10,
219                                 "minimum": 1,
220                                 "examples": [
221                                     1200
222                                 ]
223                             },
224                             "retries": {
225                                 "$id": "#/properties/properties/properties/operations/items/properties/retries",
226                                 "type": "integer",
227                                 "title": "Number of Retries",
228                                 "default": 0,
229                                 "examples": [
230                                     3
231                                 ]
232                             },
233                             "success": {
234                                 "$id": "#/properties/properties/properties/operations/items/properties/success",
235                                 "type": "string",
236                                 "title": "Success Treatment",
237                                 "default": "final_success",
238                                 "examples": [
239                                     "final_success",
240                                     "unique-policy-id-2"
241                                 ],
242                                 "pattern": "^(.+)$"
243                             },
244                             "failure": {
245                                 "$id": "#/properties/properties/properties/operations/items/properties/failure",
246                                 "type": "string",
247                                 "title": "Failure Treatment",
248                                 "default": "final_failure",
249                                 "examples": [
250                                     "final_failure",
251                                     "unique-policy-id-2"
252                                 ],
253                                 "pattern": "^(.+)$"
254                             },
255                             "failure_timeout": {
256                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_timeout",
257                                 "type": "string",
258                                 "title": "Failure Timeout Treatment",
259                                 "default": "final_failure_timeout",
260                                 "examples": [
261                                     "final_failure_timeout",
262                                     "unique-policy-id-2"
263                                 ],
264                                 "pattern": "^(.+)$"
265                             },
266                             "failure_retries": {
267                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_retries",
268                                 "type": "string",
269                                 "title": "Failure Retries Treatment",
270                                 "default": "final_failure_retries",
271                                 "examples": [
272                                     "final_failure_retries",
273                                     "unique-policy-id-2"
274                                 ],
275                                 "pattern": "^(.+)$"
276                             },
277                             "failure_exception": {
278                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_exception",
279                                 "type": "string",
280                                 "title": "Failure Exception Treatment",
281                                 "default": "",
282                                 "examples": [
283                                     "final_failure_exception",
284                                     "unique-policy-id-2"
285                                 ],
286                                 "pattern": "^(.+)$"
287                             },
288                             "failure_guard": {
289                                 "$id": "#/properties/properties/properties/operations/items/properties/failure_guard",
290                                 "type": "string",
291                                 "title": "Failure Guard Treatment",
292                                 "default": "final_failure_guard",
293                                 "examples": [
294                                     "final_failure_guard",
295                                     "unique-policy-id-2"
296                                 ],
297                                 "pattern": "^(.+)$"
298                             }
299                         }
300                     }
301                 },
302                 "controllerName": {
303                     "$id": "#/properties/properties/properties/controllerName",
304                     "type": "string",
305                     "title": "Controller Name",
306                     "default": "",
307                     "examples": [
308                         "usecases"
309                     ],
310                     "pattern": "^(.+)$"
311                 }
312             }
313         }
314     }
315 }