Configuring an Online Data Migration Task¶
Function¶
This API is used to configure an online data migration task.
URI¶
POST /v2/{project_id}/migration/{task_id}/task
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID. |
task_id | Yes | String | Online migration task ID. |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
migration_method | Yes | String | Type of the migration.
Enumeration values:
|
resume_mode | Yes | String | Reconnection mode. In automatic reconnection mode, if the source and target instances are disconnected due to network exceptions, automatic reconnections will be performed indefinitely. Full synchronization will be triggered and requires more bandwidth if incremental synchronization becomes unavailable. Exercise caution when enabling this option. Values:
Enumeration values:
|
bandwidth_limit_mb | No | String | Bandwidth limit. For incremental migration, you can limit the bandwidth to ensure smooth service running. When the data synchronization speed reaches the limit, it can no longer increase. - Unit: MB/s. - Value range: 1-10,240 (an integer greater than 0 and less than 10,241). |
source_instance | Yes | ConfigMigrationInstanceBody object | Source Redis information. |
target_instance | Yes | ConfigMigrationInstanceBody object | Target Redis information. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
id | No | String | Redis instance ID (mandatory if the source Redis address is not specified). |
addrs | No | String | Source Redis address (mandatory if the Redis instance ID is not specified). |
password | No | String | Redis password. If a password is set, this parameter is mandatory. |
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
id | String | Migration task ID. |
name | String | Migration task name. |
status | String | Migration status. Options: SUCCESS, FAILED, MIGRATING, TERMINATED. Enumeration values:
|
error | String | Error message. |
Status code: 400
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Status code: 401
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Status code: 403
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Status code: 404
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Status code: 500
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Example Requests¶
Configuring an online migration task with migration type set to incremental, auto-reconnect enabled, and source and target instances configured
POST https://{dcs_endpoint}/v2/{project_id}/migration/{task_id}/task
{
"migration_method" : "incremental_migration",
"bandwidth_limit_mb" : 123,
"resume_mode" : "auto",
"source_instance" : {
"id" : null,
"addrs" : "192.168.1.1:6379,192.168.0.0:6379",
"password" : "xxxxxx"
},
"target_instance" : {
"id" : "cf4a05df-1c38-47c5-bb5a-0a7b3673b3bd",
"addrs" : null,
"password" : null
}
}
Example Responses¶
Status code: 200
Online data migration task configured.
{
"id" : "90754308-a156-406f-a837-8f852f38a646",
"name" : "dcs-migration-1db7",
"status" : "FULLMIGRATING",
"error" : ""
}
Status Codes¶
Status Code | Description |
---|---|
200 | Online data migration task configured. |
400 | Invalid request. |
401 | Invalid authentication information. |
403 | The request is rejected. |
404 | The requested resource is not found. |
500 | Internal service error. |
Error Codes¶
See Error Codes.