Obtaining All Environments
Function
This API is used to obtain all created environments.
URI
GET /v2/{project_id}/cas/environments
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| project_id | String | Yes | Tenant's project ID. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| limit | Integer | No | Number of records to be queried. Value range: 0–100. Default value: 1000, indicating that a maximum of 1000 records can be queried and all records are displayed on the same page. |
| offset | Integer | No | Offset. |
| order_by | String | No | Sorting field. By default, query results are sorted by creation time. The following enumerated values are supported: create_time, name, and update_time. |
| order | String | No | Descending or ascending order. Default value: desc. |
Request Parameters
Request parameters
None
Response Parameters
Response parameters
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Total number of environments. |
| environments | Array of objects | Environment parameters. See Table 4. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Environment ID. |
| name | String | Environment name. |
| alias | String | Environment alias. |
| description | String | Environment description. |
| project_id | String | Project ID. |
| enterprise_project_id | String | Enterprise project ID. |
| charge_mode | String | Billing mode. |
| vpc_id | String | Virtual Private Cloud (VPC) ID. |
| base_resources | Array of objects | Basic resources. See Table 5. |
| optional_resources | Array of objects | Optional resources. See Table 5. |
| creator | String | Creator. |
| create_time | Integer | Creation time. |
| update_time | Integer | Update time. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Resource ID. |
| type | String | Basic resources: Cloud Container Engine (CCE), Cloud Container Instance (CCI), Elastic Cloud Server (ECS), and Auto Scaling (AS). Optional resources: Relational Database Service (RDS), Distributed Cache Service (DCS), Elastic Load Balance (ELB), and other services. |
Example
Example request
None
Example response
{
"environments": [
{
"id": "345eae98-231e-4a23-92ef-9823c85ce356",
"name": "environment_name",
"description": "environment_description",
"project_id": "4c5fac143bc3459fae56789ead33a78a",
"enterprise_project_id": "0",
"charge_mode": "provided",
"vpc_id": "b9b8f9ad-1a2e-403d-83f1-cb71a3c06df8",
"base_resources": [
{
"id": "b6862a62-d916-11e9-bdf1-0255ac101fd9",
"type": "cce"
}
],
"optional_resources": [
{
"id": "default",
"type": "cse"
}
],
"creator": "string",
"create_time": 1571107531621,
"update_time": 1571107531621
}
],
"count": 10
} Status Code
| HTTP Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error code must be in the format of SVCSTG.00100.[Error_ID]. Example: SVCSTG.00100400. See Error Codes of Application Management APIs.
Last Article: Creating an Environment
Next Article: Modifying Environment Information
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.