blob: 456e119b1f5c088293d5d74734902dfe8ce0521f [file] [log] [blame]
DR695Hce07d412018-04-11 22:28:41 -04001*** Settings ***
2Documentation The main interface for interacting with MUSIC. It handles low level stuff like managing the http request library and MUSIC required fields
3Library RequestsClientCert
4Library RequestsLibrary
5Library UUID
6
7Resource ../global_properties.robot
8
9*** Variables ***
Brian Freemana5fe4cc2018-04-17 08:00:37 -050010${MUSIC_HEALTH_CHECK_PATH} /MUSIC/rest/v2/version
DR695Hce07d412018-04-11 22:28:41 -040011${MUSIC_ENDPOINT} ${GLOBAL_MUSIC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_MUSIC_IP_ADDR}:${GLOBAL_MUSIC_SERVER_PORT}
12
13*** Keywords ***
14Run MUSIC Health Check
15 [Documentation] Runs MUSIC Health check
16 ${resp}= Run MUSIC Get Request ${MUSIC_HEALTH_CHECK_PATH}
17 Should Be Equal As Strings ${resp.status_code} 200
18 Should Be Equal As Strings ${resp.json()['status']} SUCCESS
19
20Run MUSIC Get Request
21 [Documentation] Runs MUSIC Get request
22 [Arguments] ${data_path}
23 ${session}= Create Session music ${MUSIC_ENDPOINT}
24 ${uuid}= Generate UUID
25 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
26 ${resp}= Get Request music ${data_path} headers=${headers}
27 Log Received response from music ${resp.text}
Brian Freemana5fe4cc2018-04-17 08:00:37 -050028 [Return] ${resp}