Updated on 2026-06-25 GMT+08:00

Querying Resource Instances

Function

This API is used to obtain the list of filtered resource instances.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    asm:mesh:listResourcesByTag

    List

    -

    g:TagKeys

    -

    -

URI

POST /v2/{projectid}/{resourcetype}/resource-instances/filter

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

projectid

Yes

String

Project ID

resourcetype

Yes

String

Resource type. Currently, only asm-mesh is supported.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

String

Limit

offset

No

String

Offset

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token.

Content-Type

Yes

String

Message body type (format)

Range:

  • application/json;charset=utf-8: The content is in JSON format and encoded using UTF-8.

  • application/json: The content is in JSON format.

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

without_any_tag

No

Boolean

Resources without any tags queried. If this parameter is set to true, all resources without any tags are queried. In this case, skip the tags field. If this parameter is set to false or not specified, it does not take effect, meaning that all resources are returned or resources are filtered by tags or matches.

tags

No

Array of resource_tag objects

Resources to be queried contain tags specified in this field. Each resource can contain a maximum of 20 keys. Each tag key can have a maximum of 20 tag values. The tag value corresponding to each tag key can be an empty array but the structure cannot be missing. Each tag key and each value of the same tag key must be unique. Resources with tags listed in this field will be returned. Keys are in the AND relationship and values in each key-value structure are in the OR relationship. If this parameter is not specified, all resources will be returned.

matches

No

Array of match objects

Search field. key indicates the field to be matched, for example, resource_name. value indicates the matched value. The key is a fixed dictionary value and cannot contain duplicate keys or unsupported keys.

Check whether fuzzy match is required based on the key value. For example, if key is set to resource_name, prefix search is performed. If value is empty, exact match is performed. Most services do not have resources without names. In this case, an empty list is returned.

Table 5 resource_tag

Parameter

Mandatory

Type

Description

key

Yes

String

Key. It can contain a maximum of 128 characters.

The key must comply with specifications described in 3.1 Character Set Specifications for Key.

value

Yes

String

Value. Each value can contain a maximum of 255 characters. The value must comply with specifications described in 3.2 Character Set Specifications for Value.

Table 6 match

Parameter

Mandatory

Type

Description

key

No

String

Key

value

No

String

Value. It can contain a maximum of 255 Unicode characters. The character set is not verified.

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

resources

Array of ResInstance objects

Resource instance list

total_count

Integer

Total number of resource instances

Table 8 ResInstance

Parameter

Type

Description

resource_id

String

Resource ID (mesh ID)

resource_name

String

Resource name (mesh name)

tags

Array of resource_tag objects

Tag list

sys_tags

Array of resource_tag objects

System tag list

Table 9 resource_tag

Parameter

Type

Description

key

String

Key. It can contain a maximum of 128 characters.

The key must comply with specifications described in 3.1 Character Set Specifications for Key.

value

String

Value. Each value can contain a maximum of 255 characters. The value must comply with specifications described in 3.2 Character Set Specifications for Value.

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

errorCode

String

Error code

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

errorCode

String

Error code

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

The list of filtered resource instances is obtained.

400

Failed to obtain the list of resource instances due to incorrect parameters.

500

Internal error.

Error Codes

See Error Codes.