调用DescribeClusterResources查询指定集群的所有资源。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求和返回结果文档。

请求语法

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

请求参数

名称 类型 是否必选 示例值 描述
ClusterId String cb95aa626a47740afbf6aa099b65****

集群ID。

返回数据

名称 类型 示例值 描述
resources Array

Resource对象信息列表,该字段虚拟字段仅用于标识返回类型为Array。

instance_id String lb-wz9poz4r0ymh8u0uf****

Resource对象ID。

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

Resource对象的源信息,点击详情

resource_type String ALIYUN::SLB::LoadBalancer

Resource对象类型。

state String CREATE_COMPLETE

资源状态。可选值:CREATE_COMPLETE、CREATE_FAILED、CREATE_IN_PROGRESS、DELETE_FAILED、DELETE_IN_PROGRESS、ROLLBACK_COMPLETE、ROLLBACK_FAILED、ROLLBACK_IN_PROGRESS。

示例

请求示例

GET /clusters/[ClusterId]/resources HTTP/1.1
公共请求头
{
"ClusterId": "cb95aa626a47740afbf6aa099b65****"
}

正常返回示例

XML 格式

<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 格式

[
  {
    "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": []
  }
]

错误码

访问错误中心查看更多错误码。