You can call DescribeClusterResources to query all resources in a cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameter types

This operation uses common request parameters only. For more information, see Common parameters.

Request syntax

GET /clusters/[ClusterId]/resources HTTPS|HTTP

Request parameters

Parameter Type Required Example Description
ClusterId String Yes cb95aa626a47740afbf6aa099b65****

The ID of the cluster.

Response parameters

Parameter Type Example Description
resources Array

A list of resources in the cluster.

instance_id String lb-wz9poz4r0ymh8u0uf****

The ID of the resource.

resource_info String "{\"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****\"}"

The details of the resource.

resource_type String ALIYUN::SLB::LoadBalancer

The type of the resource.

state String CREATE_COMPLETE

The status of the resource. Valid values: CREATE_COMPLETE, CREATE_FAILED, CREATE_IN_PROGRESS, DELETE_FAILED, DELETE_IN_PROGRESS, ROLLBACK_COMPLETE, ROLLBACK_FAILED, and ROLLBACK_IN_PROGRESS.

Examples

Sample requests

GET /clusters/[ClusterId]/resources HTTP/1.1
Common request parameters
{
"ClusterId": "cb95aa626a47740afbf6aa099b65****"
}

Sample success responses

XML format

<0>
    <instance_id>i-wz9aixnfbjo1txoq****</instance_id>
    <resource_type>ALIYUN::ECS::InstanceGroup</resource_type>
    <resource_info>{"Id":"k8s_master_2","Name":"k8s_master_2","Type":"ALIYUN::ECS::InstanceGroup","Status":"CREATE_COMPLETE","StatusReason":"state changed","Updated":"2020-05-21T13:26:04","PhysicalId":"i-wz9aixnfbjo1txoq****"}</resource_info>
    <created>2020-05-21T21:39:19+08:00</created>
    <auto_create>1</auto_create>
    <state>CREATE_COMPLETE</state>
</0>
<1>
    <instance_id>i-wz976s1is8lo28ue****</instance_id>
    <resource_type>ALIYUN::ECS::InstanceGroup</resource_type>
    <resource_info>{"Id":"k8s_master_3","Name":"k8s_master_3","Type":"ALIYUN::ECS::InstanceGroup","Status":"CREATE_COMPLETE","StatusReason":"state changed","Updated":"2020-05-21T13:26:43","PhysicalId":"i-wz976s1is8lo28ue****"}</resource_info>
    <created>2020-05-21T21:39:19+08:00</created>
    <auto_create>1</auto_create>
    <state>CREATE_COMPLETE</state>
</1>

JSON format

[
  {
    "instance_id": "i-wz9aixnfbjo1txoq****",
    "resource_type": "ALIYUN::ECS::InstanceGroup",
    "resource_info": "{\"Id\":\"k8s_master_2\",\"Name\":\"k8s_master_2\",\"Type\":\"ALIYUN::ECS::InstanceGroup\",\"Status\":\"CREATE_COMPLETE\",\"StatusReason\":\"state changed\",\"Updated\":\"2020-05-21T13:26:04\",\"PhysicalId\":\"i-wz9aixnfbjo1txoq****\"}",
    "created": "2020-05-21T21:39:19+08:00",
    "auto_create": 1,
    "state": "CREATE_COMPLETE",
    "dependencies": []
  },
  {
    "instance_id": "i-wz976s1is8lo28ue****",
    "resource_type": "ALIYUN::ECS::InstanceGroup",
    "resource_info": "{\"Id\":\"k8s_master_3\",\"Name\":\"k8s_master_3\",\"Type\":\"ALIYUN::ECS::InstanceGroup\",\"Status\":\"CREATE_COMPLETE\",\"StatusReason\":\"state changed\",\"Updated\":\"2020-05-21T13:26:43\",\"PhysicalId\":\"i-wz976s1is8lo28ue****\"}",
    "created": "2020-05-21T21:39:19+08:00",
    "auto_create": 1,
    "state": "CREATE_COMPLETE",
    "dependencies": []
  }
]

Error codes

For a list of error codes, visit the API Error Center.