vrvarma | 3fe70c7 | 2018-09-28 10:30:00 -0400 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Suite description |
| 3 | Library OperatingSystem |
| 4 | Library RequestsLibrary |
| 5 | Library json |
| 6 | Library RequestsLibrary |
| 7 | *** Variables *** |
| 8 | &{headers}= Content-Type=application/json Accept=application/json |
| 9 | *** Keywords *** |
| 10 | Verify 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 | |
| 20 | Http 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 | |
| 30 | Http 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 | |
| 41 | Http 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} |