All Products
Search
Document Center

ApsaraMQ for RocketMQ:ExecuteMigrationOperation

Last Updated:Sep 24, 2026

Performs a specified operation on a specified migration task.

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

rocketmq:ExecuteMigrationOperation

update

*Instance

acs:rocketmq:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Request syntax

POST /migrations/{migrationId}/stages/{stageType}/operations/{operationId}/execute HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

migrationId

integer

Yes

The migration ID.

44

stageType

string

Yes

The migration stage type.

Valid values:

  • MIGRATE_MESSAGE :

    Message migration.

MIGRATE_MESSAGE

operationId

integer

Yes

The migration operation ID.

2729

Request parameters

Parameter

Type

Required

Description

Example

instanceId

string

No

The instance ID.

rmq-cn-x0r37kel***

body

object

No

The request body structure.

operationParam

object

No

The operation parameter.

paramData

any

No

The parameter information. The parameter type is a JSON string. See the examples below.

The valid values for the action field are as follows:

  • MIGRATE_FORWARD (migrate forward)

  • MIGRATE_BACKWARD (migrate backward)

The valid values for the targetStage field are as follows:

  • MIGRATE_WAIT (read from and write to the source cluster)

  • DOUBLE_READ (write to the source cluster with redundant reads)

  • SWITCH_WRITE (write to the destination cluster with redundant reads)

  • MIGRATE_FINISH (read from and write to the destination cluster)

Note
  • For migration forward, you can only advance one stage at a time in order.

  • For migration rollback, you can roll back to any previous stage.

Migrate forward: {"action":"MIGRATE_FORWARD","targetStage":"MIGRATE_FINISH"} Migrate backward: {"action":"MIGRATE_BACKWARD","targetStage":"MIGRATE_WAIT"}

Response elements

Element

Type

Description

Example

object

Result

requestId

string

The request ID.

814BCD66-2D76-5080-AAD2-E50E5BDB0995

success

boolean

Indicates whether the request was successful.

true

data

object

The return result.

operationId

integer

The migration operation ID.

110

migrationId

integer

The migration ID.

6

stageType

string

The migration stage type.

Valid values:

  • MIGRATE_MESSAGE :

    Message migration.

MIGRATE_MESSAGE

operationType

string

The operation type.

MIGRATE_MESSAGE

operationStatus

string

The operation status.

Valid values:

  • INIT :

    Not started.

  • DONE :

    Completed.

  • DOING :

    In progress.

  • FAIL :

    Failed.

DOING

operationKey

string

The primary key of the operation object.

normal-topic-1

businessStatus

string

The operation business status.

Valid values:

  • MIGRATE_CHECK :

    Read from and write to the source cluster.

  • SWITCH_WRITE :

    Write to the destination cluster with redundant reads.

  • MIGRATE_FINISH :

    Read from and write to the destination cluster.

  • DOUBLE_READ :

    Write to the source cluster with redundant reads.

  • ALREADY_MIGRATED :

    Already migrated.

MIGRATE_WAIT

operationParam

object

The operation parameter.

paramData

any

The parameter information.

{"action":"MIGRATE_FORWARD","targetStage":"MIGRATE_FINISH"}

operationResult

object

The operation result.

resultData

any

The operation result.

{ "checkStatus": "WAIT_CHECK", "sourceTopicStatus": "PERM_6", "targetTopicStatus": "PERM_4", "checkResult": {}, "migrateStage": "DOUBLE_READ" }

createTime

string

The creation time, in YYYY-MM-DD HH:mm:ss format.

2022-08-01 20:05:50

updateTime

string

The modification time, in YYYY-MM-DD HH:mm:ss format.

2022-08-01 20:05:50

code

string

The error code.

Topic.NotFound

message

string

The error message.

The topic already exists.

httpStatusCode

integer

The HTTP status code.

200

dynamicCode

string

The dynamic error code.

InstanceId

dynamicMessage

string

The dynamic error message.

instanceId

Examples

Success response

JSON format

{
  "requestId": "814BCD66-2D76-5080-AAD2-E50E5BDB0995",
  "success": true,
  "data": {
    "operationId": 110,
    "migrationId": 6,
    "stageType": "MIGRATE_MESSAGE",
    "operationType": "MIGRATE_MESSAGE",
    "operationStatus": "DOING",
    "operationKey": "normal-topic-1",
    "businessStatus": "MIGRATE_WAIT",
    "operationParam": {
      "paramData": "{\"action\":\"MIGRATE_FORWARD\",\"targetStage\":\"MIGRATE_FINISH\"}"
    },
    "operationResult": {
      "resultData": "{\n    \"checkStatus\": \"WAIT_CHECK\",\n    \"sourceTopicStatus\": \"PERM_6\",\n    \"targetTopicStatus\": \"PERM_4\",\n    \"checkResult\": {},\n    \"migrateStage\": \"DOUBLE_READ\"\n}"
    },
    "createTime": "2022-08-01 20:05:50",
    "updateTime": "2022-08-01 20:05:50"
  },
  "code": "Topic.NotFound",
  "message": "The topic already exists.",
  "httpStatusCode": 200,
  "dynamicCode": "InstanceId",
  "dynamicMessage": "instanceId"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.