All Products
Search
Document Center

Container Service for Kubernetes:DescribeClusterResources

Last Updated:Nov 07, 2024

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

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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

Request syntax

GET /clusters/{ClusterId}/resources HTTP/1.1

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****
with_addon_resourcesbooleanNo

Specifies whether to query the resources created by cluster components.

Response parameters

ParameterTypeDescriptionExample
array<object>

The resources in the cluster.

object

The details of the resource.

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 resource information. For more information about how to query the source information about the 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

Specifies 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

The dependent resources.

associated_objectobject

The Kubernetes object with which the resource is associated.

kindstring

The Kubernetes object type.

Service
namespacestring

The namespace in which the Kubernetes object resides.

kube-system
namestring

The Kubernetes object name.

nginx-ingress-lb
delete_behaviorobject

The deletion behavior of the resource when the cluster is deleted.

delete_by_defaultboolean

Specifies whether to delete the resource by default when the cluster is deleted.

false
changeableboolean

Specifies whether the default behavior returned in delete_by_default can be changed.

false
creator_typestring

The resource creator. Valid values:

  • user: The resource is created by the user.
  • system: The resource is created by the ACK management system.
  • addon: The resource is created by a cluster component.
addon
extra_infoobject

The additional information about the resource.

{"IP": "xx.xx.xx.xx"}

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
    },
    "associated_object": {
      "kind": "Service",
      "namespace": "kube-system",
      "name": "nginx-ingress-lb"
    },
    "delete_behavior": {
      "delete_by_default": false,
      "changeable": false
    },
    "creator_type": "addon",
    "extra_info": {
      "IP": "xx.xx.xx.xx"
    }
  }
]

Error codes

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

Change history

Change timeSummary of changesOperation
2024-03-13The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-10-20The response structure of the API has changedView Change Details
2023-10-11The response structure of the API has changedView Change Details
2020-09-10The response structure of the API has changedView Change Details