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