Updated on 2025-11-19 GMT+08:00
Task Creation Example
This section describes how to create a real-time migration task by calling an API.
Involved APIs
Procedure
- Obtain the token by referring to Authentication.
- Obtain the DRS endpoints.
- Before calling this API, obtain the required region and endpoint.
- Obtain the project ID of a user in a region. For details, see Obtaining a Project ID.
- Send POST https://{DRS endpoint}/v3/{projectId}/jobs.
- Add X-Auth-Token to the request header. The value is user token.
- Add the Content-Type key to the request header. The value of Content-Type is application/json.
- Specify the following parameters in the request body:
{ "bind_eip": true,//Check whether an EIP has been bound to the replication instance in the public network scenario. "db_use_type": "migration",//The usage type. The value can be migration (real-time migration), sync (real-time synchronization), or cloudDataGuard (real-time DR). This parameter is mandatory. ""description": "",//Task description "engine_type": "mysql",//The engine type. The value can be mysql, mongodb, gaussdbv5, or cloudDataGuard-mysql. "is_target_readonly": true,//Specifies whether the destination instance is readable only. "job_direction": "up",//Task direction. The value can be up or down. "name": "DRS-2057",//Task name. This parameter is mandatory. "net_type": "eip",// Network type. This parameter is mandatory and the value can be vpn, vpc, or eip. "node_type": "high",//Specification type. This parameter is mandatory. "source_Endpoint": {//Information body of the source database. This parameter is mandatory. "db_type": "mysql",//The database type. The value can be mysql, mongodb, gaussdbv5, or gaussdbv5. This parameter is mandatory. }, "target_Endpoint": {//Information body of the destination database "db_type": "mysql",//Database type. This parameter is mandatory. "inst_id": "63e0699063494a8a93798f38abf3247ein01",// RDS instance ID. This parameter is mandatory when the database is an RDS DB instance. "region": "eu-west-101" // The region where the RDS DB instance is located. This parameter is mandatory when the database is an RDS DB instance. }, "task_type": "FULL_INCR_TRANS" //Task mode. The value can be FULL_TRANS or FULL_INCR_TRANS. }If the request fails, an error code and error message are returned. For details, see section Error Code.
Parent topic: Getting Started
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.
