Draft of op policy
[clamp.git] / src / main / resources / clds / json-schema / operational_policies / operational_policy.json
1 {
2     "schema": {
3         "uniqueItems": "true",
4         "format": "tabs",
5         "type": "array",
6         "minItems": 1,
7         "maxItems": 1,
8         "title": "Operational policies",
9         "items": {
10             "type": "object",
11             "title": "Operational Policy Item",
12             "id": "operational_policy_item",
13             "headerTemplate": "{{self.name}}",
14             "required": [
15                 "name",
16                 "configurationsJson"
17             ],
18             "properties": {
19                 "name": {
20                     "type": "string",
21                     "title": "Operational policy name",
22                     "readOnly": "True"
23                 },
24                 "configurationsJson": {
25                     "type": "object",
26                     "title": "Configuration",
27                     "required": [
28                         "operational_policy",
29                         "guard_policies"
30                     ],
31                     "properties": {
32                         "operational_policy": {
33                             "type": "object",
34                             "title": "Related Parameters",
35                             "required": [
36                                 "controlLoop",
37                                 "policies"
38                             ],
39                             "properties": {
40                                 "controlLoop": {
41                                     "type": "object",
42                                     "title": "Control Loop details",
43                                     "required": [
44                                         "timeout",
45                                         "abatement",
46                                         "trigger_policy",
47                                         "controlLoopName"
48                                     ],
49                                     "properties": {
50                                         "timeout": {
51                                             "type": "string",
52                                             "title": "Overall Time Limit",
53                                             "default": "0",
54                                             "format": "number"
55                                         },
56                                         "abatement": {
57                                             "type": "string",
58                                             "title": "Abatement",
59                                             "enum": [
60                                                 "True",
61                                                 "False"
62                                             ]
63                                         },
64                                         "trigger_policy": {
65                                             "type": "string",
66                                             "title": "Policy Decision Entry"
67                                         },
68                                         "controlLoopName": {
69                                             "type": "string",
70                                             "title": "Control loop name",
71                                             "readOnly": "True"
72                                         }
73                                     }
74                                 },
75                                 "policies": {
76                                     "uniqueItems": "true",
77                                     "id": "policies_array",
78                                     "type": "array",
79                                     "title": "Policy Decision Tree",
80                                     "format": "tabs-top",
81                                     "items": {
82                                         "title": "Policy Decision",
83                                         "type": "object",
84                                         "id": "policy_item",
85                                         "headerTemplate": "{{self.id}} - {{self.recipe}}",
86                                         "format": "categories",
87                                         "basicCategoryTitle": "recipe",
88                                         "required": [
89                                             "id",
90                                             "recipe",
91                                             "retry",
92                                             "timeout",
93                                             "actor",
94                                             "success",
95                                             "failure",
96                                             "failure_timeout",
97                                             "failure_retries",
98                                             "failure_exception",
99                                             "failure_guard",
100                                             "target"
101                                         ],
102                                         "properties": {
103                                             "id": {
104                                                 "default": "Policy 1",
105                                                 "title": "Policy ID",
106                                                 "type": "string"
107                                             },
108                                             "recipe": {
109                                                 "title": "Recipe",
110                                                 "type": "string",
111                                                 "enum": [
112                                                     "Restart",
113                                                     "Rebuild",
114                                                     "Migrate",
115                                                     "Health-Check",
116                                                     "ModifyConfig",
117                                                     "VF Module Create",
118                                                     "VF Module Delete",
119                                                     "Reroute"
120                                                 ]
121                                             },
122                                             "retry": {
123                                                 "default": "0",
124                                                 "title": "Number of Retry",
125                                                 "type": "string",
126                                                 "format": "number"
127                                             },
128                                             "timeout": {
129                                                 "default": "0",
130                                                 "title": "Timeout",
131                                                 "type": "string",
132                                                 "format": "number"
133                                             },
134                                             "actor": {
135                                                 "title": "Actor",
136                                                 "type": "string",
137                                                 "enum": [
138                                                     "APPC",
139                                                     "SO",
140                                                     "VFC",
141                                                     "SDNC",
142                                                     "SDNR"
143                                                 ]
144                                             },
145                                             "payload": {
146                                                 "title": "Payload (YAML)",
147                                                 "type": "string",
148                                                 "format": "textarea"
149                                             },
150                                             "success": {
151                                                 "default": "final_success",
152                                                 "title": "When Success",
153                                                 "type": "string"
154                                             },
155                                             "failure": {
156                                                 "default": "final_failure",
157                                                 "title": "When Failure",
158                                                 "type": "string"
159                                             },
160                                             "failure_timeout": {
161                                                 "default": "final_failure_timeout",
162                                                 "title": "When Failure Timeout",
163                                                 "type": "string"
164                                             },
165                                             "failure_retries": {
166                                                 "default": "final_failure_retries",
167                                                 "title": "When Failure Retries",
168                                                 "type": "string"
169                                             },
170                                             "failure_exception": {
171                                                 "default": "final_failure_exception",
172                                                 "title": "When Failure Exception",
173                                                 "type": "string"
174                                             },
175                                             "failure_guard": {
176                                                 "default": "final_failure_guard",
177                                                 "title": "When Failure Guard",
178                                                 "type": "string"
179                                             },
180                                             "target": {
181                                                 "type": "object",
182                                                 "required": [
183                                                     "type",
184                                                     "resourceID"
185                                                 ],
186                                                 "anyOf": [
187                                                     {
188                                                         "title": "User Defined",
189                                                         "additionalProperties":"True",
190                                                         "properties": {
191                                                             "type": {
192                                                                 "title": "Target type",
193                                                                 "type": "string",
194                                                                 "default": "",
195                                                                 "enum": [
196                                                                     "VNF",
197                                                                     "VFMODULE",
198                                                                     "VM"
199                                                                 ]
200                                                             },
201                                                             "resourceID": {
202                                                                 "title": "Target type",
203                                                                 "type": "string",
204                                                                 "default": ""
205                                                             }
206                                                         }
207                                                     }
208                                                 ]
209                                             }
210                                         }
211                                     }
212                                 }
213                             }
214                         },
215                         "guard_policies": {
216                             "type": "array",
217                             "format": "tabs-top",
218                             "title": "Associated Guard policies",
219                             "items": {
220                                 "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}",
221                                 "anyOf": [
222                                     {
223                                         "title": "Guard MinMax",
224                                         "type": "object",
225                                         "properties": {
226                                             "policy-id": {
227                                                 "type": "string",
228                                                 "default": "guard.minmax.new",
229                                                 "pattern": "^(guard.minmax\\..*)$"
230                                             },
231                                             "content": {
232                                                 "properties": {
233                                                     "actor": {
234                                                         "type": "string",
235                                                         "enum": [
236                                                             "APPC",
237                                                             "SO",
238                                                             "VFC",
239                                                             "SDNC",
240                                                             "SDNR"
241                                                         ]
242                                                     },
243                                                     "recipe": {
244                                                         "type": "string",
245                                                         "enum": [
246                                                             "Restart",
247                                                             "Rebuild",
248                                                             "Migrate",
249                                                             "Health-Check",
250                                                             "ModifyConfig",
251                                                             "VF Module Create",
252                                                             "VF Module Delete",
253                                                             "Reroute"
254                                                         ]
255                                                     },
256                                                     "targets": {
257                                                         "type": "string",
258                                                         "default": ".*"
259                                                     },
260                                                     "clname": {
261                                                         "type": "string",
262                                                         "template": "{{loopName}}",
263                                                         "watch": {
264                                                             "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName"
265                                                         }
266                                                     },
267                                                     "guardActiveStart": {
268                                                         "type": "string",
269                                                         "default": "00:00:00Z"
270                                                     },
271                                                     "guardActiveEnd": {
272                                                         "type": "string",
273                                                         "default": "10:00:00Z"
274                                                     },
275                                                     "min": {
276                                                         "type": "string",
277                                                         "default": "0"
278                                                     },
279                                                     "max": {
280                                                         "type": "string",
281                                                         "default": "1"
282                                                     }
283                                                 }
284                                             }
285                                         }
286                                     },
287                                     {
288                                         "title": "Guard Frequency",
289                                         "type": "object",
290                                         "properties": {
291                                             "policy-id": {
292                                                 "type": "string",
293                                                 "default": "guard.frequency.new",
294                                                 "pattern": "^(guard.frequency\\..*)$"
295                                             },
296                                             "content": {
297                                                 "properties": {
298                                                     "actor": {
299                                                         "type": "string",
300                                                         "enum": [
301                                                             "APPC",
302                                                             "SO",
303                                                             "VFC",
304                                                             "SDNC",
305                                                             "SDNR"
306                                                         ]
307                                                     },
308                                                     "recipe": {
309                                                         "type": "string",
310                                                         "enum": [
311                                                             "Restart",
312                                                             "Rebuild",
313                                                             "Migrate",
314                                                             "Health-Check",
315                                                             "ModifyConfig",
316                                                             "VF Module Create",
317                                                             "VF Module Delete",
318                                                             "Reroute"
319                                                         ]
320                                                     },
321                                                     "targets": {
322                                                         "type": "string",
323                                                         "default": ".*"
324                                                     },
325                                                     "clname": {
326                                                         "type": "string",
327                                                         "template": "{{loopName}}",
328                                                         "watch": {
329                                                             "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName"
330                                                         }
331                                                     },
332                                                     "guardActiveStart": {
333                                                         "type": "string",
334                                                         "default": "00:00:00Z"
335                                                     },
336                                                     "guardActiveEnd": {
337                                                         "type": "string",
338                                                         "default": "10:00:00Z"
339                                                     },
340                                                     "limit": {
341                                                         "type": "string"
342                                                     },
343                                                     "timeWindow": {
344                                                         "type": "string"
345                                                     },
346                                                     "timeUnits": {
347                                                         "type": "string",
348                                                         "enum":["minute","hour","day","week","month","year"]
349                                                     }
350                                                 }
351                                             }
352                                         }
353                                     }
354                                 ]
355                             }
356                         }
357                     }
358                 }
359             }
360         }
361     }
362 }