Help Center/ DataArts Fabric/ API Reference/ APIs/ TMS Management/ Querying the Resource Instance List
Updated on 2025-09-15 GMT+08:00

Querying the Resource Instance List

Function

This API is used to query workspaces by tag. If without_any_tag is set to true, resources without tags are queried and the tags field is ignored. If set to false or is not specified, resources are queried by tags or matches. tags can contain up to 20 keys. Each key can have up to 20 values. Keys must be unique. Values can be empty, but the structure cannot be missing. matches supports exact or fuzzy search of specific fields. This API returns the workspaces that meet the filter criteria.

URI

POST /v1/{project_id}/fabric-workspace/resource-instances/filter

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For how to obtain a project ID, see [Obtaining a Project ID] (dataartsfabric_03_0020.xml).

Constraints: N/A.

Range: 1 to 36 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Definition: Offset where a query starts.

Constraints: N/A.

Range: [0, 1000000000].

Default Value: 0

limit

No

Integer

Definition: Maximum number of records returned on each page.

Constraints: N/A.

Range: [1, 100].

Default Value: 10.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

Definition: Tenant token. It is used for API calling authentication. For how to obtain a token, see [Authentication] (dataartsfabric_03_0005.xml).

Constraints: N/A.

Range: Up to 65,534 characters.

Default Value: N/A.

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

without_any_tag

No

Boolean

Definition: No tags are included. If set to true, all resources without tags are queried. In this case,

the tags, tags_any, not_tags, and not_tags_any fields are ignored.

Constraints: N/A.

Range: true or false.

Default Value: N/A.

tags

No

Array of ResourceTagParam objects

Definition: Tags are included. Each tag contains a maximum of 50 keys. Each key can have up to 10 values. The value corresponding to each key can be an empty array, but the structure cannot be missing.

Constraints: [1, 20].

matches

No

Array of TagMatch objects

Definition: Search field. key indicates the field to be matched, for example, resource_name. value indicates the matched value.

Constraints: [1, 10].

sys_tags

No

Array of SystemTagParam objects

Definition: system tag list. Only one tag structure is included currently. Each key contains only one value.

Constraints: 1.

Table 5 ResourceTagParam

Parameter

Mandatory

Type

Description

key

Yes

String

Definition: Resource tag key. For details about how to obtain a tag key, see "API Description" > "Resource Tags" > "Querying Tag Keys" in Tag Management Service API Reference.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

values

No

Array of strings

Definition: Resource tag value list.

Constraints: N/A.

Table 6 TagMatch

Parameter

Mandatory

Type

Description

key

Yes

String

Definition: Tag key.

Constraints: N/A.

Range: resource_name.

Default Value: resource_name.

value

No

String

Definition: Resource tag value.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

Table 7 SystemTagParam

Parameter

Mandatory

Type

Description

key

Yes

String

Definition: Tag key.

Constraints: The value is fixed.

Range: The value is fixed at _sys_enterprise_project_id.

Default Value: N/A.

values

Yes

Array of strings

Definition: Value list of the system tag.

Constraints: The value is fixed.

Response Parameters

Status code: 200

Table 8 Response header parameters

Parameter

Type

Description

X-request-id

String

Definition: Request ID.

Constraints: The value cannot be changed.

Range: N/A.

Default Value: N/A.

Table 9 Response body parameters

Parameter

Type

Description

resources

Array of TagFabricWorkspace objects

Definition: Resource list.

Constraints: [0,1000].

total_count

Integer

Definition: Total number of resources.

Constraints: N/A.

Range: [0, 1000].

Default Value: N/A.

Table 10 TagFabricWorkspace

Parameter

Type

Description

resource_id

String

Definition: Workspace ID.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

resource_detail

Object

Definition: Resource details. The value is a resource object, used for extension. This parameter is left blank by default.

Constraints: N/A.

resource_name

String

Definition: Workspace name.

Constraints: N/A.

Range: N/A.

Default Value: N/A.

tags

Array of ResourceTag objects

Definition: Tag list. If there is no tag in the list, an empty array is returned by default.

Constraints: [0, 100000].

sys_tags

Array of SystemTag objects

Definition: System tag.

Constraints: N/A.

Table 11 ResourceTag

Parameter

Type

Description

key

String

Definition: Resource tag key. For details about how to obtain a tag key, see "API Description" > "Resource Tags" > "Querying Tag Keys" in Tag Management Service API Reference.

Constraints: N/A.

Range: 1 to 128 characters. Only letters, spaces, tabs, digits, underscores (_), periods (.), colons (:), backslashes (), equal signs (=), plus signs (+), minus signs (-), and at signs (@) are allowed.

Default Value: N/A.

value

String

Definition: Resource tag value.

Constraints: N/A.

Range: 0 to 255 characters. Only letters, spaces, tabs, digits, underscores (_), periods (.), colons (:), backslashes (), equal signs (=), plus signs (+), minus signs (-), and at signs (@) are allowed.

Default Value: N/A.

Table 12 SystemTag

Parameter

Type

Description

key

String

Definition: Tag key.

Constraints: The value is fixed.

Range: The value is fixed at _sys_enterprise_project_id.

Default Value: N/A.

value

String

Definition: Enterprise project ID. For how to obtain an enterprise project ID, see [Obtaining an Enterprise Project ID] (dataartsfabric_03_0027.xml).

Constraints: N/A.

Range: N/A.

Default Value: N/A.

Status code: 400

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 401

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 408

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Status code: 500

Table 16 Response body parameters

Parameter

Type

Description

error_code

String

Definition: Error code.

Constraints: N/A.

Range: 8 to 36 characters.

Default Value: N/A.

error_msg

String

Definition: Error message.

Constraints: N/A.

Range: 2 to 512 characters.

Default Value: N/A.

solution_msg

String

Definition: Solution description.

Constraints: N/A.

Range: 0 to 4,096 characters.

Default Value: N/A.

Example Requests

Query the resources with the tag_key tag. The following is an example request.

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" : ""
}

Example Responses

Status code: 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
}

Status code: 400

BadRequest

{
  "error_code" : "common.01000001",
  "error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
}

Status code: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 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"
}

Status code: 408

Request Time-out

{
  "error_code" : "common.00000408",
  "error_msg" : "timeout exception occurred"
}

Status code: 500

InternalServerError

{
  "error_code" : "common.00000500",
  "error_msg" : "internal error"
}

Status Codes

Status Code

Description

200

OK

400

BadRequest

401

Unauthorized

403

Forbidden

408

Request Time-out

500

InternalServerError

Error Codes

See Error Codes.