Querying a Global Variable
Function
This API is used to query a global variable.
URI
GET /v1/{project_id}/variables/{variable_type}/test-suites/{test_suite_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
variable_type |
Yes |
Integer |
Variable type. |
project_id |
Yes |
String |
Project ID. For details, see Method of obtaining instructions. |
test_suite_id |
Yes |
Integer |
Test project ID. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
code |
String |
Response code. |
message |
String |
Response message. |
variable_list |
Array of VariableDetail objects |
Variable list. |
Parameter |
Type |
Description |
---|---|---|
file_size |
Integer |
File size. |
id |
Integer |
Variable ID. |
is_quoted |
Boolean |
Reference status |
name |
String |
Variable name. |
variable |
Array of objects |
Variable value. |
variable_type |
Integer |
Variable type (1: integer; 2: enumeration; 3: file; 5: text). |
variable_mode |
Integer |
Variable read mode (0: sequential mode; 1: random mode). |
share_mode |
Integer |
Variable sharing mode (0: case mode; 1: concurrent mode). |
Status code: 501
Parameter |
Type |
Description |
---|---|---|
- |
String |
response message |
Example Requests
Querying the variable list of the PerfTest project.
/v1/{project_id}/variables/{variable_type}/test-suites/1 { "code" : "SVCSTG.CPTS.0000000", "message" : "success", "variable_list" : [ { "file_size" : 0, "id" : 156769, "is_quoted" : false, "is_sensitive" : false, "name" : "var1", "share_mode" : 0, "variable" : [ "test" ], "variable_mode" : 0, "variable_type" : 2 } ] }
Example Responses
Status code: 200
success
{ "code" : "SVCSTG.CPTS.0000000", "message" : "success", "variable_list" : [ { "file_size" : 0, "id" : 37615, "is_quoted" : false, "name" : "var1", "share_mode" : 0, "variable" : [ 1, 20 ], "variable_mode" : 0, "variable_type" : 1 }, { "file_size" : 0, "id" : 36306, "is_quoted" : true, "name" : "var2", "share_mode" : 0, "variable" : [ "domain-example.com" ], "variable_mode" : 0, "variable_type" : 2 } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
success |
501 |
unknown error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot