Updated on 2023-09-13 GMT+08:00

Starting Tasks in Batches

Function

This API is used to start real-time migration, synchronization, and disaster recovery tasks in batches.

Debugging

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

Constraints

  • This API can be called only after all tasks are configured. For details, see Task Creation Process.
  • In the dual-active DR scenario, this operation can be performed only when the forward task status is INCRE_TRANSFER_STARTED and RPO&RTO is less than 60s. For backward tasks, this operation can be performed only after all tasks are configured. The parent task does not support this operation.
  • When a yearly/monthly task created using APIs is started, an order is created and automatically paid.

URI

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

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

Request list for starting tasks in batches.

For details, see Table 4.

Table 4 Data structure description of field jobs

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

start_time

No

String

Task start time. The timestamp is accurate to milliseconds, for example, 1608188903063. If the value is empty, the task is started immediately.

Response Parameters

Status code: 202

Table 5 Response body parameters

Parameter

Type

Description

results

Array of StartJobResp objects

List of real-time disaster recovery tasks that are started in batches.

count

Integer

Total number.

Table 6 StartJobResp

Parameter

Type

Description

id

String

Task ID.

status

String

Status Values:

  • success
  • failed

order_id

String

Order ID.

NOTE:

This parameter is returned for yearly/monthly tasks created using APIs.

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Starting specified DR tasks in batches

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

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

Example Response

Status code: 202

Accepted

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

Status Code

Status Code

Description

202

Accepted

400

Bad Request

Error Code

For details, see Error Code.