Updated on 2023-09-13 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.
  • You can call a maximum of 10 APIs in batches.

URI

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

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region

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

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

The content type.

The default value is application/json.

X-Auth-Token

Yes

String

User token obtained from IAM.

X-Language

No

String

Request language type

Default value: en-us

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

jobs

Yes

Array of objects

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

Task ID.

precheck_mode

Yes

String

Pre-check mode. Values:

  • forStartJob: This value is specified when the task is started for the first time during task configuration.
  • forRetryJob: This value is transferred for pre-check after object editing or retry after task failure during incremental task execution.
    NOTE:

    Specify the value based on the task status. Otherwise, the pre-check may fail, affecting task startup.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

results

Array of objects

Pre-check response body.

For details, see Table 6.

count

Integer

Total number.

Table 6 Data structure description of field results

Parameter

Type

Description

id

String

Task ID.

precheck_id

String

Pre-check ID.

status

String

Success or failure status. Values:

  • success
  • failed

error_code

String

Error code.

error_msg

String

Error message.

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

Error Code

For details, see Error Code.