diff options
3 files changed, 55 insertions, 9 deletions
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 index 00000000..be0d3ce7 --- /dev/null +++ b/robot/assets/templates/policy/vFirewall_policy_operational_content_input.jinja @@ -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" + } + } + } + ] + } +} diff --git a/robot/assets/templates/policy/vFirewall_push.jinja b/robot/assets/templates/policy/vFirewall_push.jinja index 92f02fd6..37795a87 100644 --- a/robot/assets/templates/policy/vFirewall_push.jinja +++ b/robot/assets/templates/policy/vFirewall_push.jinja @@ -6,7 +6,7 @@ }, { "policy-id": "operational.modifyconfig", - "policy-version": "{{OP_POLICY_VERSION}}.0.0" + "policy-version": "{{OP_POLICY_VERSION}}" } ] } diff --git a/robot/resources/policy_interface.robot b/robot/resources/policy_interface.robot index 71311a81..2175f7b7 100644 --- a/robot/resources/policy_interface.robot +++ b/robot/resources/policy_interface.robot @@ -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} |