From fc3ead31e631f69fabf0baaa20c10bf955ce374b Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Mon, 8 Apr 2019 15:05:22 +0200 Subject: Traffic Distributtion support added * New local polcies for vFW TD use case * Fixed encoding for conductor_request template and parameters section modified to accept all requestParameters * Conductor request can have many attributes in the 'attributes' section - all that are defined in the vnf policy file * Conductor request can have many request parameters in the 'requestParameters' section. The parameters come from QueryPolicies. Before list of suppoted parameters was hardcoded * Optional 'unique' parameter added to the placementDemand section. It is already supported by conductor for all inventory types * Improved debug logs for local policies * Unit tests added for expanded request format Change-Id: I41f219c366a3a77881c7096e64a6272edbada23b Issue-ID: OPTFRA-443 Signed-off-by: Lukasz Rajewski --- osdf/templates/conductor_interface.json | 80 ++++++++++++++++----------------- 1 file changed, 39 insertions(+), 41 deletions(-) (limited to 'osdf/templates/conductor_interface.json') diff --git a/osdf/templates/conductor_interface.json b/osdf/templates/conductor_interface.json index 7377c48..0b8e6a1 100755 --- a/osdf/templates/conductor_interface.json +++ b/osdf/templates/conductor_interface.json @@ -1,41 +1,39 @@ -{ - "name": "{{ name }}", - "files": {}, - "timeout": {{ timeout }}, - "limit": {{ limit }}, - "template": { - "homing_template_version": "2017-10-10", - "parameters": { - "service_name": "{{ service_type }}", - "service_id": "{{ service_id }}", - "customer_lat": {{ latitude }}, - "customer_long": {{ longitude }}, - "REQUIRED_DISK": "{{ required_disk }}", - "REQUIRED_MEM": "{{ required_mem }}" - }, - "locations": { - "customer_loc": { - "latitude": { "get_param": "customer_lat" }, - "longitude": { "get_param": "customer_long" } - } - }, - "demands": {{ json.dumps(demand_list) }}, - {% set comma_main = joiner(",") %} - "constraints": { - {% set comma=joiner(",") %} - {% for elem in policy_groups %} {{ comma() }} - {% for key, value in elem.items() %} - "{{key}}": {{ json.dumps(value) }} - {% endfor %} - {% endfor %} - }, - "optimization": { - {% set comma=joiner(",") %} - {% for elem in optimization_policies %} {{ comma() }} - {% for key, value in elem.items() %} - "{{key}}": {{ json.dumps(value) }} - {% endfor %} - {% endfor %} - } - } -} +{ + "name": "{{ name }}", + "files": {}, + "timeout": {{ timeout }}, + "limit": {{ limit }}, + "template": { + "homing_template_version": "2017-10-10", + "parameters": { + {% set comma=joiner(",") %} + {% for key, value in request_params.items() %} {{ comma() }} + "{{key}}": {{ json.dumps(value) }} + {% endfor %} + }, + "locations": { + "customer_loc": { + "latitude": { "get_param": "customer_lat" }, + "longitude": { "get_param": "customer_long" } + } + }, + "demands": {{ json.dumps(demand_list) }}, + {% set comma_main = joiner(",") %} + "constraints": { + {% set comma=joiner(",") %} + {% for elem in policy_groups %} {{ comma() }} + {% for key, value in elem.items() %} + "{{key}}": {{ json.dumps(value) }} + {% endfor %} + {% endfor %} + }, + "optimization": { + {% set comma=joiner(",") %} + {% for elem in optimization_policies %} {{ comma() }} + {% for key, value in elem.items() %} + "{{key}}": {{ json.dumps(value) }} + {% endfor %} + {% endfor %} + } + } +} -- cgit 1.2.3-korg