查询资源实例列表
功能介绍
通过标签查询工作空间。输入without_any_tag=true查询无标签资源,忽略tags字段;without_any_tag=false或未提供时,按tags、matches等条件过滤。tags最多含20个键,每键最多20个值,键不可重复,值可为空但结构不可缺失。matches支持特定字段的精确或模糊搜索。返回符合过滤条件的工作空间信息。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
POST https://localhost.com/v1/{project_id}/fabric-workspace/resource-instances/filter
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
offset |
否 |
Integer |
|
limit |
否 |
Integer |
|
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
否 |
String |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
without_any_tag |
否 |
Boolean |
|
tags |
否 |
Array of ResourceTagParam objects |
|
matches |
否 |
Array of TagMatch objects |
|
sys_tags |
否 |
Array of SystemTagParam objects |
|
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
key |
是 |
String |
|
values |
否 |
Array of strings |
|
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
X-request-id |
String |
|
参数 |
参数类型 |
描述 |
---|---|---|
resources |
Array of TagFabricWorkspace objects |
|
total_count |
Integer |
|
参数 |
参数类型 |
描述 |
---|---|---|
resource_id |
String |
|
resource_detail |
Object |
|
resource_name |
String |
|
tags |
Array of ResourceTag objects |
|
sys_tags |
Array of SystemTag objects |
|
参数 |
参数类型 |
描述 |
---|---|---|
key |
String |
|
value |
String |
|
参数 |
参数类型 |
描述 |
---|---|---|
key |
String |
|
value |
String |
|
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:408
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
状态码:500
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
|
error_msg |
String |
|
solution_msg |
String |
|
请求示例
请求过滤tag_key的标签的资源,具体请求实例如下。
POST https://{endpoint}/v1/{project_id}/fabric-workspace/resource-instances/filter { "without_any_tag" : false, "tags" : [ { "key" : "tag_key", "values" : [ "tag_value" ] } ], "matches" : [ { "key" : "resource_name", "value" : "tag_value" } ], "sys_tags" : "" }
响应示例
状态码:200
OK
{ "resources" : [ { "resource_id" : "01049549-82cd-4b2b-9733-ddb94350c125", "resource_detail" : { }, "resource_name" : "resource_name", "tags" : [ { "key" : "key1", "value" : "value1" } ], "sys_tags" : [ { "key" : "_sys_enterprise_project_id", "value" : "01049549-82cd-4b2b-9733-ddb94350c125" } ] } ], "total_count" : 1 }
状态码:400
BadRequest
{ "error_code" : "common.01000001", "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException" }
状态码:401
Unauthorized
{ "error_code" : "APIG.1002", "error_msg" : "Incorrect token or token resolution failed" }
状态码:403
Forbidden
{ "error" : { "code" : "403", "message" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }, "error_code" : 403, "error_msg" : "X-Auth-Token is invalid in the request", "title" : "Forbidden" }
状态码:408
Request Time-out
{ "error_code" : "common.00000408", "error_msg" : "timeout exception occurred" }
状态码:500
InternalServerError
{ "error_code" : "common.00000500", "error_msg" : "internal error" }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
BadRequest |
401 |
Unauthorized |
403 |
Forbidden |
408 |
Request Time-out |
500 |
InternalServerError |
错误码
请参见错误码。