ListTagResources
Queries tags bound to one or more delivery groups, or filters delivery groups that have specific tags bound by tag key-value pairs.
Operation description
This operation complies with the Alibaba Cloud tagging standard and is used to query tags bound to Elastic Cloud Application (China) delivery groups. You can query tags bound to resources by resource ID, or filter resources that have specific tags bound by tag key-value pairs.
Before you begin
A delivery group is created. You can call the ListAppInstanceGroup operation to obtain the delivery group ID.
Tags are bound to the delivery group. You can bind tags by calling the TagResources operation, or by using the console or the Tag service.
Parameter description
ResourceType is required. Only
APPINSTANCEGROUP(delivery group) is supported. If you specify other values, the error codeInvalidResourceType.Invalidis returned.- Specify at least one of ResourceId.N and Tag.N. If neither is specified, the error code
MissingParameter.ResourceIdsOrTagsis returned.If only ResourceId.N is specified: all tags attached to the specified resources are returned.
If only Tag.N is specified: all resources that have the specified tags attached and their matching tags are returned.
If both are specified: only records of the specified resources that have the specified tags attached are returned.
Tag.N.Key is required. If it is empty, the error code
InvalidTagPolicy.KeyInvalidis returned. Tag.N.Value is optional. If it is not specified, the value of the tag key is not restricted, which means any tag value under the key is matched.Multiple Tag.N conditions have an AND relationship. A resource is returned only if it has all specified tags attached.
Response description
Each record in the response corresponds to a resource-tag key-value pair. If a resource has multiple tags bound, multiple records are returned.
TotalCount indicates the number of records returned.
This operation returns all matching results at a time. An empty NextToken value indicates that no more data is available.
Invocation sequence
Invoke the ListAppInstanceGroup operation to obtain the delivery group ID.
Invoke the TagResources operation to attach tags to the delivery group.
Invoke this operation to query tag bindings by resource ID or tag conditions.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| ResourceType |
string |
Yes |
The resource type. Valid values:
This parameter is case-insensitive. Only this value is supported. If you specify other values, the error code |
APPINSTANCEGROUP |
| ResourceId |
array |
No |
The list of resource IDs. A maximum of 50 resource IDs are supported. If the resource type is delivery group, specify the delivery group ID (prefixed with Note
Specify at least one of ResourceId.N and Tag.N. If only ResourceId.N is specified, all tags bound to the specified resources are returned. |
|
|
string |
Yes |
The resource ID. If the resource type is delivery group, this is the delivery group ID. |
aig-9ciijz60n4xsv**** |
|
| Tag |
array<object> |
No |
The list of tag conditions. A maximum of 20 tag conditions are supported. Note
Specify at least one of ResourceId.N and Tag.N. Multiple tags have an AND relationship. Only resources that have all specified tags bound are returned. |
|
|
object |
No |
The tag condition. |
||
| Key |
string |
Yes |
The tag key. This parameter is required. The tag key is case-sensitive and must be 1 to 128 characters in length. |
Resolution |
| Value |
string |
No |
The tag value. The tag value is case-sensitive and can be up to 256 characters in length. If this parameter is not specified, the value of the tag key is not restricted, which means any tag value under the key is matched. |
720p |
| NextToken |
string |
No |
The paged query token. You do not need to specify this parameter for the first request. If the previous invoke returned a non-empty NextToken value, pass it in as-is to retrieve subsequent paging results. |
AAAAAYRHtOLVQzCYj17y+OP7LZRrUJaF4rnBGQkWwMiVHlLZBB1w3Us37CVvhvyM0TXavA== |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| NextToken |
string |
The token for the next query. An empty value indicates that no more data is available. This operation returns all matching results at a time, so this field is typically empty. |
AAAAAYRHtOLVQzCYj17y+OP7LZRrUJaF4rnBGQkWwMiVHlLZBB1w3Us37CVvhvyM0TXavA== |
| RequestId |
string |
The request ID. |
1CBAFFAB-B697-4049-A9B1-67E1FC5F**** |
| TagResources |
array<object> |
The list of resource-tag binding records. Each record corresponds to a tag key-value pair on a resource. |
|
|
object |
The resource-tag binding record. |
||
| ResourceId |
string |
The resource ID. If the resource type is delivery group, this is the delivery group ID. |
aig-9ciijz60n4xsv**** |
| ResourceType |
string |
The resource type. Valid values:
|
APPINSTANCEGROUP |
| TagKey |
string |
The tag key. |
Resolution |
| TagValue |
string |
The tag value. |
720p |
| TotalCount |
integer |
The number of tag records returned. If a resource has multiple tags bound, each tag key-value pair counts as one record. |
2 |
Examples
Success response
JSON format
{
"NextToken": "AAAAAYRHtOLVQzCYj17y+OP7LZRrUJaF4rnBGQkWwMiVHlLZBB1w3Us37CVvhvyM0TXavA==",
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
"TagResources": [
{
"ResourceId": "aig-9ciijz60n4xsv****",
"ResourceType": "APPINSTANCEGROUP",
"TagKey": "Resolution",
"TagValue": "720p"
}
],
"TotalCount": 2
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | ServiceUnavailable | Service unavailable. Please try again later. | Service unavailable. Please try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.