All Products
Search
Document Center

Server Migration Center:ListTagResources

Last Updated:Sep 08, 2025

Queries the tags attached to one or more SMC resources, such as migration sources and migration tasks.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

smc:ListTagResources

get

*ReplicationJob

acs:smc:{#regionId}:{#AccountId}:replicationjob/{#ReplicationJobId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ResourceType

string

Yes

The SMC resource type. Valid values:

  • sourceserver: a migration source

  • replicationjob: a migration task

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.

  • Tag keys and tag values are case-sensitive.

  • If you specify only Tag.N.Key, all resources that have this tag key are returned.

  • If you specify only Tag.N.Value, an InvalidParameter.TagValue error is returned.

  • If you specify multiple tags, only the SMC resources that have all these tags are returned.

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.