summaryrefslogtreecommitdiffstats
path: root/robot/resources/aai/aai_interface.robot
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-07-19 18:20:40 -0400
committerGary Wu <gary.wu@futurewei.com>2019-07-22 20:30:51 +0000
commitd979465ec6720dffbebd22bd83104ea5a5f4e65e (patch)
tree584f93eed3328a3dcdf195d26855717491fac304 /robot/resources/aai/aai_interface.robot
parentfe131258f17c871a738a3fd6b1b73c056a5a5978 (diff)
replace aai keywords with aai lib
Issue-ID: TEST-174 Change-Id: Id4fd63c8f25cd695f77c3e81f658c8dbd99914f4 Signed-off-by: DR695H <dr695h@att.com>
Diffstat (limited to 'robot/resources/aai/aai_interface.robot')
-rw-r--r--robot/resources/aai/aai_interface.robot63
1 files changed, 9 insertions, 54 deletions
diff --git a/robot/resources/aai/aai_interface.robot b/robot/resources/aai/aai_interface.robot
index 5580033f..cc8475fa 100644
--- a/robot/resources/aai/aai_interface.robot
+++ b/robot/resources/aai/aai_interface.robot
@@ -2,6 +2,7 @@
Documentation The main interface for interacting with A&AI. It handles low level stuff like managing the http request library and A&AI required fields
Library RequestsLibrary
Library ONAPLibrary.Utilities
+Library ONAPLibrary.AAI WITH NAME AAI
Resource ../global_properties.robot
*** Variables ***
@@ -13,66 +14,20 @@ ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AA
*** Keywords ***
Run A&AI Health Check
[Documentation] Runs an A&AI health check
- ${resp}= Run A&AI Get Request ${AAI_HEALTH_PATH}
- Should Be Equal As Strings ${resp.status_code} 200
-
-Run A&AI Get Request
- [Documentation] Runs an A&AI get request
- [Arguments] ${data_path}
- Disable Warnings
- ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD}
- ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth}
- ${uuid}= Generate UUID4
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
- ${resp}= Get Request aai ${data_path} headers=${headers}
- Log Received response from aai ${resp.text}
- [Return] ${resp}
-
-Run A&AI Put Request
- [Documentation] Runs an A&AI put request
- [Arguments] ${data_path} ${data}
- Disable Warnings
- ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD}
- ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth}
- ${uuid}= Generate UUID4
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
- ${resp}= Put Request aai ${data_path} data=${data} headers=${headers}
- Log Received response from aai ${resp.text}
- [Return] ${resp}
-
-Run A&AI Post Request
- [Documentation] Runs an A&AI Post request
- [Arguments] ${data_path} ${data}
- Disable Warnings
${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD}
- ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth}
- ${uuid}= Generate UUID4
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
- ${resp}= Post Request aai ${data_path} data=${data} headers=${headers}
- Log Received response from aai ${resp.text}
- [Return] ${resp}
-
-Run A&AI Delete Request
- [Documentation] Runs an A&AI delete request
- [Arguments] ${data_path} ${resource_version}
- Disable Warnings
- ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD}
- ${session}= Create Session aai ${AAI_FRONTEND_ENDPOINT} auth=${auth}
- ${uuid}= Generate UUID4
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
- ${resp}= Delete Request aai ${data_path}?resource-version=${resource_version} headers=${headers}
- Log Received response from aai ${resp.text}
- [Return] ${resp}
+ ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_HEALTH_PATH} auth=${auth}
+ Should Be Equal As Strings ${resp.status_code} 200
Delete A&AI Entity
[Documentation] Deletes an entity in A&AI
[Arguments] ${uri}
- ${get_resp}= Run A&AI Get Request ${VERSIONED_INDEX_PATH}${uri}
- Run Keyword If '${get_resp.status_code}' == '200' Delete A&AI Entity Exists ${uri} ${get_resp.json()['resource-version']}
+ ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD}
+ ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${VERSIONED_INDEX_PATH}${uri} auth=${auth}
+ Run Keyword If '${resp.status_code}' == '200' Delete A&AI Entity Exists ${uri} ${resp.json()['resource-version']}
Delete A&AI Entity Exists
[Documentation] Deletes an A&AI entity
[Arguments] ${uri} ${resource_version_id}
- ${put_resp}= Run A&AI Delete Request ${VERSIONED_INDEX_PATH}${uri} ${resource_version_id}
- Should Be Equal As Strings ${put_resp.status_code} 204
-
+ ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD}
+ ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${VERSIONED_INDEX_PATH}${uri} ${resource_version_id} auth=${auth}
+ Should Be Equal As Strings ${put_resp.status_code} 204 \ No newline at end of file