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