Creating a Backup Import Task
Function
This API is used to create a backup import task.
URI
POST /v2/{project_id}/migration-task
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
task_name |
Yes |
String |
Backup import task name. |
|
description |
No |
String |
Backup import task description. |
|
migration_type |
Yes |
String |
Migration mode. Options:
|
|
migration_method |
Yes |
String |
Type of the migration, which can be full migration or incremental migration. 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. This API can no longer be used to create an online migration task. Please call CreateOnlineMigrationTask instead. |
|
source_instance |
No |
SourceInstanceBody object |
Source Redis information. This parameter is mandatory when the migration mode is online data migration. This API can no longer be used to create an online migration task. Please call CreateOnlineMigrationTask instead. |
|
target_instance |
Yes |
TargetInstanceBody object |
Target Redis information. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
file_source |
Yes |
String |
Data source
|
|
bucket_name |
No |
String |
OBS bucket name. Mandatory when the data source is an 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 address (specified in the source_instance parameter). |
|
password |
No |
String |
Redis password. If a password is set, this parameter is mandatory. |
|
task_status |
No |
String |
Task status. You do not need to set this parameter. |
|
id |
No |
String |
Redis instance ID. |
|
ip |
No |
String |
Redis IP address. |
|
port |
No |
String |
Redis port. |
|
name |
No |
String |
Redis name. |
|
proxy_multi_db |
No |
Boolean |
Definition Whether multi-DB is enabled for a Proxy Cluster DCS instance. The value shall be true if the source Redis is a multi-DB (multi-db set to yes) Proxy Cluster DCS Redis instance. Not required in other scenarios. Constraints If this parameter is enabled for a source Proxy Cluster instance without multi-DB, the task may fail. Range
Default Value false |
|
db |
No |
String |
Redis database (DB). Specifies the DB to be migrated. For example, if 5 is entered, only DB5 will be migrated. If this parameter is left blank, all DBs will be migrated. The value range of a multi-DB instance is 0–255. |
|
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. |
|
task_status |
No |
String |
Task status. You do not need to set this parameter. |
|
ip |
No |
String |
Redis IP address. |
|
port |
No |
String |
Redis port. |
|
addrs |
No |
String |
Redis instance address. |
|
proxy_multi_db |
No |
Boolean |
Whether multi-DB is enabled for a Proxy Cluster DCS instance. You do not need to set this parameter. |
|
db |
No |
String |
Redis database (DB). For example, if 5 is entered, data will be all written to DB5. If this parameter is not entered, none is specified. The value range of a multi-DB instance is 0–255. |
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. |
|
error |
String |
Error message. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_msg |
String |
Parameter description: Error message. Value range: N/A. |
|
error_code |
String |
Parameter description: Error code. Value range: For details, see Error Codes. |
|
error_ext_msg |
String |
Parameter description: Extended error information. This parameter is not used currently and is set to null. Value range: N/A. |
Example Requests
Creating a backup import task to migrate data from an OBS bucket
POST https://{dcs_endpoint}/v2/{project_id}/migration-task
{
"task_name" : "migration1",
"description" : "Test",
"migration_type" : "backupfile_import",
"migration_method" : "full_amount_migration",
"backup_files" : {
"bucket_name" : "bucketName",
"file_source" : "self_build_obs",
"files" : [ {
"size" : "754.0MB",
"file_name" : "fileName"
} ]
},
"target_instance" : {
"id" : "d2c8399f-bdba-43c1-8069-3ff17a1a79d5",
"name" : "dcs-test",
"password" : "xxxxxx"
}
}
Example Responses
Status code: 200
Backup import task created.
{
"id" : "8aa6999e71cb638b0171f485f5266ef0",
"name" : "dcs-test",
"status" : "MIGRATING",
"error" : ""
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Backup import task created. |
|
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot