Fix the legacy policies
[clamp.git] / src / test / resources / tosca / operational-policy-json-schema.json
1 {
2   "type": "object",
3   "title": "Configuration",
4   "required": [
5     "operational_policy",
6     "guard_policies"
7   ],
8   "properties": {
9     "operational_policy": {
10       "type": "object",
11       "title": "Related Parameters",
12       "required": [
13         "controlLoop",
14         "policies"
15       ],
16       "properties": {
17         "controlLoop": {
18           "type": "object",
19           "title": "Control Loop details",
20           "required": [
21             "timeout",
22             "abatement",
23             "trigger_policy",
24             "controlLoopName"
25           ],
26           "properties": {
27             "timeout": {
28               "type": "string",
29               "title": "Overall Time Limit",
30               "default": "0",
31               "format": "number"
32             },
33             "abatement": {
34               "type": "string",
35               "title": "Abatement",
36               "enum": [
37                 "True",
38                 "False"
39               ]
40             },
41             "trigger_policy": {
42               "type": "string",
43               "title": "Policy Decision Entry"
44             },
45             "controlLoopName": {
46               "type": "string",
47               "title": "Control loop name",
48               "readOnly": "True"
49             }
50           }
51         },
52         "policies": {
53           "uniqueItems": "true",
54           "id": "policies_array",
55           "type": "array",
56           "title": "Policy Decision Tree",
57           "format": "tabs-top",
58           "items": {
59             "title": "Policy Decision",
60             "type": "object",
61             "id": "policy_item",
62             "headerTemplate": "{{self.id}} - {{self.recipe}}",
63             "format": "categories",
64             "basicCategoryTitle": "recipe",
65             "required": [
66               "id",
67               "retry",
68               "timeout",
69               "actor",
70               "success",
71               "failure",
72               "failure_timeout",
73               "failure_retries",
74               "failure_exception",
75               "failure_guard",
76               "target"
77             ],
78             "properties": {
79               "id": {
80                 "default": "Policy 1",
81                 "title": "Policy ID",
82                 "type": "string"
83               },
84               "retry": {
85                 "default": "0",
86                 "title": "Number of Retry",
87                 "type": "string",
88                 "format": "number"
89               },
90               "timeout": {
91                 "default": "0",
92                 "title": "Timeout",
93                 "type": "string",
94                 "format": "number"
95               },
96               "actor": {
97                 "type": "object",
98                 "title": "Actor",
99                 "anyOf": [
100                   {
101                     "title": "APPC",
102                     "properties": {
103                       "actor": {
104                         "title": "actor",
105                         "type": "string",
106                         "default": "APPC",
107                         "options": {
108                           "hidden": true
109                         }
110                       },
111                       "type": {
112                         "title": "recipe",
113                         "type": "string",
114                         "default": "",
115                         "enum": [
116                           "Restart",
117                           "Rebuild",
118                           "Migrate",
119                           "Health-Check",
120                           "ModifyConfig"
121                         ]
122                       },
123                       "payload": {
124                         "title": "Payload (YAML)",
125                         "type": "string",
126                         "format": "textarea"
127                       }
128                     }
129                   },
130                   {
131                     "title": "SO",
132                     "properties": {
133                       "actor": {
134                         "title": "actor",
135                         "type": "string",
136                         "default": "SO",
137                         "options": {
138                           "hidden": true
139                         }
140                       },
141                       "type": {
142                         "title": "recipe",
143                         "type": "string",
144                         "default": "",
145                         "enum": [
146                           "VF Module Create",
147                           "VF Module Delete"
148                         ]
149                       },
150                       "payload": {
151                         "title": "Payload (YAML)",
152                         "type": "string",
153                         "format": "textarea"
154                       }
155                     }
156                   },
157                   {
158                     "title": "SDNC",
159                     "properties": {
160                       "actor": {
161                         "title": "actor",
162                         "type": "string",
163                         "default": "SDNC",
164                         "options": {
165                           "hidden": true
166                         }
167                       },
168                       "type": {
169                         "title": "recipe",
170                         "type": "string",
171                         "default": "",
172                         "enum": [
173                           "Reroute",
174                           "BandwidthOnDemand"
175                         ]
176                       },
177                       "payload": {
178                         "title": "Payload (YAML)",
179                         "type": "string",
180                         "format": "textarea"
181                       }
182                     }
183                   },
184                   {
185                     "title": "VFC",
186                     "properties": {
187                       "actor": {
188                         "title": "actor",
189                         "type": "string",
190                         "default": "VFC",
191                         "options": {
192                           "hidden": true
193                         }
194                       },
195                       "type": {
196                         "title": "recipe",
197                         "type": "string",
198                         "required": [
199                           "payload"
200                         ],
201                         "default": "",
202                         "enum": [
203                           "ModifyConfig"
204                         ]
205                       },
206                       "payload": {
207                         "title": "Payload (YAML)",
208                         "type": "string",
209                         "format": "textarea"
210                       }
211                     }
212                   },
213                   {
214                     "title": "CDS",
215                     "properties": {
216                       "actor": {
217                         "title": "actor",
218                         "type": "string",
219                         "default": "CDS",
220                         "options": {
221                           "hidden": true
222                         }
223                       },
224                       "type": {
225                         "title": "recipe",
226                         "type": "object",
227                         "required": [
228                           "payload"
229                         ],
230                         "anyOf": [
231                           {
232                             "title": "user-defined",
233                             "properties": {
234                               "type": {
235                                 "title": "Payload (YAML)",
236                                 "type": "string",
237                                 "default": "",
238                                 "format": "textarea"
239                               }
240                             }
241                           },
242                           {
243                             "title": "resource-assignment",
244                             "properties": {
245                               "type": {
246                                 "title": "Payload (YAML)",
247                                 "type": "string",
248                                 "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027",
249                                 "format": "textarea"
250                               }
251                             }
252                           },
253                           {
254                             "title": "activate",
255                             "properties": {
256                               "type": {
257                                 "title": "Payload (YAML)",
258                                 "type": "string",
259                                 "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027",
260                                 "format": "textarea"
261                               }
262                             }
263                           },
264                           {
265                             "title": "activate-restconf",
266                             "properties": {
267                               "type": {
268                                 "title": "Payload (YAML)",
269                                 "type": "string",
270                                 "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027",
271                                 "format": "textarea"
272                               }
273                             }
274                           },
275                           {
276                             "title": "activate-cli",
277                             "properties": {
278                               "type": {
279                                 "title": "Payload (YAML)",
280                                 "type": "string",
281                                 "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027",
282                                 "format": "textarea"
283                               }
284                             }
285                           },
286                           {
287                             "title": "assign-activate",
288                             "properties": {
289                               "type": {
290                                 "title": "Payload (YAML)",
291                                 "type": "string",
292                                 "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027",
293                                 "format": "textarea"
294                               }
295                             }
296                           },
297                           {
298                             "title": "imperative-test-wf",
299                             "properties": {
300                               "type": {
301                                 "title": "Payload (YAML)",
302                                 "type": "string",
303                                 "default": "\u0027artifact_name : \"baseconfiguration\"\nartifact_version : \"1.0.0\"\nmode : async\ndata : \u0027\\\u0027{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"vnf-id\":\"\",\"action-name\":\"\",\"scope-type\":\"\",\"hostname\":\"\",\"vnf_name\":\"\"}}\\\u0027\u0027",
304                                 "format": "textarea"
305                               }
306                             }
307                           }
308                         ]
309                       }
310                     }
311                   }
312                 ]
313               },
314               "success": {
315                 "default": "final_success",
316                 "title": "When Success",
317                 "type": "string"
318               },
319               "failure": {
320                 "default": "final_failure",
321                 "title": "When Failure",
322                 "type": "string"
323               },
324               "failure_timeout": {
325                 "default": "final_failure_timeout",
326                 "title": "When Failure Timeout",
327                 "type": "string"
328               },
329               "failure_retries": {
330                 "default": "final_failure_retries",
331                 "title": "When Failure Retries",
332                 "type": "string"
333               },
334               "failure_exception": {
335                 "default": "final_failure_exception",
336                 "title": "When Failure Exception",
337                 "type": "string"
338               },
339               "failure_guard": {
340                 "default": "final_failure_guard",
341                 "title": "When Failure Guard",
342                 "type": "string"
343               },
344               "target": {
345                 "type": "object",
346                 "required": [
347                   "type",
348                   "resourceID"
349                 ],
350                 "anyOf": [
351                   {
352                     "title": "User Defined",
353                     "additionalProperties": "True",
354                     "properties": {
355                       "type": {
356                         "title": "Target type",
357                         "type": "string",
358                         "default": "",
359                         "enum": [
360                           "VNF",
361                           "VFMODULE",
362                           "VM"
363                         ]
364                       },
365                       "resourceID": {
366                         "title": "Target type",
367                         "type": "string",
368                         "default": ""
369                       }
370                     }
371                   },
372                   {
373                     "title": "VNF-vLoadBalancerMS 0",
374                     "properties": {
375                       "type": {
376                         "title": "Type",
377                         "type": "string",
378                         "default": "VNF",
379                         "readOnly": "True"
380                       },
381                       "resourceID": {
382                         "title": "Resource ID",
383                         "type": "string",
384                         "default": "vLoadBalancerMS",
385                         "readOnly": "True"
386                       }
387                     }
388                   },
389                   {
390                     "title": "VFMODULE-Vloadbalancerms..vpkg..module-1",
391                     "properties": {
392                       "type": {
393                         "title": "Type",
394                         "type": "string",
395                         "default": "VFMODULE",
396                         "readOnly": "True"
397                       },
398                       "resourceID": {
399                         "title": "Resource ID",
400                         "type": "string",
401                         "default": "Vloadbalancerms..vpkg..module-1",
402                         "readOnly": "True"
403                       },
404                       "modelInvariantId": {
405                         "title": "Model Invariant Id (ModelInvariantUUID)",
406                         "type": "string",
407                         "default": "ca052563-eb92-4b5b-ad41-9111768ce043",
408                         "readOnly": "True"
409                       },
410                       "modelVersionId": {
411                         "title": "Model Version Id (ModelUUID)",
412                         "type": "string",
413                         "default": "1e725ccc-b823-4f67-82b9-4f4367070dbc",
414                         "readOnly": "True"
415                       },
416                       "modelName": {
417                         "title": "Model Name",
418                         "type": "string",
419                         "default": "Vloadbalancerms..vpkg..module-1",
420                         "readOnly": "True"
421                       },
422                       "modelVersion": {
423                         "title": "Model Version",
424                         "type": "string",
425                         "default": "1",
426                         "readOnly": "True"
427                       },
428                       "modelCustomizationId": {
429                         "title": "Customization ID",
430                         "type": "string",
431                         "default": "1bffdc31-a37d-4dee-b65c-dde623a76e52",
432                         "readOnly": "True"
433                       }
434                     }
435                   },
436                   {
437                     "title": "VFMODULE-Vloadbalancerms..vdns..module-3",
438                     "properties": {
439                       "type": {
440                         "title": "Type",
441                         "type": "string",
442                         "default": "VFMODULE",
443                         "readOnly": "True"
444                       },
445                       "resourceID": {
446                         "title": "Resource ID",
447                         "type": "string",
448                         "default": "Vloadbalancerms..vdns..module-3",
449                         "readOnly": "True"
450                       },
451                       "modelInvariantId": {
452                         "title": "Model Invariant Id (ModelInvariantUUID)",
453                         "type": "string",
454                         "default": "4c10ba9b-f88f-415e-9de3-5d33336047fa",
455                         "readOnly": "True"
456                       },
457                       "modelVersionId": {
458                         "title": "Model Version Id (ModelUUID)",
459                         "type": "string",
460                         "default": "4fa73b49-8a6c-493e-816b-eb401567b720",
461                         "readOnly": "True"
462                       },
463                       "modelName": {
464                         "title": "Model Name",
465                         "type": "string",
466                         "default": "Vloadbalancerms..vdns..module-3",
467                         "readOnly": "True"
468                       },
469                       "modelVersion": {
470                         "title": "Model Version",
471                         "type": "string",
472                         "default": "1",
473                         "readOnly": "True"
474                       },
475                       "modelCustomizationId": {
476                         "title": "Customization ID",
477                         "type": "string",
478                         "default": "bafcdab0-801d-4d81-9ead-f464640a38b1",
479                         "readOnly": "True"
480                       }
481                     }
482                   },
483                   {
484                     "title": "VFMODULE-Vloadbalancerms..base_template..module-0",
485                     "properties": {
486                       "type": {
487                         "title": "Type",
488                         "type": "string",
489                         "default": "VFMODULE",
490                         "readOnly": "True"
491                       },
492                       "resourceID": {
493                         "title": "Resource ID",
494                         "type": "string",
495                         "default": "Vloadbalancerms..base_template..module-0",
496                         "readOnly": "True"
497                       },
498                       "modelInvariantId": {
499                         "title": "Model Invariant Id (ModelInvariantUUID)",
500                         "type": "string",
501                         "default": "921f7c96-ebdd-42e6-81b9-1cfc0c9796f3",
502                         "readOnly": "True"
503                       },
504                       "modelVersionId": {
505                         "title": "Model Version Id (ModelUUID)",
506                         "type": "string",
507                         "default": "63734409-f745-4e4d-a38b-131638a0edce",
508                         "readOnly": "True"
509                       },
510                       "modelName": {
511                         "title": "Model Name",
512                         "type": "string",
513                         "default": "Vloadbalancerms..base_template..module-0",
514                         "readOnly": "True"
515                       },
516                       "modelVersion": {
517                         "title": "Model Version",
518                         "type": "string",
519                         "default": "1",
520                         "readOnly": "True"
521                       },
522                       "modelCustomizationId": {
523                         "title": "Customization ID",
524                         "type": "string",
525                         "default": "86baddea-c730-4fb8-9410-cd2e17fd7f27",
526                         "readOnly": "True"
527                       }
528                     }
529                   },
530                   {
531                     "title": "VFMODULE-Vloadbalancerms..vlb..module-2",
532                     "properties": {
533                       "type": {
534                         "title": "Type",
535                         "type": "string",
536                         "default": "VFMODULE",
537                         "readOnly": "True"
538                       },
539                       "resourceID": {
540                         "title": "Resource ID",
541                         "type": "string",
542                         "default": "Vloadbalancerms..vlb..module-2",
543                         "readOnly": "True"
544                       },
545                       "modelInvariantId": {
546                         "title": "Model Invariant Id (ModelInvariantUUID)",
547                         "type": "string",
548                         "default": "a772a1f4-0064-412c-833d-4749b15828dd",
549                         "readOnly": "True"
550                       },
551                       "modelVersionId": {
552                         "title": "Model Version Id (ModelUUID)",
553                         "type": "string",
554                         "default": "0f5c3f6a-650a-4303-abb6-fff3e573a07a",
555                         "readOnly": "True"
556                       },
557                       "modelName": {
558                         "title": "Model Name",
559                         "type": "string",
560                         "default": "Vloadbalancerms..vlb..module-2",
561                         "readOnly": "True"
562                       },
563                       "modelVersion": {
564                         "title": "Model Version",
565                         "type": "string",
566                         "default": "1",
567                         "readOnly": "True"
568                       },
569                       "modelCustomizationId": {
570                         "title": "Customization ID",
571                         "type": "string",
572                         "default": "96a78aad-4ffb-4ef0-9c4f-deb03bf1d806",
573                         "readOnly": "True"
574                       }
575                     }
576                   }
577                 ]
578               }
579             }
580           }
581         }
582       }
583     },
584     "guard_policies": {
585       "type": "array",
586       "format": "tabs-top",
587       "title": "Associated Guard policies",
588       "items": {
589         "headerTemplate": "{{self.policy-id}} - {{self.content.recipe}}",
590         "anyOf": [
591           {
592             "title": "Guard MinMax",
593             "type": "object",
594             "properties": {
595               "policy-id": {
596                 "type": "string",
597                 "default": "guard.minmax.new",
598                 "pattern": "^(guard.minmax\\..*)$"
599               },
600               "content": {
601                 "properties": {
602                   "actor": {
603                     "type": "string",
604                     "enum": [
605                       "APPC",
606                       "SO",
607                       "VFC",
608                       "SDNC",
609                       "SDNR"
610                     ]
611                   },
612                   "recipe": {
613                     "type": "string",
614                     "enum": [
615                       "Restart",
616                       "Rebuild",
617                       "Migrate",
618                       "Health-Check",
619                       "ModifyConfig",
620                       "VF Module Create",
621                       "VF Module Delete",
622                       "Reroute"
623                     ]
624                   },
625                   "targets": {
626                     "type": "string",
627                     "default": ".*"
628                   },
629                   "clname": {
630                     "type": "string",
631                     "template": "{{loopName}}",
632                     "watch": {
633                       "loopName": "operational_policy.controlLoop.controlLoopName"
634                     }
635                   },
636                   "guardActiveStart": {
637                     "type": "string",
638                     "default": "00:00:00Z"
639                   },
640                   "guardActiveEnd": {
641                     "type": "string",
642                     "default": "10:00:00Z"
643                   },
644                   "min": {
645                     "type": "string",
646                     "default": "0"
647                   },
648                   "max": {
649                     "type": "string",
650                     "default": "1"
651                   }
652                 }
653               }
654             }
655           },
656           {
657             "title": "Guard Frequency",
658             "type": "object",
659             "properties": {
660               "policy-id": {
661                 "type": "string",
662                 "default": "guard.frequency.new",
663                 "pattern": "^(guard.frequency\\..*)$"
664               },
665               "content": {
666                 "properties": {
667                   "actor": {
668                     "type": "string",
669                     "enum": [
670                       "APPC",
671                       "SO",
672                       "VFC",
673                       "SDNC",
674                       "SDNR"
675                     ]
676                   },
677                   "recipe": {
678                     "type": "string",
679                     "enum": [
680                       "Restart",
681                       "Rebuild",
682                       "Migrate",
683                       "Health-Check",
684                       "ModifyConfig",
685                       "VF Module Create",
686                       "VF Module Delete",
687                       "Reroute"
688                     ]
689                   },
690                   "targets": {
691                     "type": "string",
692                     "default": ".*"
693                   },
694                   "clname": {
695                     "type": "string",
696                     "template": "{{loopName}}",
697                     "watch": {
698                       "loopName": "operational_policy.controlLoop.controlLoopName"
699                     }
700                   },
701                   "guardActiveStart": {
702                     "type": "string",
703                     "default": "00:00:00Z"
704                   },
705                   "guardActiveEnd": {
706                     "type": "string",
707                     "default": "10:00:00Z"
708                   },
709                   "limit": {
710                     "type": "string"
711                   },
712                   "timeWindow": {
713                     "type": "string"
714                   },
715                   "timeUnits": {
716                     "type": "string",
717                     "enum": [
718                       "minute",
719                       "hour",
720                       "day",
721                       "week",
722                       "month",
723                       "year"
724                     ]
725                   }
726                 }
727               }
728             }
729           }
730         ]
731       }
732     }
733   }
734 }