All Products
Search
Document Center

Container Service for Kubernetes:DescribeClusterResources

Last Updated:Sep 10, 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

There is currently no authorization information disclosed in the API.

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