blob: 7d53b3780f992d90fcd9ef3727298785c801499b [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with Portal. It handles low level stuff like managing the http request library and Portal required fields
3Library RequestsClientCert
4Library RequestsLibrary
5Library UUID
6
7Resource global_properties.robot
8
9*** Variables ***
10${PORTAL_HEALTH_CHECK_PATH} /ECOMPPORTAL/portalApi/healthCheck
11
12*** Keywords ***
13Run Portal Health Check
14 [Documentation] Runs Portal Health check
15 ${resp}= Run Portal Get Request ${PORTAL_HEALTH_CHECK_PATH}
16 Should Be Equal As Strings ${resp.status_code} 200
17 Should Be Equal As Strings ${resp.json()['statusCode']} 200
18
19Run Portal Get Request
20 [Documentation] Runs Portal Get request
21 [Arguments] ${data_path}
22 ${session}= Create Session portal ${GLOBAL_PORTAL_SERVER}
23 ${uuid}= Generate UUID
24 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
25 ${resp}= Get Request portal ${data_path} headers=${headers}
26 Log Received response from portal ${resp.text}
27 [Return] ${resp}
28