Updated on 2023-10-20 GMT+08:00

Querying an Environment List

Function

This API is used to query an environment list that matches specified conditions.

URI

The following table lists the HTTP/HTTPS request method and URI of the API.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

GET

/v1.0/apigw/envs[?page_no, page_size,name]

  • A combination of different query conditions can be added at the end of the URI by using question marks (?) and ampersands (&).
  • Query conditions include: name, page_size, and page_no.
Table 2 Parameter description

Parameter

Mandatory

Type

Description

name

No

String

Environment name.

page_size

No

Integer

Number of records displayed on each page. The default value is 20.

page_no

No

Integer

Page number. The default value is 1.

precise_search

No

String

Parameter name (name supported only) for exact match.

Request

N/A

Response

Table 3 Parameter description

Parameter

Type

Description

total

Integer

Number of environments that match the query conditions

size

Integer

Length of the returned environment list

envs

Dictionary

Environment list

Table 4 Parameter description of envs

Parameter

Type

Description

id

String

Environment ID

name

String

Environment name

create_time

Timestamp

Time when the environment is created

remark

String

Description of the environment

Example response:

{
	"total": 2,
	"size": 2,
	"envs": [{
		"id": "DEFAULT_ENVIRONMENT_RELEASE_ID",
		"name": "RELEASE",
		"remark": "Production environment",
		"create_time": "2017-12-29T03:39:03.165657Z"
	},
	{
		"id": "0035dd2e76dd4e3fa45fef634318ada4",
		"name": "DEVELOP",
		"remark": "Development environment",
		"create_time": "2017-12-28T12:50:47Z"
	}]
}

Status Codes

Table 5 Status codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

500

Server Internal Error