Help Center/ CodeArts TestPlan/ API Reference/ API/ Environment Parameter Management/ Obtaining the Environment Parameter List of CloudTest
Updated on 2022-12-05 GMT+08:00

Obtaining the Environment Parameter List of CloudTest

Function

Obtains the environment parameter list of CloudTest.

URI

GET /v1/projects/{project_id}/environments

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

DevCloud project ID

Minimum: 32

Maximum: 32

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Long

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

Minimum: 0

Maximum: 999

Default: 0

limit

Yes

Long

Number of items displayed on each page. A maximum of 200 items are supported.

Minimum: 1

Maximum: 200

Default: 200

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

Call IAM to obtain the user token (value of X-Subject-Token in the response header).

Minimum: 1

Maximum: 100000

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

environments

Array of Environment objects

Environment list

offset

Long

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

Minimum: 0

Maximum: 999

limit

Long

Number of items displayed on each page. A maximum of 200 items are supported.

Minimum: 1

Maximum: 200

total_count

Long

Total number of environments

Minimum: 0

Maximum: 100

Table 5 Environment

Parameter

Type

Description

environment_id

String

Environment ID

Minimum: 32

Maximum: 32

environment_name

String

Environment name

Minimum: 3

Maximum: 80

environment_description

String

Environment description

Minimum: 0

Maximum: 500

is_default

Boolean

Whether the environment is default

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

Minimum: 12

Maximum: 16

error_msg

String

Error message displayed after an API fails to be called

Minimum: 3

Maximum: 100

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Example Requests

None

Example Responses

Status code: 200

OK

{
  "environments" : [ {
    "environment_id" : "ff4893796ee1a8aa009ff3a470de55d8",
    "environment_name" : "Default environment",
    "environment_description" : "Default environment",
    "is_default" : true
  } ],
  "offset" : 0,
  "limit" : 1,
  "total_count" : 50
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.