Updated on 2026-09-07 GMT+08:00

Performing a Batch Pre-Check

Function

This API is used to perform batch pre-check to check whether the migration, synchronization, DR can be performed.

Debugging

You can debug the API in API Explorer to support automatic authentication. API Explorer can automatically generate and debug example SDK code.

Constraints

  • After a task is created, the task status is CONFIGURATION. The task can be invoked only after the test of connections to the source and destination databases is successful and the API for modifying the task is invoked.
  • In the dual-active DR scenario, when the forward task status is INCRE_TRANSFER_STARTED, the backward task does not need to call this API, and the parent task cannot call this API.
  • To ensure API performance, it is recommended that a single batch contain no more than 10 tasks.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions and Supported Actions.

URI

POST /v3/{project_id}/jobs/batch-precheck

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Definition

MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type.

Constraints

N/A

Range

application/json

Default Value

application/json

X-Auth-Token

Yes

String

Definition

User token obtained from IAM. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. The token is the value of X-Subject-Token in the response header.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Request language type.

Constraints

N/A

Range

  • en-us: English
  • zh-cn: Chinese

Default Value

en-us

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

jobs

Yes

Array of objects

Definition

The list of batch pre-check requests.

For details, see Table 4.

Table 4 Data structure description of field jobs

Parameter

Mandatory

Type

Description

job_id

Yes

String

Definition

Task ID, which uniquely identifies a data replication task and serves as the identifier for operations such as query, modification, and deletion.

Constraints

N/A

Range

N/A

Default Value

N/A

precheck_mode

Yes

String

Definition

Pre-check mode, which specifies the scenario type for pre-check. Specify the value based on the task status. Otherwise, the pre-check may fail, affecting task startup.

Constraints

N/A

Range

  • forStartJob: The pre-check is performed when the task is started for the first time during task configuration.
  • forRetryJob: The pre-check is performed after object editing during incremental execution or when retrying the task after a failure.

Default Value

N/A

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

results

Array of objects

Definition

Pre-check response body.

For details, see Table 6.

count

Integer

Definition

Total number of returned pre-check results, which is consistent with the length of the results array.

Constraints

N/A

Range

N/A

Table 6 Data structure description of field results

Parameter

Type

Description

id

String

Definition

Task ID, which uniquely identifies a data replication task and serves as the identifier for operations such as query, modification, and deletion.

Constraints

N/A

Range

N/A

precheck_id

String

Definition

ID returned after the pre-check is complete. It can be used to query the pre-check result.

Constraints

N/A

Range

N/A

status

String

Definition

Pre-check result status, which indicates whether the pre-check is successful.

Constraints

N/A

Range

  • success: The pre-check is successful.
  • failed: The pre-check failed.

error_code

String

Definition

Error code returned if the pre-check fails.

Constraints

N/A

Range

The value is in the format of DRS.XXXXXX.

error_msg

String

Definition

Error message returned if the pre-check fails.

Constraints

N/A

Range

N/A

Example Request

Performing a pre-check for a MySQL real-time migration task

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-precheck

{
  "jobs" : [ {
    "job_id" : "140b5236-88ad-43c8-811c-1268453jb101",
    "precheck_mode" : "forStartJob"
  } ]
}

Example Response

Status code: 200

OK

{
  "results" : [ {
    "id" : "140b5236-88ad-43c8-811c-1268453jb101",
    "status" : "success",
    "precheck_id" : "140b5236-88ad-43c8-811c-1268453jb101"
  } ],
  "count" : 1
}

Status Code

Status Code

Description

200

OK

400

Bad Request

For other statuses, see Status Code.

Error Code

For details, see Error Code.