All Products
Search
Document Center

Container Service for Kubernetes:DescribeClusterResources

Last Updated:Feb 29, 2024

You can call the DescribeClusterResources operation to query all resources in a cluster by cluster ID.

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
cs:DescribeClusterResourcesRead
  • Cluster
    acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
    none
none

Request syntax

GET /clusters/{ClusterId}/resources

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

For more information about how to query cluster IDs, see View cluster information.

You can also call the DescribeClustersV1 API operation to query all clusters that belong to an Alibaba Cloud account.

cb95aa626a47740afbf6aa099b65****

Response parameters

ParameterTypeDescriptionExample
object []

A list of resources in the cluster.

cluster_idstring

The cluster ID.

cb95aa626a47740afbf6aa099b65****
createdstring

The time when the resource was created.

2020-09-11T10:11:54+08:00
instance_idstring

The resource ID.

lb-wz9poz4r0ymh8u0uf****
resource_infostring

The information about the resource. For more information about how to query the source information about a resource, see ListStackResources .

{\"Id\":\"k8s_master_slb\",\"Name\":\"k8s_master_slb\",\"Type\":\"ALIYUN::SLB::LoadBalancer\",\"Status\":\"CREATE_COMPLETE\",\"StatusReason\":\"state changed\",\"Updated\":\"2020-05-21T13:25:02\",\"PhysicalId\":\"lb-wz9poz4r0ymh8u0uf****\"}
resource_typestring

The resource type.

ALIYUN::SLB::LoadBalancer
statestring

The resource status. Valid values:

  • CREATE_COMPLETE: The resource is created.
  • CREATE_FAILED: The resource failed to be created.
  • CREATE_IN_PROGRESS: The resource is being created.
  • DELETE_FAILED: The resource failed to be deleted.
  • DELETE_IN_PROGRESS: The resource is being deleted.
  • ROLLBACK_COMPLETE: The resource is rolled back.
  • ROLLBACK_FAILED: The resource failed to be rolled back.
  • ROLLBACK_IN_PROGRESS: The resource is being rolled back.
CREATE_COMPLETE
auto_createlong

Indicates whether the resource is created by Container Service for Kubernetes (ACK). Valid values:

  • 1: The resource is created by ACK.
  • 0: The resource is an existing resource.
1
dependenciesobject

Examples

Sample success responses

JSONformat

[
  {
    "cluster_id": "cb95aa626a47740afbf6aa099b65****",
    "created": "2020-09-11T10:11:54+08:00",
    "instance_id": "lb-wz9poz4r0ymh8u0uf****",
    "resource_info": "{\\\"Id\\\":\\\"k8s_master_slb\\\",\\\"Name\\\":\\\"k8s_master_slb\\\",\\\"Type\\\":\\\"ALIYUN::SLB::LoadBalancer\\\",\\\"Status\\\":\\\"CREATE_COMPLETE\\\",\\\"StatusReason\\\":\\\"state changed\\\",\\\"Updated\\\":\\\"2020-05-21T13:25:02\\\",\\\"PhysicalId\\\":\\\"lb-wz9poz4r0ymh8u0uf****\\\"}",
    "resource_type": "ALIYUN::SLB::LoadBalancer",
    "state": "CREATE_COMPLETE",
    "auto_create": 1,
    "dependencies": {
      "test": "test",
      "test2": 1
    }
  }
]

Error codes

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

Change history

Change timeSummary of changesOperation
2023-10-20The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-10-11The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2020-09-10The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.