Updated on 2022-08-05 GMT+08:00

Managing Migration Tasks

Function

This API is used to manage migration tasks, including starting, pausing, and synchronizing tasks, uploading logs, and rolling back failed migration tasks.

URI

POST /v3/tasks/{task_id}/action

Table 1 Path parameter

Parameter

Mandatory

Type

Description

task_id

Yes

String

Specifies the migration task ID.

Minimum length: 0 characters

Maximum length: 255 characters

Request

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Minimum length: 1 character

Maximum length: 16,384 characters

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

operation

Yes

String

Specifies the operation to be performed on the task.

The value can be:

  • start
  • stop
  • collect_log
  • test
  • clone_test
  • restart
  • sync_failed_rollback

param

No

Map<String,String>

Specifies the operation parameters.

Response

None

Example Request

  • Clone the target server for the task whose ID is 7a9a9540-ff28-4869-b9e4-855fbe12xxxx.
    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12e83b/action
    
    {
      "operation" : "clone_test"
    }
  • Launch the target server for the task whose ID is 7a9a9540-ff28-4869-b9e4-855fbe12xxxx.
    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/action
    
    {
      "operation" : "test"
    }
  • Start the task whose ID is 7a9a9540-ff28-4869-b9e4-855fbe12xxxx.
    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/action
    
    {
      "operation" : "start"
    }
  • Roll back the failed synchronization task whose ID is 7a9a9540-ff28-4869-b9e4-855fbe12xxxx.
    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/action
    
    {
      "operation" : "sync_failed_rollback"
    }
  • Pause the task whose ID is 7a9a9540-ff28-4869-b9e4-855fbe12xxxx.
    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/action
    
    {
      "operation" : "stop"
    }
  • Restart the finished task whose ID is 7a9a9540-ff28-4869-b9e4-855fbe12xxxx.
    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/action
    
    {
      "operation" : "restart"
    }
  • Upload the logs of the task whose ID is 7a9a9540-ff28-4869-b9e4-855fbe12xxxx.
    POST https://{endpoint}/v3/tasks/7a9a9540-ff28-4869-b9e4-855fbe12xxxx/action
    
    {
      "operation" : "collect_log",
      "params" : {
        "bucket" : "sms"
      }
    }

Example Response

None

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.