Payload is expected as string in operational policy
[clamp.git] / src / test / resources / tosca / operational-policy-cds-payload-with-list.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                             "title": "resource-assignment",
250                             "type": "object",
251                             "properties": {
252                               "recipe": {
253                                 "title": "recipe",
254                                 "type": "string",
255                                 "default": "resource-assignment",
256                                 "options": {
257                                   "hidden": true
258                                 }
259                               },
260                               "payload": {
261                                 "title": "Payload",
262                                 "type": "object",
263                                 "properties": {
264                                   "artifact_name": {
265                                     "title": "artifact name",
266                                     "type": "string",
267                                     "default": "baseconfiguration",
268                                     "readOnly": "True"
269                                   },
270                                   "artifact_version": {
271                                     "title": "artifact version",
272                                     "type": "string",
273                                     "default": "1.0.0",
274                                     "readOnly": "True"
275                                   },
276                                   "mode": {
277                                     "title": "mode",
278                                     "type": "string",
279                                     "default": "async"
280                                   },
281                                   "data": {
282                                     "title": "data",
283                                     "properties": {
284                                       "template-prefix": {
285                                         "title": "template-prefix",
286                                         "type": "array"
287                                       },
288                                       "template-prefix-with-complex-type": {
289                                         "title": "template-prefix-with-complex-type",
290                                         "type": "array",
291                                         "items": {
292                                           "properties": {
293                                             "prefix-id": {
294                                               "title": "prefix-id",
295                                               "type": "string"
296                                             }
297                                           }
298                                         }
299                                       },
300                                       "private1-prefix-id": {
301                                         "title": "private1-prefix-id",
302                                         "type": "string"
303                                       }
304                                     }
305                                   }
306                                 }
307                               }
308                             }
309                           }
310                         ]
311                       }
312                     }
313                   }
314                 ]
315               },
316               "success": {
317                 "default": "final_success",
318                 "title": "When Success",
319                 "type": "string"
320               },
321               "failure": {
322                 "default": "final_failure",
323                 "title": "When Failure",
324                 "type": "string"
325               },
326               "failure_timeout": {
327                 "default": "final_failure_timeout",
328                 "title": "When Failure Timeout",
329                 "type": "string"
330               },
331               "failure_retries": {
332                 "default": "final_failure_retries",
333                 "title": "When Failure Retries",
334                 "type": "string"
335               },
336               "failure_exception": {
337                 "default": "final_failure_exception",
338                 "title": "When Failure Exception",
339                 "type": "string"
340               },
341               "failure_guard": {
342                 "default": "final_failure_guard",
343                 "title": "When Failure Guard",
344                 "type": "string"
345               },
346               "target": {
347                 "type": "object",
348                 "required": [
349                   "type",
350                   "resourceID"
351                 ],
352                 "anyOf": [
353                   {
354                     "title": "User Defined",
355                     "additionalProperties": "True",
356                     "properties": {
357                       "type": {
358                         "title": "Target type",
359                         "type": "string",
360                         "default": "",
361                         "enum": [
362                           "VNF",
363                           "VFMODULE",
364                           "VM"
365                         ]
366                       },
367                       "resourceID": {
368                         "title": "Target type",
369                         "type": "string",
370                         "default": ""
371                       }
372                     }
373                   },
374                   {
375                     "title": "VNF-vLoadBalancerMS 0",
376                     "properties": {
377                       "type": {
378                         "title": "Type",
379                         "type": "string",
380                         "default": "VNF",
381                         "readOnly": "True"
382                       },
383                       "resourceID": {
384                         "title": "Resource ID",
385                         "type": "string",
386                         "default": "vLoadBalancerMS",
387                         "readOnly": "True"
388                       }
389                     }
390                   },
391                   {
392                     "title": "VFMODULE-Vloadbalancerms..vpkg..module-1",
393                     "properties": {
394                       "type": {
395                         "title": "Type",
396                         "type": "string",
397                         "default": "VFMODULE",
398                         "readOnly": "True"
399                       },
400                       "resourceID": {
401                         "title": "Resource ID",
402                         "type": "string",
403                         "default": "Vloadbalancerms..vpkg..module-1",
404                         "readOnly": "True"
405                       },
406                       "modelInvariantId": {
407                         "title": "Model Invariant Id (ModelInvariantUUID)",
408                         "type": "string",
409                         "default": "ca052563-eb92-4b5b-ad41-9111768ce043",
410                         "readOnly": "True"
411                       },
412                       "modelVersionId": {
413                         "title": "Model Version Id (ModelUUID)",
414                         "type": "string",
415                         "default": "1e725ccc-b823-4f67-82b9-4f4367070dbc",
416                         "readOnly": "True"
417                       },
418                       "modelName": {
419                         "title": "Model Name",
420                         "type": "string",
421                         "default": "Vloadbalancerms..vpkg..module-1",
422                         "readOnly": "True"
423                       },
424                       "modelVersion": {
425                         "title": "Model Version",
426                         "type": "string",
427                         "default": "1",
428                         "readOnly": "True"
429                       },
430                       "modelCustomizationId": {
431                         "title": "Customization ID",
432                         "type": "string",
433                         "default": "1bffdc31-a37d-4dee-b65c-dde623a76e52",
434                         "readOnly": "True"
435                       }
436                     }
437                   },
438                   {
439                     "title": "VFMODULE-Vloadbalancerms..vdns..module-3",
440                     "properties": {
441                       "type": {
442                         "title": "Type",
443                         "type": "string",
444                         "default": "VFMODULE",
445                         "readOnly": "True"
446                       },
447                       "resourceID": {
448                         "title": "Resource ID",
449                         "type": "string",
450                         "default": "Vloadbalancerms..vdns..module-3",
451                         "readOnly": "True"
452                       },
453                       "modelInvariantId": {
454                         "title": "Model Invariant Id (ModelInvariantUUID)",
455                         "type": "string",
456                         "default": "4c10ba9b-f88f-415e-9de3-5d33336047fa",
457                         "readOnly": "True"
458                       },
459                       "modelVersionId": {
460                         "title": "Model Version Id (ModelUUID)",
461                         "type": "string",
462                         "default": "4fa73b49-8a6c-493e-816b-eb401567b720",
463                         "readOnly": "True"
464                       },
465                       "modelName": {
466                         "title": "Model Name",
467                         "type": "string",
468                         "default": "Vloadbalancerms..vdns..module-3",
469                         "readOnly": "True"
470                       },
471                       "modelVersion": {
472                         "title": "Model Version",
473                         "type": "string",
474                         "default": "1",
475                         "readOnly": "True"
476                       },
477                       "modelCustomizationId": {
478                         "title": "Customization ID",
479                         "type": "string",
480                         "default": "bafcdab0-801d-4d81-9ead-f464640a38b1",
481                         "readOnly": "True"
482                       }
483                     }
484                   },
485                   {
486                     "title": "VFMODULE-Vloadbalancerms..base_template..module-0",
487                     "properties": {
488                       "type": {
489                         "title": "Type",
490                         "type": "string",
491                         "default": "VFMODULE",
492                         "readOnly": "True"
493                       },
494                       "resourceID": {
495                         "title": "Resource ID",
496                         "type": "string",
497                         "default": "Vloadbalancerms..base_template..module-0",
498                         "readOnly": "True"
499                       },
500                       "modelInvariantId": {
501                         "title": "Model Invariant Id (ModelInvariantUUID)",
502                         "type": "string",
503                         "default": "921f7c96-ebdd-42e6-81b9-1cfc0c9796f3",
504                         "readOnly": "True"
505                       },
506                       "modelVersionId": {
507                         "title": "Model Version Id (ModelUUID)",
508                         "type": "string",
509                         "default": "63734409-f745-4e4d-a38b-131638a0edce",
510                         "readOnly": "True"
511                       },
512                       "modelName": {
513                         "title": "Model Name",
514                         "type": "string",
515                         "default": "Vloadbalancerms..base_template..module-0",
516                         "readOnly": "True"
517                       },
518                       "modelVersion": {
519                         "title": "Model Version",
520                         "type": "string",
521                         "default": "1",
522                         "readOnly": "True"
523                       },
524                       "modelCustomizationId": {
525                         "title": "Customization ID",
526                         "type": "string",
527                         "default": "86baddea-c730-4fb8-9410-cd2e17fd7f27",
528                         "readOnly": "True"
529                       }
530                     }
531                   },
532                   {
533                     "title": "VFMODULE-Vloadbalancerms..vlb..module-2",
534                     "properties": {
535                       "type": {
536                         "title": "Type",
537                         "type": "string",
538                         "default": "VFMODULE",
539                         "readOnly": "True"
540                       },
541                       "resourceID": {
542                         "title": "Resource ID",
543                         "type": "string",
544                         "default": "Vloadbalancerms..vlb..module-2",
545                         "readOnly": "True"
546                       },
547                       "modelInvariantId": {
548                         "title": "Model Invariant Id (ModelInvariantUUID)",
549                         "type": "string",
550                         "default": "a772a1f4-0064-412c-833d-4749b15828dd",
551                         "readOnly": "True"
552                       },
553                       "modelVersionId": {
554                         "title": "Model Version Id (ModelUUID)",
555                         "type": "string",
556                         "default": "0f5c3f6a-650a-4303-abb6-fff3e573a07a",
557                         "readOnly": "True"
558                       },
559                       "modelName": {
560                         "title": "Model Name",
561                         "type": "string",
562                         "default": "Vloadbalancerms..vlb..module-2",
563                         "readOnly": "True"
564                       },
565                       "modelVersion": {
566                         "title": "Model Version",
567                         "type": "string",
568                         "default": "1",
569                         "readOnly": "True"
570                       },
571                       "modelCustomizationId": {
572                         "title": "Customization ID",
573                         "type": "string",
574                         "default": "96a78aad-4ffb-4ef0-9c4f-deb03bf1d806",
575                         "readOnly": "True"
576                       }
577                     }
578                   }
579                 ]
580               }
581             }
582           }
583         }
584       }
585     },
586     "guard_policies": {
587       "type": "array",
588       "format": "tabs-top",
589       "title": "Associated Guard policies",
590       "items": {
591         "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}",
592         "anyOf": [
593           {
594             "title": "Guard MinMax",
595             "type": "object",
596             "properties": {
597               "policy-id": {
598                 "type": "string",
599                 "default": "guard.minmax.new",
600                 "pattern": "^(guard.minmax\\..*)$"
601               },
602               "content": {
603                 "properties": {
604                   "actor": {
605                     "type": "string",
606                     "enum": [
607                       "APPC",
608                       "SO",
609                       "VFC",
610                       "SDNC",
611                       "SDNR"
612                     ]
613                   },
614                   "recipe": {
615                     "type": "string",
616                     "enum": [
617                       "Restart",
618                       "Rebuild",
619                       "Migrate",
620                       "Health-Check",
621                       "ModifyConfig",
622                       "VF Module Create",
623                       "VF Module Delete",
624                       "Reroute"
625                     ]
626                   },
627                   "targets": {
628                     "type": "string",
629                     "default": ".*"
630                   },
631                   "clname": {
632                     "type": "string",
633                     "template": "{{loopName}}",
634                     "watch": {
635                       "loopName": "operational_policy.controlLoop.controlLoopName"
636                     }
637                   },
638                   "guardActiveStart": {
639                     "type": "string",
640                     "default": "00:00:00Z"
641                   },
642                   "guardActiveEnd": {
643                     "type": "string",
644                     "default": "10:00:00Z"
645                   },
646                   "min": {
647                     "type": "string",
648                     "default": "0"
649                   },
650                   "max": {
651                     "type": "string",
652                     "default": "1"
653                   }
654                 }
655               }
656             }
657           },
658           {
659             "title": "Guard Frequency",
660             "type": "object",
661             "properties": {
662               "policy-id": {
663                 "type": "string",
664                 "default": "guard.frequency.new",
665                 "pattern": "^(guard.frequency\\..*)$"
666               },
667               "content": {
668                 "properties": {
669                   "actor": {
670                     "type": "string",
671                     "enum": [
672                       "APPC",
673                       "SO",
674                       "VFC",
675                       "SDNC",
676                       "SDNR"
677                     ]
678                   },
679                   "recipe": {
680                     "type": "string",
681                     "enum": [
682                       "Restart",
683                       "Rebuild",
684                       "Migrate",
685                       "Health-Check",
686                       "ModifyConfig",
687                       "VF Module Create",
688                       "VF Module Delete",
689                       "Reroute"
690                     ]
691                   },
692                   "targets": {
693                     "type": "string",
694                     "default": ".*"
695                   },
696                   "clname": {
697                     "type": "string",
698                     "template": "{{loopName}}",
699                     "watch": {
700                       "loopName": "operational_policy.controlLoop.controlLoopName"
701                     }
702                   },
703                   "guardActiveStart": {
704                     "type": "string",
705                     "default": "00:00:00Z"
706                   },
707                   "guardActiveEnd": {
708                     "type": "string",
709                     "default": "10:00:00Z"
710                   },
711                   "limit": {
712                     "type": "string"
713                   },
714                   "timeWindow": {
715                     "type": "string"
716                   },
717                   "timeUnits": {
718                     "type": "string",
719                     "enum": [
720                       "minute",
721                       "hour",
722                       "day",
723                       "week",
724                       "month",
725                       "year"
726                     ]
727                   }
728                 }
729               }
730             }
731           }
732         ]
733       }
734     }
735   }
736 }