Payload is expected as string in operational policy
[clamp.git] / src / test / resources / tosca / operational-policy-properties.json
index bfce6b3..aaf9dc3 100644 (file)
 {
-       "guard_policies": {
-               "guard1":{
-                       "recipe": "Rebuild",
-                       "actor": "SO",
-                       "clname": "testloop",
-                       "targets": ".*",
-                       "min": "3",
-                       "max": "7",
-                       "limit": "",
-                       "timeUnits": "",
-                       "timeWindow": "",
-                       "guardActiveStart": "00:00:01-05:00",
-                       "guardActiveEnd": "23:59:01-05:00"
-               },
-               "guard2":{
-                       "recipe": "Migrate",
-                       "actor": "SO",
-                       "clname": "testloop",
-                       "targets": ".*",
-                       "min": "1",
-                       "max": "2",
-                       "limit": "",
-                       "timeUnits": "",
-                       "timeWindow": "",
-                       "guardActiveStart": "00:00:01-05:00",
-                       "guardActiveEnd": "23:59:01-05:00"
-               }
-       },
-       "operational_policy": {
-               "controlLoop": {
-                       "controlLoopName": "control loop",
-                       "version": "2.0.0",
-                       "trigger_policy": "new1",
-                       "timeout": "30",
-                       "abatement": "true"
-               },
-               "policies": [
-                       {
-                               "id": "new1",
-                               "recipe": "Rebuild",
-                               "retry": "10",
-                               "timeout": "20",
-                               "actor": "SO",
-                               "payload": "requestParameters: '{\"usePreload\":true,\"userParams\":[]}'\r\nconfigurationParameters: '[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[10].value\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[15].value\",\"enabled\":\"$.vf-module-topology.vf-module-parameters.param[22].value\"}]'",
-                               "success": "new2",
-                               "failure": "new2",
-                               "failure_timeout": "new2",
-                               "failure_retries": "new2",
-                               "failure_exception": "new2",
-                               "failure_guard": "new2",
-                               "target": {
-                                       "type": "VFC",
-                                       "resourceTargetId": "test"
-                               }
-                       },
-                       {
-                               "id": "new2",
-                               "recipe": "Migrate",
-                               "retry": "30",
-                               "timeout": "40",
-                               "actor": "SDNC",
-                               "payload": "",
-                               "target": {
-                                       "type": "VFC",
-                                       "resourceTargetId": "test"
-                               }
-                       }
-               ]
-       }
+  "operational_policy": {
+    "controlLoop": {
+      "timeout": "0",
+      "abatement": "True",
+      "trigger_policy": "policy1",
+      "controlLoopName": "LOOP_ASJOy_v1_0_ResourceInstanceName1_tca"
+    },
+    "policies": [
+      {
+        "actor": {
+          "actor": "APPC",
+          "recipe": "Restart",
+          "payload": "requestParameters: '{\"usePreload\":true,\"userParams\":[]}'\r\nconfigurationParameters: '[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[10].value\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[15].value\",\"enabled\":\"$.vf-module-topology.vf-module-parameters.param[22].value\"}]'"
+        },
+        "id": "policy1",
+        "retry": "0",
+        "timeout": "0",
+        "success": "final_success",
+        "failure": "policy2",
+        "failure_timeout": "final_failure_timeout",
+        "failure_retries": "final_failure_retries",
+        "failure_exception": "final_failure_exception",
+        "failure_guard": "final_failure_guard",
+        "target": {
+          "type": "VNF",
+          "resourceID": "vLoadBalancerMS"
+        }
+      },
+      {
+        "actor": {
+          "actor": "SO",
+          "recipe": "VF Module Create",
+          "payload": ""
+        },
+        "id": "policy2",
+        "retry": "0",
+        "timeout": "0",
+        "success": "final_success",
+        "failure": "final_failure",
+        "failure_timeout": "final_failure_timeout",
+        "failure_retries": "final_failure_retries",
+        "failure_exception": "final_failure_exception",
+        "failure_guard": "final_failure_guard",
+        "target": {
+          "type": "VFMODULE",
+          "resourceID": "Vloadbalancerms..vpkg..module-1",
+          "modelInvariantId": "ca052563-eb92-4b5b-ad41-9111768ce043",
+          "modelVersionId": "1e725ccc-b823-4f67-82b9-4f4367070dbc",
+          "modelName": "Vloadbalancerms..vpkg..module-1",
+          "modelVersion": "1",
+          "modelCustomizationId": "1bffdc31-a37d-4dee-b65c-dde623a76e52"
+        }
+      },
+      {
+        "actor": {
+          "actor": "CDS",
+          "recipe": {
+            "recipe": "resource-assignment",
+            "payload": {
+              "artifact_name": "baseconfiguration",
+              "artifact_version": "1.0.0",
+              "mode": "async",
+              "data": {
+                "resource-assignment-properties": {
+                  "request-id": "request-id",
+                  "service-instance-id": "service-instance-id",
+                  "vnf-id": "vnf-id",
+                  "action-name": "action-name",
+                  "scope-type": "scope-type",
+                  "hostname": "hostname",
+                  "vnf_name": "vnf_name"
+                }
+              }
+            }
+          }
+        },
+        "id": "policy3",
+        "retry": "0",
+        "timeout": "0",
+        "success": "final_success",
+        "failure": "final_failure",
+        "failure_timeout": "final_failure_timeout",
+        "failure_retries": "final_failure_retries",
+        "failure_exception": "final_failure_exception",
+        "failure_guard": "final_failure_guard",
+        "target": {
+          "type": "VFMODULE",
+          "resourceID": "Vloadbalancerms..vpkg..module-1",
+          "modelInvariantId": "ca052563-eb92-4b5b-ad41-9111768ce043",
+          "modelVersionId": "1e725ccc-b823-4f67-82b9-4f4367070dbc",
+          "modelName": "Vloadbalancerms..vpkg..module-1",
+          "modelVersion": "1",
+          "modelCustomizationId": "1bffdc31-a37d-4dee-b65c-dde623a76e52"
+        }
+      },
+      {
+        "actor": {
+          "actor": "CDS",
+          "recipe": {
+            "recipe": "modify-config",
+            "payload": {
+              "artifact_name": "baseconfiguration",
+              "artifact_version": "1.0.0",
+              "mode": "async",
+              "data": {
+              }
+            }
+          }
+        },
+        "id": "policy4",
+        "retry": "0",
+        "timeout": "0",
+        "success": "final_success",
+        "failure": "final_failure",
+        "failure_timeout": "final_failure_timeout",
+        "failure_retries": "final_failure_retries",
+        "failure_exception": "final_failure_exception",
+        "failure_guard": "final_failure_guard",
+        "target": {
+          "type": "VFMODULE",
+          "resourceID": "Vloadbalancerms..vpkg..module-1",
+          "modelInvariantId": "ca052563-eb92-4b5b-ad41-9111768ce043",
+          "modelVersionId": "1e725ccc-b823-4f67-82b9-4f4367070dbc",
+          "modelName": "Vloadbalancerms..vpkg..module-1",
+          "modelVersion": "1",
+          "modelCustomizationId": "1bffdc31-a37d-4dee-b65c-dde623a76e52"
+        }
+      }
+    ]
+  },
+  "guard_policies": [
+    {
+      "policy-id": "guard.minmax.new",
+      "content": {
+        "actor": "APPC",
+        "recipe": "Restart",
+        "targets": ".*",
+        "clname": "LOOP_ASJOy_v1_0_ResourceInstanceName1_tca",
+        "guardActiveStart": "00:00:00Z",
+        "guardActiveEnd": "10:00:00Z",
+        "min": "0",
+        "max": "1"
+      }
+    },
+    {
+      "policy-id": "guard.frequency.new",
+      "content": {
+        "actor": "APPC",
+        "recipe": "Rebuild",
+        "targets": ".*",
+        "clname": "LOOP_ASJOy_v1_0_ResourceInstanceName1_tca",
+        "guardActiveStart": "00:00:00Z",
+        "guardActiveEnd": "10:00:00Z",
+        "limit": "1",
+        "timeWindow": "2",
+        "timeUnits": "minute"
+      }
+    }
+  ]
 }