Bartosz Gardziejewski | 64b0fe1 | 2020-10-06 08:12:12 +0200 | [diff] [blame] | 1 | *** Settings *** |
Bartosz Gardziejewski | e872513 | 2020-10-06 14:03:36 +0200 | [diff] [blame] | 2 | Resource ./vnfsdk_properties.robot |
| 3 | |
Bartosz Gardziejewski | 64b0fe1 | 2020-10-06 08:12:12 +0200 | [diff] [blame] | 4 | Library OperatingSystem |
| 5 | Library Process |
| 6 | Library String |
| 7 | Library Collections |
| 8 | Library RequestsLibrary |
| 9 | Library json |
| 10 | |
Bartosz Gardziejewski | e872513 | 2020-10-06 14:03:36 +0200 | [diff] [blame] | 11 | *** Keywords *** |
Bartosz Gardziejewski | 64b0fe1 | 2020-10-06 08:12:12 +0200 | [diff] [blame] | 12 | |
Bartosz Gardziejewski | e872513 | 2020-10-06 14:03:36 +0200 | [diff] [blame] | 13 | Validate CSAR usign Post request |
| 14 | [Documentation] Perform POST Request to vnfsdk marketplace with CSAR and execution options, in order to perfvorm CSAR validation |
| 15 | [Arguments] ${csar_name} ${execution_json} |
| 16 | ${response}= Run curl -s --location --request POST '${base_url}/vtp/executions' --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form 'file=@${csarpath}/${csar_name}' --form 'executions=${execution_json}' |
| 17 | ${response}= String.Replace String ${response} \\n ${SPACE} |
| 18 | [Return] ${response} |
Bartosz Gardziejewski | 64b0fe1 | 2020-10-06 08:12:12 +0200 | [diff] [blame] | 19 | |
Bartosz Gardziejewski | e872513 | 2020-10-06 14:03:36 +0200 | [diff] [blame] | 20 | Get validation result using GET request |
| 21 | [Documentation] Perform GET request to vnfsdk marketplace with request id or execution id, in order to get that request/execution result |
| 22 | [Arguments] ${requestId} |
| 23 | ${response}= Run curl -s --location --request GET '${base_url}/vtp/executions?requestId=${requestId}' --header 'Accept: application/json' |
| 24 | ${response}= String.Replace String ${response} \\n ${SPACE} |
| 25 | [Return] ${response} |