diff options
author | Brian Freeman <bf1936@att.com> | 2020-12-01 15:38:15 -0500 |
---|---|---|
committer | Brian Freeman <bf1936@att.com> | 2020-12-01 15:40:18 -0500 |
commit | fcfe34d074fa76f89f76dc922bbfa4b7c9704f02 (patch) | |
tree | cc4f3fcb28f7605a48b9657d52883eb1926515b7 /robot/resources/consul_interface.robot | |
parent | e2f4460bb333eab3a2c6d628cadd6f45a6723d53 (diff) |
Change to tcagen2 consul
Issue-ID: INT-1702
Change-Id: I45d1da6aa44b2a9820d834ef6a9fc1881b8238db
Signed-off-by: Brian Freeman <bf1936@att.com>
Diffstat (limited to 'robot/resources/consul_interface.robot')
-rw-r--r-- | robot/resources/consul_interface.robot | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/robot/resources/consul_interface.robot b/robot/resources/consul_interface.robot index d5d4e8da..5b6f948f 100644 --- a/robot/resources/consul_interface.robot +++ b/robot/resources/consul_interface.robot @@ -11,17 +11,17 @@ ${CONSUL_ENDPOINT} http://consul.onap:8500 *** Keywords *** Run Consul Get Request - [Documentation] Runs Consul Get Request + [Documentation] Runs Consul Tcagen2 Get Request [Arguments] ${data_path} ${session}= Create Session consul ${CONSUL_ENDPOINT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${resp}= Get Request consul ${data_path} headers=${headers} - Log Received response from policy ${resp.text} + Log Received response from tcagen2 ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp} Run Consul Put Request - [Documentation] Runs Consul Put request + [Documentation] Runs Consul Tcagen2 Put request [Arguments] ${data_path} ${data} ${session}= Create Session consul ${CONSUL_ENDPOINT} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -33,16 +33,16 @@ Update Tca ControlLoopName [Arguments] ${resource_id} ${closedLoopControlName}= Set Variable ControlLoop-vFirewall-${resource_id} Log Obtained closedLoopControlName ${closedLoopControlName} - ${resp}= Run Consul Get Request /v1/kv/dcae-tca-analytics + ${resp}= Run Consul Get Request /v1/kv/dcae-tcagen2 Should Be Equal As Strings ${resp.status_code} 200 ${base64Obj}= Set Variable ${resp.json()[0]["Value"]} ${binObj}= Evaluate base64.b64decode("${base64Obj}") modules=base64 ${escaped}= Replace String ${binObj} \\ \\\\ ${dict}= Evaluate json.loads('${escaped}') json - ${tca_policy}= Set Variable ${dict['app_preferences']['tca_policy']} + ${tca_policy}= Set Variable ${dict['tca.policy']} ${mdf_tca_policy}= Replace String Using Regexp ${tca_policy} ControlLoop-vFirewall[^"]* ${closedLoopControlName} - Set To Dictionary ${dict['app_preferences']} tca_policy=${mdf_tca_policy} + #Set To Dictionary ${dict['app_preferences']} tca_policy=${mdf_tca_policy} + Set To Dictionary ${dict} tca.policy=${mdf_tca_policy} ${json}= Evaluate json.dumps(${dict}) json - ${resp}= Run Consul Put Request /v1/kv/dcae-tca-analytics data=${json} + ${resp}= Run Consul Put Request /v1/kv/dcae-tcagen2 data=${json} Should Be Equal As Strings ${resp.status_code} 200 - |