Lists the tags attached to one or more gateways.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hcs-sgw:ListTagResources |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| ResourceRegionId |
string |
No |
The ID of the resource region. |
cn-hangzhou |
| ResourceType |
string |
Yes |
The resource type. The value must be GATEWAY. |
GATEWAY |
| NextToken |
string |
No |
The token that is used to retrieve the next page of results. You do not need to specify this parameter for the first request. If the number of results exceeds the page size, you can use the token that is returned for the previous request to retrieve the next page of results. |
212db86sca4384811e0b5e8707ec21345 |
| ResourceId |
array |
No |
The IDs of gateways. You can query the tags of N gateways at a time. Note
|
gw-uf6wjk5xxxxxxx |
|
string |
No |
The IDs of gateways. You can query the tags of N gateways at a time. N can be an integer from 1 to 50. Note
You must specify at least one of ResourceId.N and Tag.N.Key. |
gw-uf6wjk5xxxxxxx |
|
| Tag |
array<object> |
No |
The tags. Note
|
|
|
object |
No |
|||
| Key |
string |
No |
The tag key. You can query N tag keys at a time. N can be an integer from 1 to 20. The tag key cannot be an empty string. Note
You must specify at least one of ResourceId.N and Tag.N.Key. |
testkey1 |
| Value |
string |
No |
The tag value of the tag key. You can query N tag values at a time. N can be an integer from 1 to 20. The tag value can be an empty string. |
testvalue1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| NextToken |
string |
If not all results are returned in a query, you can use the token that is returned for the previous query to retrieve the next page of results. |
212db86sca4384811e0b5e8707ec21345 |
| RequestId |
string |
The request ID. |
47A514A1-4B77-4E30-B4C5-2A880650B3FD |
| TagResources |
object |
||
| TagResource |
array<object> |
The information about the queried gateways and tags. |
|
|
object |
|||
| ResourceType |
string |
The resource type. ALIYUN::HCS_SGW::GATEWAY indicates a Cloud Storage Gateway. |
ALIYUN::HCS_SGW::GATEWAY |
| TagValue |
string |
The tag value of the tag key. |
testvalue1 |
| ResourceId |
string |
The gateway ID. |
47A514A1-4B77-4E30-B4C5-2A880650B3FD |
| TagKey |
string |
The tag key. |
testkey1 |
Examples
Success response
JSON format
{
"NextToken": "212db86sca4384811e0b5e8707ec21345",
"RequestId": "47A514A1-4B77-4E30-B4C5-2A880650B3FD",
"TagResources": {
"TagResource": [
{
"ResourceType": "ALIYUN::HCS_SGW::GATEWAY",
"TagValue": "testvalue1",
"ResourceId": "47A514A1-4B77-4E30-B4C5-2A880650B3FD\t",
"TagKey": "testkey1\t"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter.ResourceIds | The parameter - ResourceIds.N should not be null. | |
| 400 | MissingParameter.Tags | The parameter - Tags should not be null. | |
| 400 | Missing.TagKey | The Tag.N.Key parameter is blank. | |
| 400 | InvalidParameter.TagKey | The Tag.N.Key parameter is invalid. | |
| 400 | InvalidParameter.TagValue | The Tag.N.Value parameter is invalid. | |
| 400 | InvalidParameter.ResourceType | The ResourceType parameter is invalid. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | |
| 400 | MissingParameter.TagOrResourceId | The specified Tags and ResourcesIds are not allow to both empty. | |
| 400 | NumberExceed.ResourceIds | The ResourceIds parameter's number is exceed , Valid : 50 | |
| 400 | NumberExceed.Tags | The Tags parameter's number is exceed , Valid : 20 | |
| 403 | PermissionDenied.Scope | The specified operator not have permission to set Scope value. | |
| 403 | PermissionDenied.TagOwnerUid | The specified operator not have permission to set TagOwnerUid value. | |
| 403 | PermissionDenied.TagOwnerBid | The specified operator not have permission to set TagOwnerBid value. | |
| 403 | NoPermissionKey.Operator | These keys are not permission for this operator. | |
| 403 | NoPermissionKey.Scope | These keys are not permission for this scope. | |
| 403 | NoPermissionKey.Category | These keys are not permission for this category. | |
| 403 | NoPermission.SystemTag | The operator is not permission for the system tag. | |
| 403 | NoPermission.Operator | The operator is not permission for this operate. | |
| 404 | InvalidResourceType.NotFound | The ResourceType provided does not exist in our records. | |
| 404 | InvalidResourceId.NotFound | The specified ResourceId is not found in our records. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.