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

Querying Task Statuses in Batches

Function

This API is used to query task statuses in batches by task ID.

URI

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

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 strings

Querying task details in batches

page_req

No

Object

Pagination information.

For details, see Table 4.

Table 4 Data structure description of field page_req

Parameter

Mandatory

Type

Description

cur_page

No

Integer

Current page number, which cannot exceed the maximum number of pages. (Number of pages = Number of transferred job IDs/Number of tasks on each page)

  • Minimum value: 1.
  • Default value: 1

per_page

No

Integer

Number of items on each page. If this parameter is set to 0, all items are obtained.

  • Minimum value: 0
  • Maximum value: 100
  • Default value: 5

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

results

Array of objects

Task status information

For details, see Table 6.

count

Integer

Number of returned tasks.

Table 6 Data structure description of field results

Parameter

Type

Description

id

String

Task ID.

status

String

Task status.

  • CREATING: The task is being created.
  • CREATE_FAILED: The task fails to be created.
  • CONFIGURATION: The task is being configured.
  • STARTJOBING: The task is being started.
  • WAITING_FOR_START: The task is waiting to be started.
  • START_JOB_FAILED: The task fails to be started.
  • PAUSING: The task is paused.
  • FULL_TRANSFER_STARTED: Full migration or synchronization starts. Initialization is in progress in the DR scenario.
  • FULL_TRANSFER_FAILED: Full migration or synchronization fails. Initialization fails in the DR scenario.
  • FULL_TRANSFER_COMPLETE: Full migration or synchronization is complete. Initialization is complete in the DR scenario.
  • INCRE_TRANSFER_STARTED: Incremental migration or synchronization starts. The DR task is in progress.
  • INCRE_TRANSFER_FAILED: Incremental migration or synchronization fails. A DR exception occurs.
  • RELEASE_RESOURCE_STARTED: The task is being stopped.
  • RELEASE_RESOURCE_FAILED: The task fails to be stopped.
  • RELEASE_RESOURCE_COMPLETE: The task is stopped.
  • REBUILD_NODE_STARTED: The task is being recovered.
  • REBUILD_NODE_FAILED: The task fails to be recovered.
  • CHANGE_JOB_STARTED: The task is being changed.
  • CHANGE_JOB_FAILED: The task fails to be changed.
  • DELETED: The task is deleted.
  • CHILD_TRANSFER_STARTING: The subtask is being started.
  • CHILD_TRANSFER_STARTED: The subtask is being migrated.
  • CHILD_TRANSFER_COMPLETE: The subtask migration is complete.
  • CHILD_TRANSFER_FAILED: The subtask fails to be migrated.
  • RELEASE_CHILD_TRANSFER_STARTED: The subtask is being stopped.
  • RELEASE_CHILD_TRANSFER_COMPLETE: The subtask is stopped.
  • NODE_UPGRADE_START: The upgrade starts.
  • NODE_UPGRADE_COMPLETE: The upgrade is complete.
  • NODE_UPGRADE_FAILED: The upgrade fails.

Enumerated values:

  • CREATING
  • CREATE_FAILED
  • CONFIGURATION
  • STARTJOBING
  • WAITING_FOR_START
  • START_JOB_FAILED
  • PAUSING
  • FULL_TRANSFER_STARTED
  • FULL_TRANSFER_FAILED
  • FULL_TRANSFER_COMPLETE
  • INCRE_TRANSFER_STARTED
  • INCRE_TRANSFER_FAILED
  • RELEASE_RESOURCE_STARTED
  • RELEASE_RESOURCE_FAILED
  • RELEASE_RESOURCE_COMPLETE
  • REBUILD_NODE_STARTED
  • REBUILD_NODE_FAILED
  • CHANGE_JOB_STARTED
  • CHANGE_JOB_FAILED
  • DELETED
  • CHILD_TRANSFER_STARTING
  • CHILD_TRANSFER_STARTED
  • CHILD_TRANSFER_COMPLETE
  • CHILD_TRANSFER_FAILED
  • RELEASE_CHILD_TRANSFER_STARTED
  • RELEASE_CHILD_TRANSFER_COMPLETE
  • NODE_UPGRADE_START
  • NODE_UPGRADE_COMPLETE
  • NODE_UPGRADE_FAILED

error_code

String

Error code.

error_message

String

Error message.

Example Request

Example of querying task statuses in batches:

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

{
  "jobs" : [ "9a470239-2308-4bb5-a6bc-1040402fjb21", "dc67695a-ee3e-49b8-a022-a099bd81jb21" ],
  "page_req" : {
    "cur_page" : 1,
    "per_page" : 10
  }
}

Example Response

Status code: 200

OK

{
  "results" : [ {
    "id" : "9a470239-2308-4bb5-a6bc-1040402fjb21",
    "status" : "INCRE_TRANSFER_STARTED"
  }, {
    "id" : "dc67695a-ee3e-49b8-a022-a099bd81jb21",
    "status" : "INCRE_TRANSFER_FAILED"
  } ],
  "count" : 2
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.