blob: ea45f09d71e8e8366a6c5e395ec675b518c8a7d7 [file] [log] [blame]
vrvarma3fe70c72018-09-28 10:30:00 -04001*** Settings ***
2Documentation Suite description
3Library OperatingSystem
4Library RequestsLibrary
5Library json
6Library RequestsLibrary
7*** Variables ***
8&{headers}= Content-Type=application/json Accept=application/json
9*** Keywords ***
10Verify Docker RC Status
11 [Documentation] Method to verify whether docker instance is up and running
12 [Arguments] ${process_name}
13 ${rc} ${output}= Run and Return RC and Output docker ps
14 Log To Console *********************
15 Log To Console retrurn_code = ${rc}
16 Log To Console output = ${output}
17 Should Be Equal As Integers ${rc} 0
18 Should Contain ${output} ${process_name}
19
20Http Get
21 [Documentation] Wrapper for Http GET
22 [Arguments] ${host} ${restUrl}
23 Create Session optf-osdf ${host}
24 ${resp}= Get Request optf-osdf ${restUrl} headers=${headers}
25 Log To Console *********************
26 Log To Console response = ${resp}
27 Log To Console body = ${resp.text}
28 [Return] ${resp}
29
30Http Post
31 [Documentation] Wrapper for Http POST
32 [Arguments] ${host} ${restUrl} ${auth} ${data}
33 ${pci_auth}= Create List ${auth['username']} ${auth['password']}
34 Create Session optf-osdf ${host} headers=${headers} auth=${pci_auth}
35 ${resp}= Post Request optf-osdf ${restUrl} data=${data} headers=${headers}
36 Log To Console *********************
37 Log To Console response = ${resp}
38 Log To Console body = ${resp.text}
39 [Return] ${resp}
40
41Http Put
42 [Documentation] Wrapper for Http PUT
43 [Arguments] ${host} ${restUrl} ${auth} ${data}
44 ${pci_auth}= Create List ${auth['username']} ${auth['password']}
45 Create Session optf-osdf ${host} headers=${headers} auth=${pci_auth}
46 ${resp}= Put Request optf-osdf ${restUrl} data=${data} headers=${headers}
47 Log To Console *********************
48 Log To Console response = ${resp}
49 Log To Console body = ${resp.text}
50 [Return] ${resp}