Updated on 2025-10-22 GMT+08:00

Obtaining the Environment List

Function

Obtain the environment list.

URI

GET /v1/{project_id}/cae/environments

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. See Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

  • Obtain the token. For details, see "Obtaining a User Token" in Identity and Access Management API Reference (https://support.huaweicloud.com/intl/en-us/api-iam/iam_30_0001.html).

  • The value of X-Subject-Token in the response header is the token value.

X-Enterprise-Project-ID

No

String

Enterprise project ID.

  • When an environment is created, it will be bound with an enterprise project ID.

  • Enter 0 or up to 36 characters in UUID format with hyphens (-).

  • If this parameter is not specified or set to 0, resources in the default enterprise project are queried.

NOTE:
For details about how to obtain enterprise project IDs and enterprise project features, see Enterprise Management User Guide.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

api_version

String

API version. Fixed value: v1.

kind

String

API type. Fixed value: Environment.

items

Array of EnvironmentItem objects

Environment list.

Table 4 EnvironmentItem

Parameter

Type

Description

id

String

Environment ID.

name

String

Environment name.

job_id

String

Job ID.

status

String

Environment status.

  • creating

  • create_failed

  • finish: normal.

  • deleting

  • freeze

  • police_freeze: frozen by the public security department.

  • delete_failed

  • wakening

  • wakeup_failed

annotations

Map<String,String>

Additional attributes of the environment.

  • cluster_id: CCE cluster ID.

  • enterprise_project_id: enterprise project ID.

  • env_category: environment category. Currently, v1 and v2 are supported. When cloud storage is authorized, v1 and v2 are different.

  • group_name: name of the SWR organization bound to the active environment.

  • inbound_eip_addr: EIP bound to the load balancer.

  • namespace: CCE cluster namespace.

  • public_elb_id: ID of the load balancer bound to the active environment.

  • type: environment type, which can only be exclusive.

  • vpc_id: ID of the VPC bound to the active environment.

  • subnet_id: ID of the ingress subnet bound to the active environment.

  • egress_subnet_id: ID of the egress subnet bound to the active environment.

  • elb_id: ID of the dedicated ELB bound to the active environment.

  • runtime_platform: type of the runtime platform bound to the active environment.

created_at

String

Creation time.

updated_at

String

Update time.

Example Requests

Obtain the environment list.

GET https://{endpoint}/v1/{project_id}/cae/environments

Example Responses

Status code: 200

OK

{
  "api_version" : "v1",
  "kind" : "Environment",
  "items" : [ {
    "id" : "5d3d1e90-2f5d-4ef1-958b-3fc1ed0b0898",
    "name" : "test",
    "version" : "1.2.0",
    "job_id" : "15cbf4ff-e6a8-4504-a5e0-574b9c21493a",
    "status" : "finish",
    "annotations" : {
      "cluster_id" : "2177808d-a78e-11ed-be73-0255ac100b0a",
      "enterprise_project_id" : "0",
      "env_category" : "v2",
      "group_name" : "xxx",
      "inbound_eip_addr" : "100.xx.xx.xxx",
      "namespace" : "79c4xxxf5f3a4xxxda92601xxx64b1e8c-test",
      "public_elb_id" : "da9e107e-bd25-412f-9546-563ed11ae34c",
      "type" : "exclusive",
      "vpc_id" : "09902850-9454-4715-9764-018f0c3701fd",
      "subnet_id" : "b8ed83e8-da73-440e-95ca-0f16a328c987",
      "egress_subnet_id" : "b8ed83e8-da73-440e-95ca-0f16a328c987",
      "elb_id" : "fffdb681-4b5b-4e17-8aad-ee128ab187c7",
      "runtime_platform" : "cce-share"
    },
    "created_at" : "2023-02-08T08:49:34.000737Z",
    "updated_at" : "2023-02-08T08:49:34.000737Z"
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.