This API is used to query resource instances based on tags.
For details, see Calling APIs.
POST /v5/{project_id}/{resource_type}/resource-instances/filter
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
project_id |
String |
Yes |
Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID. |
resource_type |
String |
Yes |
|
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
limit |
Integer |
No |
|
offset |
Integer |
No |
|
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
without_any_tag |
Boolean |
No |
|
tags |
Array of Tag objects |
No |
|
matches |
Array of Match objects |
No |
|
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
key |
String |
Yes |
|
values |
Array of String |
Yes |
|
POST https://{Endpoint}/v5/{project_id}/{resource_type}/resource-instances/filter { "tags": [{ "key": "key1", "values": [ "value1", "value2" ] }, { "key": "key2", "values": [ "value1", "value2" ] } ], "matches": [{ "key": "resource_name", "value": "resource1" }], "without_any_tag": "false" }
Returned status code 200: successful query
Parameter |
Type |
Description |
---|---|---|
resources |
Array of Resource objects |
Indicates the resource object list. |
total_count |
Integer |
Indicates the total number of records. |
Parameter |
Type |
Description |
---|---|---|
resource_id |
String |
Indicates a resource ID. |
resource_detail |
object |
Specifies resource details. This parameter is reserved for extension and is left empty by default. |
tags |
Array of ResourceTag objects |
Specifies a tag list. |
resource_name |
String |
Indicates a resource name. |
{ "resources": [{ "resource_id": "134f9fb1-demo-a8df-va86-2040a5c13325", "resource_name": "resouece1", "tags": [{ "key": "key1", "value": "value1" }] }], "total_count": 1000 }
For details, see Status Codes.