summaryrefslogtreecommitdiffstats
path: root/robot/resources/clamp_interface.robot
diff options
context:
space:
mode:
authorBrian Freeman <bf1936@att.com>2019-01-17 13:48:16 -0500
committerBrian Freeman <bf1936@att.com>2019-01-17 13:48:23 -0500
commit893c12a45db90f35dea17d4bd255b5f9436d8cd9 (patch)
tree86d5c6066efc69e1d4d55f04fa3f23216a706c78 /robot/resources/clamp_interface.robot
parent22d7f7462c62db59f4f81a42c3e94fe49e14d961 (diff)
Add Create Model
Issue-ID: INT-808 Change-Id: I009cb83315d6310cb244d7ec422a9c90c54bbb5a Signed-off-by: Brian Freeman <bf1936@att.com>
Diffstat (limited to 'robot/resources/clamp_interface.robot')
-rw-r--r--robot/resources/clamp_interface.robot25
1 files changed, 24 insertions, 1 deletions
diff --git a/robot/resources/clamp_interface.robot b/robot/resources/clamp_interface.robot
index 4aa87d4d..4d29b095 100644
--- a/robot/resources/clamp_interface.robot
+++ b/robot/resources/clamp_interface.robot
@@ -3,8 +3,10 @@ Documentation The main interface for interacting with Microservice Bus.
Library RequestsLibrary
Library Collections
Library String
+Library JSONUtils
Resource global_properties.robot
+Resource json_templater.robot
*** Variables ***
${CLAMP_HEALTH_CHECK_PATH} /restservices/clds/v1/healthcheck
@@ -13,8 +15,19 @@ ${CLAMP_BASE_PATH} /restservices/clds/v1
${CLAMP_CLIENT_KEY} robot/assets/keys/org.onap.clamp.key.clear.pem
${CLAMP_CLIENT_CERT} robot/assets/keys/org.onap.clamp.cert.pem
+${CLAMP_TEMPLATE_PATH} robot/assets/templates/clamp
+
*** Keywords ***
+Run CLAMP Create Model
+ [Documentation] Create a new CLAMP Model
+ [Arguments] ${model_name} ${template_name}
+ ${dict}= Create Dictionary MODEL_NAME=${model_name} TEMPLATE_NAME=${template_name}
+ ${data}= Fill JSON Template File ${CLAMP_TEMPLATE_PATH}/create_model.template ${dict}
+ ${data_path}= Set Variable ${CLAMP_BASE_PATH}/clds/model/${model_name}
+ ${resp}= Run CLAMP HTTPS Put Request ${data_path} ${data}
+ Should Be Equal As Strings ${resp.status_code} 200
+
Run CLAMP Get Properties
[Documentation] get CLAMP Control Loop properties
[Arguments] ${property_id}
@@ -45,6 +58,17 @@ Run CLAMP Health Check
${resp}= Run CLAMP Get Request ${CLAMP_HEALTH_CHECK_PATH}
Should Be Equal As Integers ${resp.status_code} 200
+Run CLAMP HTTPS Put Request
+ [Documentation] Runs CLAMP HTTPS Put request
+ [Arguments] ${data_path} ${data}
+ @{client_certs}= Create List ${CLAMP_CLIENT_CERT} ${CLAMP_CLIENT_KEY}
+ ${session}= Create Client Cert Session session ${CLAMP_ENDPOINT} client_certs=@{client_certs}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Put Request session ${data_path} data=${data} headers=${headers}
+ Should Be Equal As Integers ${resp.status_code} 200
+ Log ${resp.json()}
+ [Return] ${resp}
+
Run CLAMP HTTPS Get Request
[Documentation] Runs CLAMP HTTPS Get request
[Arguments] ${data_path}
@@ -63,4 +87,3 @@ Run CLAMP Get Request
Should Be Equal As Integers ${resp.status_code} 200
Log Received response from CLAMP ${resp.text}
[Return] ${resp}
-