Queries the tags attached to one or more SMC resources, such as migration sources and migration tasks.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
smc:ListTagResources |
get |
*ReplicationJob
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceType |
string |
Yes |
The SMC resource type. Valid values:
|
sourceserver |
| NextToken |
string |
No |
The token to start the next query. |
caeba0bbb2be03f84eb48b699f0a4883 |
| ResourceId |
array |
No |
A list of SMC resource IDs. SMC resources include migration sources and migration tasks. The list can contain a maximum of 50 IDs. |
s-bp1e2fsl57knvuug**** |
|
string |
No |
An SMC resource ID. SMC resources include migration sources and migration tasks. |
s-bp1e2fsl57knvuug**** |
|
| Tag |
array<object> |
No |
A list of tags. |
|
|
object |
No |
|||
| Key |
string |
No |
The tag key of the SMC resource. The tag key can be 1 to 64 characters in length. N indicates the serial number of the tag. Valid values of N: 1 to 20. Tag.N is a key-value pair that is used to filter SMC resources.
|
TestKey |
| Value |
string |
No |
The tag value of the SMC resource. The tag value can be 1 to 64 characters in length. N indicates the serial number of the tag. Valid values of N: 1 to 20. |
TestValue |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| NextToken |
string |
The token that is used to start the next query. If this parameter is empty, all results are returned. |
caeba0bbb2be03f84eb48b699f0a4883 |
| RequestId |
string |
The request ID. |
17743161-66F3-4E7F-B8AE-845FB28B928F |
| TagResources |
object |
||
| TagResource |
array<object> |
A collection of SMC resources and their tags, including resource IDs, resource types, and tag key-value pairs. |
|
|
object |
|||
| ResourceType |
string |
The resource type. |
ALIYUN::SMC::SOURCESERVER |
| TagValue |
string |
The tag value of the resource. |
TestValue |
| ResourceId |
string |
The resource ID. |
s-bp1e2fsl57knvuug**** |
| TagKey |
string |
The tag key of the resource. |
TestKey |
Examples
Success response
JSON format
{
"NextToken": "caeba0bbb2be03f84eb48b699f0a4883",
"RequestId": "17743161-66F3-4E7F-B8AE-845FB28B928F",
"TagResources": {
"TagResource": [
{
"ResourceType": "ALIYUN::SMC::SOURCESERVER",
"TagValue": "TestValue",
"ResourceId": "s-bp1e2fsl57knvuug****",
"TagKey": "TestKey"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | NumberExceed.Tags | The maximum number of the Tag parameters cannot exceed 20. | The maximum number of Tag parameters cannot exceed 20. |
| 400 | MissingParameter.ResourceType | You must specify ResourceType. | You must specify ResourceType. |
| 400 | InvalidResourceType.NotFound | The specified ResourceType does not exist. | The specified ResourceType does not exist. |
| 400 | NumberExceed.ResourceIds | The maximum number of ResourceId parameters cannot exceed 50. | The maximum number of ResourceId parameters cannot exceed 50. |
| 400 | Duplicate.ResourceId | The ResourceId contains duplicate values. | The ResourceId contains duplicate values. |
| 400 | InvalidResourceId.NotFound | The specified ResourceIds do not exist. | The specified ResourceIds do not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.