Release 5.0.5
[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                     "type": "object",
103                     "properties": {
104                       "actor": {
105                         "title": "actor",
106                         "type": "string",
107                         "default": "APPC",
108                         "options": {
109                           "hidden": true
110                         }
111                       },
112                       "recipe": {
113                         "title": "recipe",
114                         "type": "string",
115                         "default": "",
116                         "enum": [
117                           "Restart",
118                           "Rebuild",
119                           "Migrate",
120                           "Health-Check",
121                           "ModifyConfig"
122                         ]
123                       },
124                       "payload": {
125                         "title": "Payload (YAML)",
126                         "type": "string",
127                         "format": "textarea"
128                       }
129                     }
130                   },
131                   {
132                     "title": "SO",
133                     "type": "object",
134                     "properties": {
135                       "actor": {
136                         "title": "actor",
137                         "type": "string",
138                         "default": "SO",
139                         "options": {
140                           "hidden": true
141                         }
142                       },
143                       "recipe": {
144                         "title": "recipe",
145                         "type": "string",
146                         "default": "",
147                         "enum": [
148                           "VF Module Create",
149                           "VF Module Delete"
150                         ]
151                       },
152                       "payload": {
153                         "title": "Payload (YAML)",
154                         "type": "string",
155                         "format": "textarea"
156                       }
157                     }
158                   },
159                   {
160                     "title": "SDNC",
161                     "type": "object",
162                     "properties": {
163                       "actor": {
164                         "title": "actor",
165                         "type": "string",
166                         "default": "SDNC",
167                         "options": {
168                           "hidden": true
169                         }
170                       },
171                       "recipe": {
172                         "title": "recipe",
173                         "type": "string",
174                         "default": "",
175                         "enum": [
176                           "Reroute",
177                           "BandwidthOnDemand"
178                         ]
179                       },
180                       "payload": {
181                         "title": "Payload (YAML)",
182                         "type": "string",
183                         "format": "textarea"
184                       }
185                     }
186                   },
187                   {
188                     "title": "VFC",
189                     "type": "object",
190                     "properties": {
191                       "actor": {
192                         "title": "actor",
193                         "type": "string",
194                         "default": "VFC",
195                         "options": {
196                           "hidden": true
197                         }
198                       },
199                       "recipe": {
200                         "title": "recipe",
201                         "type": "string",
202                         "default": "",
203                         "enum": [
204                           "ModifyConfig"
205                         ]
206                       },
207                       "payload": {
208                         "title": "Payload (YAML)",
209                         "type": "string",
210                         "format": "textarea"
211                       }
212                     }
213                   },
214                   {
215                     "title": "CDS",
216                     "type": "object",
217                     "properties": {
218                       "actor": {
219                         "title": "actor",
220                         "type": "string",
221                         "default": "CDS",
222                         "options": {
223                           "hidden": true
224                         }
225                       },
226                       "recipe": {
227                         "title": "recipe",
228                         "type": "object",
229                         "anyOf": [
230                           {
231                             "title": "user-defined",
232                             "type": "object",
233                             "properties": {
234                               "recipe": {
235                                 "title": "recipe",
236                                 "type": "string",
237                                 "default": "user-defined",
238                                 "format": "textarea"
239                               },
240                               "payload": {
241                                 "title": "Payload (YAML)",
242                                 "type": "string",
243                                 "default": "",
244                                 "format": "textarea"
245                               }
246                             }
247                           }
248                         ]
249                       }
250                     }
251                   }
252                 ]
253               },
254               "success": {
255                 "default": "final_success",
256                 "title": "When Success",
257                 "type": "string"
258               },
259               "failure": {
260                 "default": "final_failure",
261                 "title": "When Failure",
262                 "type": "string"
263               },
264               "failure_timeout": {
265                 "default": "final_failure_timeout",
266                 "title": "When Failure Timeout",
267                 "type": "string"
268               },
269               "failure_retries": {
270                 "default": "final_failure_retries",
271                 "title": "When Failure Retries",
272                 "type": "string"
273               },
274               "failure_exception": {
275                 "default": "final_failure_exception",
276                 "title": "When Failure Exception",
277                 "type": "string"
278               },
279               "failure_guard": {
280                 "default": "final_failure_guard",
281                 "title": "When Failure Guard",
282                 "type": "string"
283               },
284               "target": {
285                 "type": "object",
286                 "required": [
287                   "type",
288                   "resourceID"
289                 ],
290                 "anyOf": [
291                   {
292                     "title": "User Defined",
293                     "additionalProperties": "True",
294                     "properties": {
295                       "type": {
296                         "title": "Target type",
297                         "type": "string",
298                         "default": "",
299                         "enum": [
300                           "VNF",
301                           "VFMODULE",
302                           "VM"
303                         ]
304                       },
305                       "resourceID": {
306                         "title": "Target type",
307                         "type": "string",
308                         "default": ""
309                       }
310                     }
311                   }
312                 ]
313               }
314             }
315           }
316         }
317       }
318     },
319     "guard_policies": {
320       "type": "array",
321       "format": "tabs-top",
322       "title": "Associated Guard policies",
323       "items": {
324         "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}",
325         "anyOf": [
326           {
327             "title": "Guard MinMax",
328             "type": "object",
329             "properties": {
330               "policy-id": {
331                 "type": "string",
332                 "default": "guard.minmax.new",
333                 "pattern": "^(guard.minmax\\..*)$"
334               },
335               "content": {
336                 "properties": {
337                   "actor": {
338                     "type": "string",
339                     "enum": [
340                       "APPC",
341                       "SO",
342                       "VFC",
343                       "SDNC",
344                       "SDNR"
345                     ]
346                   },
347                   "recipe": {
348                     "type": "string",
349                     "enum": [
350                       "Restart",
351                       "Rebuild",
352                       "Migrate",
353                       "Health-Check",
354                       "ModifyConfig",
355                       "VF Module Create",
356                       "VF Module Delete",
357                       "Reroute"
358                     ]
359                   },
360                   "targets": {
361                     "type": "string",
362                     "default": ".*"
363                   },
364                   "clname": {
365                     "type": "string",
366                     "template": "{{loopName}}",
367                     "watch": {
368                       "loopName": "operational_policy.controlLoop.controlLoopName"
369                     }
370                   },
371                   "guardActiveStart": {
372                     "type": "string",
373                     "default": "00:00:00Z"
374                   },
375                   "guardActiveEnd": {
376                     "type": "string",
377                     "default": "10:00:00Z"
378                   },
379                   "min": {
380                     "type": "string",
381                     "default": "0"
382                   },
383                   "max": {
384                     "type": "string",
385                     "default": "1"
386                   }
387                 }
388               }
389             }
390           },
391           {
392             "title": "Guard Frequency",
393             "type": "object",
394             "properties": {
395               "policy-id": {
396                 "type": "string",
397                 "default": "guard.frequency.new",
398                 "pattern": "^(guard.frequency\\..*)$"
399               },
400               "content": {
401                 "properties": {
402                   "actor": {
403                     "type": "string",
404                     "enum": [
405                       "APPC",
406                       "SO",
407                       "VFC",
408                       "SDNC",
409                       "SDNR"
410                     ]
411                   },
412                   "recipe": {
413                     "type": "string",
414                     "enum": [
415                       "Restart",
416                       "Rebuild",
417                       "Migrate",
418                       "Health-Check",
419                       "ModifyConfig",
420                       "VF Module Create",
421                       "VF Module Delete",
422                       "Reroute"
423                     ]
424                   },
425                   "targets": {
426                     "type": "string",
427                     "default": ".*"
428                   },
429                   "clname": {
430                     "type": "string",
431                     "template": "{{loopName}}",
432                     "watch": {
433                       "loopName": "operational_policy.controlLoop.controlLoopName"
434                     }
435                   },
436                   "guardActiveStart": {
437                     "type": "string",
438                     "default": "00:00:00Z"
439                   },
440                   "guardActiveEnd": {
441                     "type": "string",
442                     "default": "10:00:00Z"
443                   },
444                   "limit": {
445                     "type": "string"
446                   },
447                   "timeWindow": {
448                     "type": "string"
449                   },
450                   "timeUnits": {
451                     "type": "string",
452                     "enum": [
453                       "minute",
454                       "hour",
455                       "day",
456                       "week",
457                       "month",
458                       "year"
459                     ]
460                   }
461                 }
462               }
463             }
464           }
465         ]
466       }
467     }
468   }
469 }
470