All Products
Search
Document Center

Enterprise Distributed Application Service:GetK8sCluster

Last Updated:Mar 01, 2024

Queries Container Service for Kubernetes (ACK) clusters or Serverless Kubernetes clusters in a specified region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
edas:ReadClusterRead
  • Cluster
    acs:edas:{#regionId}:{#accountId}:namespace/{#NameSpaceId}/cluster/{#ClusterId}
    none
none

Request syntax

POST /pop/v5/k8s_clusters

Request parameters

ParameterTypeRequiredDescriptionExample
RegionTagstringYes

The ID of the region.

cn-hangzhou
CurrentPageintegerNo

The number of the page to return. Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page. Default value: 1000.

10
ClusterTypeintegerNo

The type of the Kubernetes cluster. Valid values:

  • 5: ACK cluster
  • 7: self-managed Kubernetes cluster
5
SubClusterTypestringNo

The subtype of the cluster. Valid values:

  • Ask: Serverless Kubernetes cluster
  • ManagedKubernetes: ACK cluster
Ask

Response parameters

ParameterTypeDescriptionExample
object

The content that is returned.

Codeinteger

The HTTP status code that is returned.

200
Messagestring

The additional information that is returned.

success
RequestIdstring

The ID of the request.

C3CE915C-0C83-4AA5-8D66-E8BEED62939E
ClusterPageobject

The cluster data that is returned by page.

CurrentPageinteger

The number of the returned page. Default value: 1.

1
PageSizeinteger

The number of entries returned per page. Default value: 1000.

10
TotalSizeinteger

The total number of pages that are returned.

5
ClusterListobject []

The list of clusters.

VpcIdstring

The ID of the virtual private cloud (VPC).

vpc-**z1mlwpbjx3e9m**
VswitchIdstring

The ID of the vSwitch.

vsw-bp1uf97****xjxgip****
SubNetCidrstring

The CIDR block of the subnet.

172.20.0.0/16
Meminteger

The total size of memory. Unit: MB.

2048
RegionIdstring

The ID of the namespace.

test
CsClusterStatusstring

The state of the ACK cluster. Valid values:

  • initial: The cluster is being initialized.
  • failed: The cluster fails to be created.
  • running: The cluster is running.
  • updating: The cluster is being updated.
  • scaling: The cluster is being scaled out.
  • removing: Nodes are being removed from the cluster.
  • upgrading: The cluster is being upgraded.
  • deleting: The cluster is being deleted.
  • delete_failed: The cluster fails to be deleted.
  • deleted: The cluster is deleted. The deleted cluster is invisible to users.
running
Cpuinteger

The total number of CPU cores.

4
NetworkModeinteger

The network type of the cluster. Valid values:

  • 1: classic network
  • 2: VPC
2
CsClusterIdstring

The ID of the ACK cluster.

2ce62869f4d4466b920312315f05****
Descriptionstring

The description of the cluster.

test
ClusterTypeinteger

The type of the cluster. Valid values:

  • 2: Elastic Compute Service (ECS) cluster
  • 5: ACK cluster or Serverless Kubernetes cluster
5
ClusterNamestring

The name of the cluster.

test
NodeNuminteger

The number of nodes.

4
ClusterIdstring

The ID of the cluster.

81453e4b-4df0-4592-****-b835a2ee****
ClusterImportStatusinteger

The import state of the cluster. Valid values:

  • 0: The cluster is not imported.
  • 1: The cluster is imported.
  • 2: The cluster fails to be imported.
  • 3: The cluster is being imported.
  • 4: The cluster is deleted.
1
SubClusterTypestring

The subtype of the cluster. Valid values:

  • Ask: Serverless Kubernetes cluster
  • ManagedKubernetes: ACK cluster
Ask
ClusterStatusinteger

The status of the cluster. Valid values:

  • 1: The cluster runs as expected.
  • 2: The cluster does not run as expected.
  • 3: The cluster is offline.
1

Examples

Sample success responses

JSONformat

{
  "Code": 200,
  "Message": "success",
  "RequestId": "C3CE915C-0C83-4AA5-8D66-E8BEED62939E",
  "ClusterPage": {
    "CurrentPage": 1,
    "PageSize": 10,
    "TotalSize": 5,
    "ClusterList": {
      "Cluster": [
        {
          "VpcId": "vpc-**z1mlwpbjx3e9m**",
          "VswitchId": "vsw-bp1uf97****xjxgip****",
          "SubNetCidr": "172.20.0.0/16",
          "Mem": 2048,
          "RegionId": "test",
          "CsClusterStatus": "running",
          "Cpu": 4,
          "NetworkMode": 2,
          "CsClusterId": "2ce62869f4d4466b920312315f05****",
          "Description": "test",
          "ClusterType": 5,
          "ClusterName": "test",
          "NodeNum": 4,
          "ClusterId": "81453e4b-4df0-4592-****-b835a2ee****",
          "ClusterImportStatus": 1,
          "SubClusterType": "Ask",
          "ClusterStatus": 1
        }
      ]
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
500Edas.errorcode.PermissionDenied.messageYou are not authorized to perform the operation.No permissions

For a list of error codes, visit the Service error codes.