DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | 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 |
| 3 | Library RequestsLibrary |
DR695H | 18872bc | 2019-06-13 16:16:52 -0400 | [diff] [blame] | 4 | Library ONAPLibrary.Utilities |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 5 | Library ONAPLibrary.AAI WITH NAME AAI |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 6 | Resource ../global_properties.robot |
| 7 | |
| 8 | *** Variables *** |
| 9 | ${AAI_HEALTH_PATH} /aai/util/echo?action=long |
Jerry Flood | 8a6b0b5 | 2017-11-12 15:44:21 -0500 | [diff] [blame] | 10 | ${VERSIONED_INDEX_PATH} /aai/v11 |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 11 | ${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AAI1_IP_ADDR}:${GLOBAL_AAI_SERVER_PORT} |
| 12 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 13 | |
| 14 | *** Keywords *** |
| 15 | Run A&AI Health Check |
| 16 | [Documentation] Runs an A&AI health check |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 17 | ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} |
| 18 | ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_HEALTH_PATH} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 19 | Should Be Equal As Strings ${resp.status_code} 200 |
| 20 | |
jf9860 | 0f7f265 | 2017-02-22 14:44:06 -0500 | [diff] [blame] | 21 | Delete A&AI Entity |
Jerry Flood | fe22bf1 | 2017-04-21 16:53:10 -0400 | [diff] [blame] | 22 | [Documentation] Deletes an entity in A&AI |
jf9860 | 0f7f265 | 2017-02-22 14:44:06 -0500 | [diff] [blame] | 23 | [Arguments] ${uri} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 24 | ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} |
| 25 | ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${VERSIONED_INDEX_PATH}${uri} auth=${auth} |
| 26 | Run Keyword If '${resp.status_code}' == '200' Delete A&AI Entity Exists ${uri} ${resp.json()['resource-version']} |
jf9860 | 0f7f265 | 2017-02-22 14:44:06 -0500 | [diff] [blame] | 27 | |
| 28 | Delete A&AI Entity Exists |
| 29 | [Documentation] Deletes an A&AI entity |
Jerry Flood | fe22bf1 | 2017-04-21 16:53:10 -0400 | [diff] [blame] | 30 | [Arguments] ${uri} ${resource_version_id} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 31 | ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD} |
| 32 | ${put_resp}= AAI.Run Delete Request ${AAI_FRONTEND_ENDPOINT} ${VERSIONED_INDEX_PATH}${uri} ${resource_version_id} auth=${auth} |
| 33 | Should Be Equal As Strings ${put_resp.status_code} 204 |