summaryrefslogtreecommitdiffstats
path: root/robot/resources/clamp_interface.robot
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-01-17 11:57:59 -0500
committerBrian Freeman <bf1936@att.com>2019-01-17 12:24:21 -0500
commit22d7f7462c62db59f4f81a42c3e94fe49e14d961 (patch)
treedd3a3983e98d98c4b847a648369a0d01b7efe03b /robot/resources/clamp_interface.robot
parentcc84e48d6b9a1d5a16efa59fe9b6cf43aca5fbfe (diff)
Use Variables for model and control loop
Issue-ID: INT-808 Change-Id: Ide97c03776fff1ddc02bff172bd43a9b8ec90326 Signed-off-by: Brian Freeman <bf1936@att.com>
Diffstat (limited to 'robot/resources/clamp_interface.robot')
-rw-r--r--robot/resources/clamp_interface.robot15
1 files changed, 13 insertions, 2 deletions
diff --git a/robot/resources/clamp_interface.robot b/robot/resources/clamp_interface.robot
index 4cf15e8b..4aa87d4d 100644
--- a/robot/resources/clamp_interface.robot
+++ b/robot/resources/clamp_interface.robot
@@ -1,6 +1,8 @@
*** Settings ***
Documentation The main interface for interacting with Microservice Bus.
Library RequestsLibrary
+Library Collections
+Library String
Resource global_properties.robot
@@ -20,15 +22,23 @@ Run CLAMP Get Properties
${resp}= Run Clamp HTTPS Get Request ${data_path}
Run CLAMP Get Control Loop
- [Documentation] runs CLAMP Open Control Loop based on model name
+ [Documentation] runs CLAMP Open Control Loop based on model name and returns control_loop_id
[Arguments] ${model_name}
${data_path}= Set Variable ${CLAMP_BASE_PATH}/clds/model/${model_name}
${resp}= Run Clamp HTTPS Get Request ${data_path}
+ # propText value is a string
+ # propText': u '{"global":[{"name":"service","value":["5fcdb3b7-5a5b-45da-83f6-14cce29181c8"]}
+ Log ${resp.json()['propText']}
+ ${control_loop_id}= Get Regexp Matches ${resp.json()['propText']} \\"service\\",\\"value\\":\\[\\"([0-9a-f\-]{36})\\" 1
+ #Set Suite Variable ${CURRENT_CONTROL_LOOP_ID} ${control_loop_id[0]}
+ [Return] ${control_loop_id[0]}
Run CLAMP Get Model Names
- [Documentation] runs CLAMP Get Model Names
+ [Documentation] runs CLAMP Get Model Names and returns the model_id
${data_path}= Set Variable ${CLAMP_BASE_PATH}/clds/model-names
${resp}= Run Clamp HTTPS Get Request ${data_path}
+ #Set Suite Variable ${CURRENT_MODEL_ID} ${resp.json()[0]['value']}
+ [Return] ${resp.json()[0]['value']}
Run CLAMP Health Check
[Documentation] Runs CLAMP Health check
@@ -53,3 +63,4 @@ Run CLAMP Get Request
Should Be Equal As Integers ${resp.status_code} 200
Log Received response from CLAMP ${resp.text}
[Return] ${resp}
+