Updated on 2024-08-23 GMT+08:00

Pausing Tasks in Batches

Function

This API is used to pause tasks in batches.

Constraints

  • You can pause a task that is being migrated, being synchronized, or being used for disaster recovery.
  • In the dual-active DR scenario, the parent task cannot call the API.

URI

POST /v3/{project_id}/jobs/batch-pause-task

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 value cannot contain empty objects. The value of job_id must comply with the UUID rule.

For details, see Table 4.

Table 4 Data structure description of field jobs

Parameter

Mandatory

Type

Description

job_id

Yes

String

Task ID.

pause_mode

Yes

String

Pause type. target: Stop replay. all: Stop log capturing and replay.

Values:

  • target
  • all

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

results

Array of objects

List of tasks to be suspended in batches.

For details, see Table 6.

count

Integer

Total number.

Table 6 Data structure description of field results

Parameter

Type

Description

id

String

Task ID.

status

String

Pause result.

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Pausing specified tasks in batches

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

{
  "jobs" : [ {
    "job_id" : "8d0e8e36-a618-490d-8a46-8c61ac9jb502",
    "pause_mode" : "target"
  } ]
}

Example Response

Status code: 200

OK

{
  "results" : [ {
    "id" : "8d0e8e36-a618-490d-8a46-8c61ac9jb502",
    "status" : "success"
  } ],
  "count" : 1
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.