Updated on 2024-04-08 GMT+08:00

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}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

variable_type

Yes

Integer

Variable type.

Minimum: 0

Maximum: 2147483647

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

Minimum: 0

Maximum: 64

test_suite_id

Yes

Integer

Test project ID.

Minimum: 0

Maximum: 2147483647

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

code

String

Response code.

Minimum: 0

Maximum: 1024

message

String

Response message.

Minimum: 0

Maximum: 1024

variable_list

Array of VariableDetail objects

Variable list.

Array Length: 0 - 1024

Table 3 VariableDetail

Parameter

Type

Description

file_size

Integer

File size.

Minimum: 0

Maximum: 2147483647

id

Integer

Variable ID.

Minimum: 0

Maximum: 2147483647

is_quoted

Boolean

Reference status

name

String

Variable name.

Minimum: 0

Maximum: 1024

variable

Array of objects

Variable value.

Array Length: 0 - 40960

variable_type

Integer

Variable type (1: integer; 2: enumeration; 3: file; 5: text).

Minimum: 0

Maximum: 2147483647

variable_mode

Integer

Variable read mode (0: sequential mode; 1: random mode).

share_mode

Integer

Variable sharing mode (0: case mode; 1: concurrent mode).

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.