Creating a Data Migration Task
Function
This API is used to create a data migration task.
URI
POST /v2/{project_id}/migration-task
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
task_name |
Yes |
String |
Migration task name. |
description |
No |
String |
Migration task description. |
migration_type |
Yes |
String |
Mode of the migration. Values:
Enumeration values:
|
migration_method |
Yes |
String |
Type of the migration, which can be full migration or incremental migration. Values:
Enumeration values:
|
backup_files |
No |
BackupFilesBody object |
Backup files to be imported when the migration mode is backup file import. |
network_type |
No |
String |
Type of the network for communication between the source and target Redis when the migration mode is online data migration. The network type can VPC or VPN. Enumeration values:
|
source_instance |
No |
SourceInstanceBody object |
Source Redis information. This parameter is mandatory when the migration mode is online data migration. |
target_instance |
Yes |
TargetInstanceBody object |
Target Redis information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file_source |
No |
String |
Data source, which can be an OBS bucket or a backup record. Enumeration values:
|
bucket_name |
Yes |
String |
Name of the OBS bucket. |
files |
Yes |
Array of Files objects |
List of backup files to be imported. This parameter is mandatory when the data source is an OBS bucket. |
backup_id |
No |
String |
Backup record ID. This parameter is mandatory when the data source is a backup record. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file_name |
Yes |
String |
Name of a backup file. |
size |
No |
String |
File size in bytes. |
update_at |
No |
String |
Time when the file was last modified. The format is YYYY-MM-DD HH:MM:SS. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
addrs |
Yes |
String |
Source Redis name (specified in the source_instance parameter). |
password |
No |
String |
Redis password. If a password is set, this parameter is mandatory. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
Yes |
String |
Redis instance ID (mandatory in the target_instance parameter). |
name |
No |
String |
Redis instance name (specified in the target_instance parameter). |
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 task status. The value can be SUCCESS, FAILED, MIGRATING, or TERMINATED. Enumeration values:
|
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
POST https://{dcs_endpoint}/v2/{project_id}/migration-task { "task_name" : "migration1", "description" : "Test", "migration_type" : "online_migration", "migration_method" : "full_amount_migration", "network_type" : "vpc", "source_instance" : { "addrs" : "192.168.1.135:6379", "password" : "xxxxxx" }, "target_instance" : { "name" : "dcs-test", "id" : "4cd5dbb8-aacd-4603-b817-3e97d48c7a20" } }
Example Responses
Status code: 200
Data migration task created successfully.
{ "id" : "8aa6999e71cb638b0171f485f5266ef0", "name" : "dcs-test", "status" : "MIGRATING" }
Status Codes
Status Code |
Description |
---|---|
200 |
Data migration task created successfully. |
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.