文档首页/ 云运维中心 COC/ API参考/ API/ 应用资源管理/ 资源信息/ 查询用户在云厂商中的资源
更新时间:2025-09-04 GMT+08:00
分享

查询用户在云厂商中的资源

功能介绍

查询用户在云厂商中的资源。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v1/multicloud-resources

表1 Query参数

参数

是否必选

参数类型

描述

vendor

String

参数解释:

云厂商类型。

约束限制:

不涉及。

取值范围:

  • AWS:亚马逊。

  • AZURE:微软。

  • ALI:阿里云。

  • HCS:Huawei Cloud Stack。

默认取值:

不涉及。

type

String

参数解释:

资源类型。

约束限制:

不涉及。

取值范围:

资源类型较多,根据实际业务选择资源类型、常用资源类型如下:

  • cloudservers:弹性云服务器。

  • servers:裸金属服务器。

  • clusters:云容器引擎。

  • instances:云数据库。

默认取值:

不涉及。

limit

Integer

参数解释:

分页查询每页显示的条目数量。

约束限制:

不涉及。

取值范围:

自定义,在1-500范围。

默认取值:

不涉及。

offset

String

参数解释:

分页查询偏移量,表示从此偏移量开始查询。

约束限制:

不涉及。

取值范围:

0-2147483647。

默认取值:

0。

marker

String

参数解释:

分页参数,上一页请求最后一个id。

约束限制:

不涉及。

取值范围:

不涉及。

默认取值:

不涉及。

resource_id_list

Array of strings

参数解释:

云厂商下资源id组成的列表。

约束限制:

不涉及。

取值范围:

资源id列表,最大值100。

默认取值:

不涉及。

name_list

Array of strings

参数解释:

云厂商下的资源名称组成的列表。

约束限制:

不涉及。

取值范围:

列表,最大值100。

默认取值:

不涉及。

region_id_list

Array of strings

参数解释:

云厂商下的区域id组成的列表。

约束限制:

不涉及。

取值范围:

区域id列表,最大值100。

默认取值:

不涉及。

请求参数

响应参数

状态码:200

表2 响应Body参数

参数

参数类型

描述

data

Array of data objects

参数解释:

多云资源列表。

取值范围:

不涉及。

表3 data

参数

参数类型

描述

id

String

参数解释:

CloudCMDB分配的uuid。

取值范围:

不涉及。

resource_id

String

参数解释:

在云厂商上存的资源id。

取值范围:

不涉及。

name

String

参数解释:

资源名称。

取值范围:

字符串,长度3~50个字符。

vendor

String

参数解释:

云厂商信息。

取值范围:

  • AWS:亚马逊。

  • AZURE:微软。

  • ALI:阿里云。

  • HCS:Huawei Cloud Stack。

type

String

参数解释:

资源类型。

取值范围:

资源类型较多,根据实际业务选择资源类型、常用资源类型如下:

  • cloudservers:弹性云服务器。

  • servers:裸金属服务器。

  • clusters:云容器引擎。

  • instances:云数据库。

datasource

String

参数解释:

云厂商账户id。

取值范围:

不涉及。

region_id

String

参数解释:

区域id。

取值范围:

不涉及。

agent_id

String

参数解释:

uniagent的id值。

取值范围:

不涉及。

agent_state

String

参数解释:

uniagent的状态。

取值范围:

  • ONLINE:运行中。

  • OFFLINE:异常。

  • INSTALLING:安装中。

  • FAILED:安装失败。

  • UNINSTALLED:已卸载。

  • null:未安装。

properties

Map<String,Object>

参数解释:

资源详细属性。

取值范围:

不涉及。

ingest_properties

Map<String,String>

参数解释:

采集属性。

取值范围:

不涉及。

inner_ip

String

参数解释:

资源内网ip。

取值范围:

不涉及。

is_associate_group

Boolean

参数解释:

是否已被指定分组关联。

取值范围:

  • true:已被指定分组关联。

  • false:未被指定分组关联。

associated_group_list

Array of strings

参数解释:

资源所关联的分组信息组成的列表。

取值范围:

不涉及。

create_time

String

参数解释:

资源创建时间,参考ISO8601标准格式。

取值范围:

不涉及。

状态码:400

表4 响应Body参数

参数

参数类型

描述

error_code

String

参数解释:

错误码。

取值范围:

字符串,长度8~36个字符之间。

error_msg

String

参数解释:

错误描述。

取值范围:

字符串,长度2~512个字符之间。

请求示例

查询用户在云厂商中的资源。

GET https://{Endpoint} /v1/multicloud-resources?vendor=ALI&limit=10&offset=0&type=ACS::VPC::RouteTable

响应示例

状态码:200

查询资源信息成功。

{
  "data" : [ {
    "id" : "67f62e99a9f251796893d83a",
    "resource_id" : "8bbaa2e3-5e70-47f5-ba86-60a2829e34fd",
    "name" : "ali-1",
    "vendor" : "ALI",
    "type" : "ACS::ECS::Instance",
    "datasource" : "1719089422411430",
    "region_id" : "cn-hangzhou",
    "zone_id" : "",
    "agent_id" : "74130352f93141efa4c10ae1a1d0f14a",
    "agent_state" : "FAILED",
    "inner_ip" : "192.168.1.140",
    "properties" : {
      "ip_addresses" : [ "192.168.1.140" ],
      "tags" : [ ]
    },
    "ingest_properties" : {
      "vpc_id" : null
    },
    "is_associate_group" : null,
    "associated_group_list" : null,
    "create_time" : "2025-04-09T08:11:00.000+00:00"
  }, {
    "id" : "67f62e99a9f251796893d82a",
    "resource_id" : "e31a3ac6-2515-4954-96cd-538f749449bd",
    "name" : "ecs-2",
    "vendor" : "ALI",
    "type" : "ACS::ECS::Instance",
    "datasource" : "1719089422411430",
    "region_id" : "cn-hangzhou",
    "zone_id" : "",
    "agent_id" : "a89925d906d44a2184f7756f060bef5c",
    "agent_state" : "ONLINE",
    "inner_ip" : "192.168.1.177",
    "properties" : {
      "ip_addresses" : [ "192.168.1.177" ],
      "tags" : [ ]
    },
    "ingest_properties" : {
      "vpc_id" : "02b3d1ce-ae7e-4be6-9444-288bfe12e620"
    },
    "is_associate_group" : null,
    "associated_group_list" : null,
    "create_time" : "2025-04-09T03:18:00.000+00:00"
  } ]
}

状态码

状态码

描述

200

查询资源信息成功。

400

查询资源信息失败。

错误码

请参见错误码

相关文档