aboutsummaryrefslogtreecommitdiffstats
path: root/robot/resources/bc_interface.robot
blob: 7d4c1fb106f2a2481115d4191e04d31f25b671f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
*** Settings ***
Documentation     The main interface for interacting with Bus Controller.
Library           RequestsLibrary

Resource          global_properties.robot

*** Variables ***
${BC_HEALTH_CHECK_PATH}        /webapi/dmaap
${BC_HTTPS_ENDPOINT}     https://${GLOBAL_INJECTED_BC_IP_ADDR}:${GLOBAL_BC_HTTPS_SERVER_PORT}


*** Keywords ***
Run BC Health Check With Basic Auth
     [Documentation]    Runs dmaap details check
     ${resp}=    Return dmaap details with basic auth    ${BC_HEALTH_CHECK_PATH}
     Should Be Equal As Strings        ${resp.status_code}     200


Return dmaap details with basic auth
     [Documentation]    Runs Bus Controller get details request with basic authentication
     [Arguments]    ${data_path}
     ${auth}=  Create List     ${GLOBAL_BC_USERNAME}   ${GLOBAL_BC_PASSWORD}
     ${session}=    Create Session      bs      ${BC_HTTPS_ENDPOINT}    auth=${auth}
     ${resp}=   Get Request     bs      ${data_path}
     Log    Received response from bus controller ${resp.text}
     [Return]    ${resp}

Delete MR topic
    [Documentation]    Runs Bus Controller to remove topic
    [Arguments]    ${data_path}
    ${auth}=  Create List     ${GLOBAL_BC_USERNAME}   ${GLOBAL_BC_PASSWORD}
    ${session}=    Create Session      bs      ${BC_HTTPS_ENDPOINT}    auth=${auth}
    ${resp}=   Delete Request     bs      ${data_path}
    Log    Received response from bus controller ${resp.status_code}
    [Return]    ${resp}