blob: 076ecd20fe6b5eb4c78baa9be5709b83f90b5d84 [file] [log] [blame]
mrichomme547e3112018-04-13 16:44:04 +02001*** Settings ***
2Documentation The main interface for interacting with External API/NBI
3Library RequestsLibrary
4
5Resource global_properties.robot
6
7*** Variables ***
8${NBI_HEALTH_CHECK_PATH} /nbi/api/v1/status
9${NBI_ENDPOINT} ${GLOBAL_NBI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_NBI_IP_ADDR}:${GLOBAL_NBI_SERVER_PORT}
10
11
12*** Keywords ***
13Run NBI Health Check
14 [Documentation] Runs NBI Health check
15 ${resp}= Run NBI Get Request ${NBI_HEALTH_CHECK_PATH}
16 Should Be Equal As Integers ${resp.status_code} 200
17
18Run NBI Get Request
19 [Documentation] Runs NBI Get request
20 [Arguments] ${data_path}
21 ${session}= Create Session session ${NBI_ENDPOINT}
22 ${resp}= Get Request session ${data_path}
23 Should Be Equal As Integers ${resp.status_code} 200
24 Log Received response from NBI ${resp.text}
25 ${json}= Set Variable ${resp.json()}
26 ${status}= Get From Dictionary ${json} status
27 Should Be Equal ${status} ok
28 [Return] ${resp}