查询CMDB跨账号资源视图
功能介绍
查询CMDB跨账号资源视图。
视图是一组筛选器,用户可以自由配置筛选范围,用于在跨账号场景下访问华为云中的资源信息。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v1/resource/views
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
limit |
是 |
Integer |
参数解释: 分页查询每页显示的条目数量 约束限制: 不涉及。 取值范围: 自定义,在1-500范围。 默认取值: 不涉及。 |
marker |
否 |
String |
参数解释: 分页参数,通过上一个请求中返回的marker信息作为输入,获取当前页。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
请求参数
无
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
data |
Array of data objects |
参数解释: 视图聚合的资源数据。 取值范围: 字符串,长度1~32之间。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 资源视图id。 取值范围: 字符串,长度1~32之间。 |
name |
String |
参数解释: 资源视图名称。 取值范围: 由英文字母、数字、中划线、下划线组成,长度在3~50个字符之间。 |
manager_domain_id |
String |
参数解释: 视图创建者的domainId,视图资源聚合的归属者。 取值范围: 不涉及。 |
organization_id |
String |
参数解释: 视图归属的组织id。 取值范围: 不涉及。 |
organization_unit_ids |
Array of strings |
参数解释: 视图所聚合的组织单元id值组成列表。 取值范围: 不涉及。 |
domain_ids |
Array of strings |
参数解释: 视图包含的租户账号id值组成列表。 取值范围: 不涉及。 |
resource_types |
Array of strings |
参数解释: 视图包含的资源类型列表。 取值范围: 资源类型较多,根据实际业务选择资源类型、常用资源类型如下:
|
view_type |
String |
参数解释: 视图类型。 取值范围: 目前只支持组织:organizational。 |
请求示例
查询CMDB跨账号资源视图。
GET https://{Endpoint}/resource/views?limit=120
响应示例
状态码:200
查询CMDB跨账号资源视图。
{ "data" : [ { "id" : "67eced5bbba8867be02aeac3", "name" : "qwgwegwe", "manager_domain_id" : "dc2d76541f754d68a4c8d150262d92c2", "organization_id" : "o-xuglfowux9ks92yrt7q4yc3ubsy6mjhd", "organization_unit_ids" : [ ], "domain_ids" : [ "fb858e4f455646259b40065b50e72e61", "dc2d76541f754d68a4c8d150262d92c2", "08fc8d260d00d4900f0ec00c54a17060" ], "resource_types" : [ "dms.kafkas", "dms.queues", "dms.rabbitmqs", "dms.reliabilitys", "dms.kafka_nodes", "dms.rabbitmq_nodes", "dms.rocketmq_nodes", "dcs.redis", "dcs.memcached", "dcs.node", "apig.instances" ], "view_type" : "organizational" }, { "id" : "6819f2de5219566befb2880d", "name" : "rewrqw", "manager_domain_id" : "dc2d76541f754d68a4c8d150262d92c2", "organization_id" : "o-xuglfowux9ks92yrt7q4yc3ubsy6mjhd", "organization_unit_ids" : [ "r-mxc9k8s74gj2hu96yhn5i6kd8i9wh8k7" ], "domain_ids" : [ "dc2d76541f754d68a4c8d150262d92c2", "08fc8d260d00d4900f0ec00c54a17060", "fb858e4f455646259b40065b50e72e61" ], "resource_types" : [ "ecs.cloudservers", "bms.servers", "fgs.functions", "hcss.l-instance", "as.scalingGroups", "ims.images", "cph.cloudphoneservers", "deh.dedicatedhosts" ], "view_type" : "organizational" } ] }
状态码
状态码 |
描述 |
---|---|
200 |
查询CMDB跨账号资源视图。 |
错误码
请参见错误码。