Updated on 2026-04-03 GMT+08:00

Obtaining Cluster Configurations

Function

This API is used to query cluster configuration.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

POST /v5/{project_id}/container/kubernetes/clusters/configs/batch-query

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Definition

Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID.

To query assets in all enterprise projects, set this parameter to all_granted_eps.

Constraints

You need to set this parameter only after the enterprise project function is enabled.

Range

The value can contain 1 to 256 characters.

Default Value

0: default enterprise project.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

region

No

String

Definition

Region ID, which is used to query assets in the required region. For details about how to obtain a region ID, see Obtaining a Region ID.

Constraints

N/A

Range

The value can contain 1 to 128 characters.

Default Value

N/A

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

cluster_info_list

Yes

Array of cluster_info_list objects

Cluster ID list

cluster_id_list

No

Array of strings

Cluster ID list

Table 5 cluster_info_list

Parameter

Mandatory

Type

Description

cluster_id

Yes

String

Cluster ID

cluster_name

Yes

String

Cluster name

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

total_num

Integer

Total number of configurations

data_list

Array of ClusterConfigResponseInfo objects

Configuration List

Table 7 ClusterConfigResponseInfo

Parameter

Type

Description

cluster_id

String

Cluster ID

protect_node_num

Integer

Number of protected nodes in a cluster

protect_interrupt_node_num

Integer

Number of nodes with protection interruption in a cluster

protect_degradation_node_num

Integer

Number of nodes where the cluster protection is downgraded.

unprotect_node_num

Integer

Number of nodes with protection interruption in a cluster

node_total_num

Integer

Total number of nodes in a cluster

cluster_name

String

Cluster name

charging_mode

String

Definition

Billing mode.

Range

The options are as follows**:

  • on_demand: pay-per-use

  • free: free of charge

prefer_packet_cycle

Integer

Yearly/Monthly quotas are preferentially used. The default value is 0.

protect_type

String

Definition

CCE cluster protection type

Range

  • cluster_level: cluster level

  • node_level: node level

protect_status

String

Definition

Protection status.

Range

  • protecting: Resources are protected.

  • part_protect: Resources are partially protected.

  • creating: Protection is being enabled.

  • error_protect: The protection is abnormal.

  • unprotect: Resources are not protected.

  • wait_protect: Resources are to be protected.

cluster_type

String

Definition

Cluster type.

Range

  • existing: existing cluster

  • adding: new cluster

fail_reason

String

fail reason

Example Requests

Query the configuration of the cluster whose name is cluster_name_test and ID is 6a321faa6e6c4a18b5bf19dd9543test.

POST https://{endpoint}/v5{project_id}/container/kubernetes/clusters/configs/batch-query?enterprise_project_id=0

{
  "cluster_info_list" : [ {
    "cluster_id" : "de17d1db-7f4f-11f0-bf8e-0255ac1001b8",
    "cluster_name" : "test-networkpolicy"
  }, {
    "cluster_id" : "de17d1db-7f4f-11f0-bf8e-0255ac1001b9",
    "cluster_name" : "test-networkpolicy1"
  } ]
}

Example Responses

Status code: 200

Request succeeded.

{
  "total_num" : 1,
  "data_list" : [ {
    "cluster_id" : "6a321faa6e6c4a18b5bf19dd9543test",
    "protect_status" : "unprotect"
  } ]
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.