remove url_encoded operational policy 70/107270/3
authorBrian Freeman <bf1936@att.com>
Wed, 6 May 2020 20:10:06 +0000 (15:10 -0500)
committerMarco Platania <platania@research.att.com>
Thu, 7 May 2020 12:42:14 +0000 (12:42 +0000)
add Payload back into template
fix tabs and remove commented out lines

Issue-ID: INT-1350
Change-Id: Ieeaa6c9f6b2e18c4ee5cf433504654897f6157bb
Signed-off-by: Brian Freeman <bf1936@att.com>
robot/assets/templates/policy/vFirewall_policy_operational_content_input.jinja [new file with mode: 0644]
robot/assets/templates/policy/vFirewall_push.jinja
robot/resources/policy_interface.robot

diff --git a/robot/assets/templates/policy/vFirewall_policy_operational_content_input.jinja b/robot/assets/templates/policy/vFirewall_policy_operational_content_input.jinja
new file mode 100644 (file)
index 0000000..be0d3ce
--- /dev/null
@@ -0,0 +1,51 @@
+{
+    "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
+    "topology_template": {
+        "policies": [
+            {
+                "operational.modifyconfig": {
+                    "type": "onap.policies.controlloop.operational.common.Drools",
+                    "type_version": "1.0.0",
+                    "version": "1.0.0",
+                    "metadata": {
+                        "policy-id": "operational.modifyconfig"
+                    },
+                    "properties": {
+                        "id": "ControlLoop-vFirewall-{{RESOURCE_ID}}",
+                        "timeout": 1200,
+                        "abatement": false,
+                        "trigger": "unique-policy-id-1-modifyConfig",
+                        "operations": [
+                            {
+                                "id": "unique-policy-id-1-modifyConfig",
+                                "description": "Modify the packet generator",
+                                "operation": {
+                                    "actor": "APPC",
+                                    "operation": "ModifyConfig",
+                                    "target": {
+                                        "targetType": "VNF",
+                                        "entityIds": {
+                                            "resourceID": "{{RESOURCE_ID}}"
+                                        }
+                                    },
+                                    "payload": {
+                                        "streams": "{\"active-streams\": 5 }"
+                                    }
+                                },
+                                "timeout": 300,
+                                "retries": 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"
+                            }
+                        ],
+                        "controllerName": "frankfurt"
+                    }
+                }
+            }
+        ]
+    }
+}
index 92f02fd..37795a8 100644 (file)
@@ -6,7 +6,7 @@
     },
     {
       "policy-id": "operational.modifyconfig",
-      "policy-version": "{{OP_POLICY_VERSION}}.0.0"
+      "policy-version": "{{OP_POLICY_VERSION}}"
     }
   ]
 }
index 71311a8..2175f7b 100644 (file)
@@ -221,16 +221,11 @@ Create vFirewall Operational Policy
     [Arguments]   ${resource_id}
     ${dict}=   Create Dictionary   RESOURCE_ID=${resource_id}
     Templating.Create Environment    policy    ${GLOBAL_TEMPLATE_FOLDER}
-    #${content_data}    OperatingSystem.Get File    ${GLOBAL_TEMPLATE_FOLDER}/${POLICY_TEMPLATES}/vFirewall_policy_operational_content.yaml
-    ${content_data}    OperatingSystem.Get File    ${GLOBAL_ASSETS_FOLDER}/policy/vFirewall_policy_operational_content.yaml
-    ${content_data}=    Replace String Using Regexp   ${content_data}    __RESOURCE_ID__     ${resource_id}
-    ${encoded_content_data}=    Evaluate    urllib.quote_plus('''${content_data}''')   urllib
-    ${content_dictionary}=   Create Dictionary    URL_ENCODED_CONTENT    ${encoded_content_data}
-    ${data_2}=   Templating.Apply Template    policy    ${POLICY_TEMPLATES}/vFirewall_policy_operational_url_enc_content_input.jinja   ${content_dictionary}
+    ${data_2}=   Templating.Apply Template    policy    ${POLICY_TEMPLATES}/vFirewall_policy_operational_content_input.jinja   ${dict}
     Log    ${data_2}
-    ${resp}=   Run Policy Api Post Request    /policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies    ${data_2}
+    ${resp}=   Run Policy Api Post Request    /policy/api/v1/policytypes/onap.policies.controlloop.operational.common.Drools/versions/1.0.0/policies    ${data_2}
     Should Be Equal As Strings         ${resp.status_code}     200
-    [Return]    ${resp.json()['policy-version']}
+    [Return]    ${resp.json()['version']}
 
 Push vFirewall Policies To PDP Group
     [Arguments]    ${op_policy_version}