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