Querying a Global Variable
Function
This API is used to query a global variable.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
codeartsperftest:cpts:getPerfTestProject
Read
cpts *
g:ResourceTag/<tag-key>
-
-
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, which is the value of project_id in the response body of the API for creating a project. |
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, which is the value of json.variable_id in the response body of the API for creating a variable. |
|
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