Updated on 2025-02-14 GMT+08:00

Obtaining the Environment List

Function

This API is used to obtain the environment list.

URI

GET /v1/{project_id}/cae/environments

Table 1 Path parameter

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.

Maximum characters: 16,384

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 more information about enterprise projects and how to obtain enterprise project IDs, 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.

Enumerated value:

  • v1

kind

String

API type. Fixed value: Environment.

Enumerated 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.

Enumerated values:

  • creating
  • finish
  • deleting
  • freeze
  • police_freeze
  • delete_failed

annotations

Map<String,String>

Additional attributes of the environment.

  • cluster_id: CCE cluster ID.
  • enterprise_project_id: enterprise project ID
  • group_name: name of the SoftWare Repository for Container (SWR) organization bound to the active environment.
  • inbound_eip_addr: Elastic IP (EIP) bound to the load balancer.
  • namespace: Cloud Container Engine (CCE) cluster namespace.
  • public_elb_id: ID of the Elastic Load Balance (ELB) bound to the active environment.
  • type: environment type, which can only be exclusive.
  • vpc_id: ID of the Virtual Private Cloud (VPC) bound to the active environment.

created_at

String

Creation time.

updated_at

String

Update time.

Example Request

Obtain the environment list.

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

Example Response

Status code: 200

The request is successful.

{
  "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",
      "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"
    },
    "created_at" : "2023-02-08T08:49:34.000737Z",
    "updated_at" : "2023-02-08T08:49:34.000737Z"
  } ]
}

Status Code

Status Code

Description

200

The request is successful.

Error Code

For details, see Error Codes.