Draft of op policy
[clamp.git] / src / test / resources / tosca / operational-policy-json-schema.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                                                                                                                 "title": "VNF-vLoadBalancerMS 0",
210                                                                                                                 "properties": {
211                                                                                                                         "type": {
212                                                                                                                                 "title": "Type",
213                                                                                                                                 "type": "string",
214                                                                                                                                 "default": "VNF",
215                                                                                                                                 "readOnly": "True"
216                                                                                                                         },
217                                                                                                                         "resourceID": {
218                                                                                                                                 "title": "Resource ID",
219                                                                                                                                 "type": "string",
220                                                                                                                                 "default": "vLoadBalancerMS",
221                                                                                                                                 "readOnly": "True"
222                                                                                                                         }
223                                                                                                                 }
224                                                                                                         },
225                                                                                                         {
226                                                                                                                 "title": "VFMODULE-Vloadbalancerms..vpkg..module-1",
227                                                                                                                 "properties": {
228                                                                                                                         "type": {
229                                                                                                                                 "title": "Type",
230                                                                                                                                 "type": "string",
231                                                                                                                                 "default": "VFMODULE",
232                                                                                                                                 "readOnly": "True"
233                                                                                                                         },
234                                                                                                                         "resourceID": {
235                                                                                                                                 "title": "Resource ID",
236                                                                                                                                 "type": "string",
237                                                                                                                                 "default": "Vloadbalancerms..vpkg..module-1",
238                                                                                                                                 "readOnly": "True"
239                                                                                                                         },
240                                                                                                                         "modelInvariantId": {
241                                                                                                                                 "title": "Model Invariant Id (ModelInvariantUUID)",
242                                                                                                                                 "type": "string",
243                                                                                                                                 "default": "ca052563-eb92-4b5b-ad41-9111768ce043",
244                                                                                                                                 "readOnly": "True"
245                                                                                                                         },
246                                                                                                                         "modelVersionId": {
247                                                                                                                                 "title": "Model Version Id (ModelUUID)",
248                                                                                                                                 "type": "string",
249                                                                                                                                 "default": "1e725ccc-b823-4f67-82b9-4f4367070dbc",
250                                                                                                                                 "readOnly": "True"
251                                                                                                                         },
252                                                                                                                         "modelName": {
253                                                                                                                                 "title": "Model Name",
254                                                                                                                                 "type": "string",
255                                                                                                                                 "default": "Vloadbalancerms..vpkg..module-1",
256                                                                                                                                 "readOnly": "True"
257                                                                                                                         },
258                                                                                                                         "modelVersion": {
259                                                                                                                                 "title": "Model Version",
260                                                                                                                                 "type": "string",
261                                                                                                                                 "default": "1",
262                                                                                                                                 "readOnly": "True"
263                                                                                                                         },
264                                                                                                                         "modelCustomizationId": {
265                                                                                                                                 "title": "Customization ID",
266                                                                                                                                 "type": "string",
267                                                                                                                                 "default": "1bffdc31-a37d-4dee-b65c-dde623a76e52",
268                                                                                                                                 "readOnly": "True"
269                                                                                                                         }
270                                                                                                                 }
271                                                                                                         },
272                                                                                                         {
273                                                                                                                 "title": "VFMODULE-Vloadbalancerms..vdns..module-3",
274                                                                                                                 "properties": {
275                                                                                                                         "type": {
276                                                                                                                                 "title": "Type",
277                                                                                                                                 "type": "string",
278                                                                                                                                 "default": "VFMODULE",
279                                                                                                                                 "readOnly": "True"
280                                                                                                                         },
281                                                                                                                         "resourceID": {
282                                                                                                                                 "title": "Resource ID",
283                                                                                                                                 "type": "string",
284                                                                                                                                 "default": "Vloadbalancerms..vdns..module-3",
285                                                                                                                                 "readOnly": "True"
286                                                                                                                         },
287                                                                                                                         "modelInvariantId": {
288                                                                                                                                 "title": "Model Invariant Id (ModelInvariantUUID)",
289                                                                                                                                 "type": "string",
290                                                                                                                                 "default": "4c10ba9b-f88f-415e-9de3-5d33336047fa",
291                                                                                                                                 "readOnly": "True"
292                                                                                                                         },
293                                                                                                                         "modelVersionId": {
294                                                                                                                                 "title": "Model Version Id (ModelUUID)",
295                                                                                                                                 "type": "string",
296                                                                                                                                 "default": "4fa73b49-8a6c-493e-816b-eb401567b720",
297                                                                                                                                 "readOnly": "True"
298                                                                                                                         },
299                                                                                                                         "modelName": {
300                                                                                                                                 "title": "Model Name",
301                                                                                                                                 "type": "string",
302                                                                                                                                 "default": "Vloadbalancerms..vdns..module-3",
303                                                                                                                                 "readOnly": "True"
304                                                                                                                         },
305                                                                                                                         "modelVersion": {
306                                                                                                                                 "title": "Model Version",
307                                                                                                                                 "type": "string",
308                                                                                                                                 "default": "1",
309                                                                                                                                 "readOnly": "True"
310                                                                                                                         },
311                                                                                                                         "modelCustomizationId": {
312                                                                                                                                 "title": "Customization ID",
313                                                                                                                                 "type": "string",
314                                                                                                                                 "default": "bafcdab0-801d-4d81-9ead-f464640a38b1",
315                                                                                                                                 "readOnly": "True"
316                                                                                                                         }
317                                                                                                                 }
318                                                                                                         },
319                                                                                                         {
320                                                                                                                 "title": "VFMODULE-Vloadbalancerms..base_template..module-0",
321                                                                                                                 "properties": {
322                                                                                                                         "type": {
323                                                                                                                                 "title": "Type",
324                                                                                                                                 "type": "string",
325                                                                                                                                 "default": "VFMODULE",
326                                                                                                                                 "readOnly": "True"
327                                                                                                                         },
328                                                                                                                         "resourceID": {
329                                                                                                                                 "title": "Resource ID",
330                                                                                                                                 "type": "string",
331                                                                                                                                 "default": "Vloadbalancerms..base_template..module-0",
332                                                                                                                                 "readOnly": "True"
333                                                                                                                         },
334                                                                                                                         "modelInvariantId": {
335                                                                                                                                 "title": "Model Invariant Id (ModelInvariantUUID)",
336                                                                                                                                 "type": "string",
337                                                                                                                                 "default": "921f7c96-ebdd-42e6-81b9-1cfc0c9796f3",
338                                                                                                                                 "readOnly": "True"
339                                                                                                                         },
340                                                                                                                         "modelVersionId": {
341                                                                                                                                 "title": "Model Version Id (ModelUUID)",
342                                                                                                                                 "type": "string",
343                                                                                                                                 "default": "63734409-f745-4e4d-a38b-131638a0edce",
344                                                                                                                                 "readOnly": "True"
345                                                                                                                         },
346                                                                                                                         "modelName": {
347                                                                                                                                 "title": "Model Name",
348                                                                                                                                 "type": "string",
349                                                                                                                                 "default": "Vloadbalancerms..base_template..module-0",
350                                                                                                                                 "readOnly": "True"
351                                                                                                                         },
352                                                                                                                         "modelVersion": {
353                                                                                                                                 "title": "Model Version",
354                                                                                                                                 "type": "string",
355                                                                                                                                 "default": "1",
356                                                                                                                                 "readOnly": "True"
357                                                                                                                         },
358                                                                                                                         "modelCustomizationId": {
359                                                                                                                                 "title": "Customization ID",
360                                                                                                                                 "type": "string",
361                                                                                                                                 "default": "86baddea-c730-4fb8-9410-cd2e17fd7f27",
362                                                                                                                                 "readOnly": "True"
363                                                                                                                         }
364                                                                                                                 }
365                                                                                                         },
366                                                                                                         {
367                                                                                                                 "title": "VFMODULE-Vloadbalancerms..vlb..module-2",
368                                                                                                                 "properties": {
369                                                                                                                         "type": {
370                                                                                                                                 "title": "Type",
371                                                                                                                                 "type": "string",
372                                                                                                                                 "default": "VFMODULE",
373                                                                                                                                 "readOnly": "True"
374                                                                                                                         },
375                                                                                                                         "resourceID": {
376                                                                                                                                 "title": "Resource ID",
377                                                                                                                                 "type": "string",
378                                                                                                                                 "default": "Vloadbalancerms..vlb..module-2",
379                                                                                                                                 "readOnly": "True"
380                                                                                                                         },
381                                                                                                                         "modelInvariantId": {
382                                                                                                                                 "title": "Model Invariant Id (ModelInvariantUUID)",
383                                                                                                                                 "type": "string",
384                                                                                                                                 "default": "a772a1f4-0064-412c-833d-4749b15828dd",
385                                                                                                                                 "readOnly": "True"
386                                                                                                                         },
387                                                                                                                         "modelVersionId": {
388                                                                                                                                 "title": "Model Version Id (ModelUUID)",
389                                                                                                                                 "type": "string",
390                                                                                                                                 "default": "0f5c3f6a-650a-4303-abb6-fff3e573a07a",
391                                                                                                                                 "readOnly": "True"
392                                                                                                                         },
393                                                                                                                         "modelName": {
394                                                                                                                                 "title": "Model Name",
395                                                                                                                                 "type": "string",
396                                                                                                                                 "default": "Vloadbalancerms..vlb..module-2",
397                                                                                                                                 "readOnly": "True"
398                                                                                                                         },
399                                                                                                                         "modelVersion": {
400                                                                                                                                 "title": "Model Version",
401                                                                                                                                 "type": "string",
402                                                                                                                                 "default": "1",
403                                                                                                                                 "readOnly": "True"
404                                                                                                                         },
405                                                                                                                         "modelCustomizationId": {
406                                                                                                                                 "title": "Customization ID",
407                                                                                                                                 "type": "string",
408                                                                                                                                 "default": "96a78aad-4ffb-4ef0-9c4f-deb03bf1d806",
409                                                                                                                                 "readOnly": "True"
410                                                                                                                         }
411                                                                                                                 }
412                                                                                                         }
413                                                                                                 ]
414                                                                                         }
415                                                                                 }
416                                                                         }
417                                                                 }
418                                                         }
419                                                 },
420                                                 "guard_policies": {
421                                                         "type": "array",
422                                                         "format": "tabs-top",
423                                                         "title": "Associated Guard policies",
424                                                         "items": {
425                                                                 "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}",
426                                                                 "anyOf": [
427                                                                         {
428                                                                                 "title": "Guard MinMax",
429                                                                                 "type": "object",
430                                                                                 "properties": {
431                                                                                         "policy-id": {
432                                                                                                 "type": "string",
433                                                                                                 "default": "guard.minmax.new",
434                                                                                                 "pattern": "^(guard.minmax\\..*)$"
435                                                                                         },
436                                                                                         "content": {
437                                                                                                 "properties": {
438                                                                                                         "actor": {
439                                                                                                                 "type": "string",
440                                                                                                                 "enum": [
441                                                                                                                         "APPC",
442                                                                                                                         "SO",
443                                                                                                                         "VFC",
444                                                                                                                         "SDNC",
445                                                                                                                         "SDNR"
446                                                                                                                 ]
447                                                                                                         },
448                                                                                                         "recipe": {
449                                                                                                                 "type": "string",
450                                                                                                                 "enum": [
451                                                                                                                         "Restart",
452                                                                                                                         "Rebuild",
453                                                                                                                         "Migrate",
454                                                                                                                         "Health-Check",
455                                                                                                                         "ModifyConfig",
456                                                                                                                         "VF Module Create",
457                                                                                                                         "VF Module Delete",
458                                                                                                                         "Reroute"
459                                                                                                                 ]
460                                                                                                         },
461                                                                                                         "targets": {
462                                                                                                                 "type": "string",
463                                                                                                                 "default": ".*"
464                                                                                                         },
465                                                                                                         "clname": {
466                                                                                                                 "type": "string",
467                                                                                                                 "template": "{{loopName}}",
468                                                                                                                 "watch": {
469                                                                                                                         "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName"
470                                                                                                                 }
471                                                                                                         },
472                                                                                                         "guardActiveStart": {
473                                                                                                                 "type": "string",
474                                                                                                                 "default": "00:00:00Z"
475                                                                                                         },
476                                                                                                         "guardActiveEnd": {
477                                                                                                                 "type": "string",
478                                                                                                                 "default": "10:00:00Z"
479                                                                                                         },
480                                                                                                         "min": {
481                                                                                                                 "type": "string",
482                                                                                                                 "default": "0"
483                                                                                                         },
484                                                                                                         "max": {
485                                                                                                                 "type": "string",
486                                                                                                                 "default": "1"
487                                                                                                         }
488                                                                                                 }
489                                                                                         }
490                                                                                 }
491                                                                         },
492                                                                         {
493                                                                                 "title": "Guard Frequency",
494                                                                                 "type": "object",
495                                                                                 "properties": {
496                                                                                         "policy-id": {
497                                                                                                 "type": "string",
498                                                                                                 "default": "guard.frequency.new",
499                                                                                                 "pattern": "^(guard.frequency\\..*)$"
500                                                                                         },
501                                                                                         "content": {
502                                                                                                 "properties": {
503                                                                                                         "actor": {
504                                                                                                                 "type": "string",
505                                                                                                                 "enum": [
506                                                                                                                         "APPC",
507                                                                                                                         "SO",
508                                                                                                                         "VFC",
509                                                                                                                         "SDNC",
510                                                                                                                         "SDNR"
511                                                                                                                 ]
512                                                                                                         },
513                                                                                                         "recipe": {
514                                                                                                                 "type": "string",
515                                                                                                                 "enum": [
516                                                                                                                         "Restart",
517                                                                                                                         "Rebuild",
518                                                                                                                         "Migrate",
519                                                                                                                         "Health-Check",
520                                                                                                                         "ModifyConfig",
521                                                                                                                         "VF Module Create",
522                                                                                                                         "VF Module Delete",
523                                                                                                                         "Reroute"
524                                                                                                                 ]
525                                                                                                         },
526                                                                                                         "targets": {
527                                                                                                                 "type": "string",
528                                                                                                                 "default": ".*"
529                                                                                                         },
530                                                                                                         "clname": {
531                                                                                                                 "type": "string",
532                                                                                                                 "template": "{{loopName}}",
533                                                                                                                 "watch": {
534                                                                                                                         "loopName": "operational_policy_item.configurationsJson.operational_policy.controlLoop.controlLoopName"
535                                                                                                                 }
536                                                                                                         },
537                                                                                                         "guardActiveStart": {
538                                                                                                                 "type": "string",
539                                                                                                                 "default": "00:00:00Z"
540                                                                                                         },
541                                                                                                         "guardActiveEnd": {
542                                                                                                                 "type": "string",
543                                                                                                                 "default": "10:00:00Z"
544                                                                                                         },
545                                                                                                         "limit": {
546                                                                                                                 "type": "string"
547                                                                                                         },
548                                                                                                         "timeWindow": {
549                                                                                                                 "type": "string"
550                                                                                                         },
551                                                                                                         "timeUnits": {
552                                                                                                                 "type": "string",
553                                                                                                                 "enum": [
554                                                                                                                         "minute",
555                                                                                                                         "hour",
556                                                                                                                         "day",
557                                                                                                                         "week",
558                                                                                                                         "month",
559                                                                                                                         "year"
560                                                                                                                 ]
561                                                                                                         }
562                                                                                                 }
563                                                                                         }
564                                                                                 }
565                                                                         }
566                                                                 ]
567                                                         }
568                                                 }
569                                         }
570                                 }
571                         }
572                 }
573         }
574 }