blob: cc8475fa4719f8f4a62f2bb0cf309deed6da6a55 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with A&AI. It handles low level stuff like managing the http request library and A&AI required fields
3Library RequestsLibrary
DR695H18872bc2019-06-13 16:16:52 -04004Library ONAPLibrary.Utilities
DR695Hd9794652019-07-19 18:20:40 -04005Library ONAPLibrary.AAI WITH NAME AAI
DR695Hccff30b2017-02-17 18:44:24 -05006Resource ../global_properties.robot
7
8*** Variables ***
9${AAI_HEALTH_PATH} /aai/util/echo?action=long
Jerry Flood8a6b0b52017-11-12 15:44:21 -050010${VERSIONED_INDEX_PATH} /aai/v11
DR695Hbf5a3a32017-06-30 13:09:57 -040011${AAI_FRONTEND_ENDPOINT} ${GLOBAL_AAI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_AAI1_IP_ADDR}:${GLOBAL_AAI_SERVER_PORT}
12
DR695Hccff30b2017-02-17 18:44:24 -050013
14*** Keywords ***
15Run A&AI Health Check
16 [Documentation] Runs an A&AI health check
DR695Hd9794652019-07-19 18:20:40 -040017 ${auth}= Create List ${GLOBAL_AAI_USERNAME} ${GLOBAL_AAI_PASSWORD}
18 ${resp}= AAI.Run Get Request ${AAI_FRONTEND_ENDPOINT} ${AAI_HEALTH_PATH} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050019 Should Be Equal As Strings ${resp.status_code} 200
20
jf98600f7f2652017-02-22 14:44:06 -050021Delete A&AI Entity
Jerry Floodfe22bf12017-04-21 16:53:10 -040022 [Documentation] Deletes an entity in A&AI
jf98600f7f2652017-02-22 14:44:06 -050023 [Arguments] ${uri}
DR695Hd9794652019-07-19 18:20:40 -040024 ${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']}
jf98600f7f2652017-02-22 14:44:06 -050027
28Delete A&AI Entity Exists
29 [Documentation] Deletes an A&AI entity
Jerry Floodfe22bf12017-04-21 16:53:10 -040030 [Arguments] ${uri} ${resource_version_id}
DR695Hd9794652019-07-19 18:20:40 -040031 ${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