Updated on 2025-11-25 GMT+08:00

Querying Task Status

Function

This API is used to query the execution status of a task.

It can be used to query the execution status of a disk creation, capacity expansion, or deletion task.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /v1/{project_id}/jobs/{job_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Definition

The task ID.

Constraints

N/A

Range

N/A

Default Value

N/A

project_id

Yes

String

Definition

The project ID. For details, 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

X-Auth-Token

Yes

String

Definition

The user token.

You can obtain it by calling the IAM API for obtaining a user token. The token is the value of X-Subject-Token in the response header.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Definition

The task status.

Range

  • SUCCESS: successful

  • RUNNING: running

  • FAIL: failed

  • INIT: initializing

  • WAITING_EXECUTE: waiting for execution

  • LISTENING: be listening to

entities

JobEntities object

Definition

The task response information.

Range

N/A

job_id

String

Definition

The task ID.

Range

N/A

job_type

String

Definition

The task type.

Range

  • *createVolume: Create a disk.

  • batchCreateVolume: Batch create disks.

  • deleteVolume: Delete a disk.

  • extendVolume: Expand the capacity of a disk.

  • bulkDeleteVolume: Batch delete disks.

  • deleteSingleVolume: Delete disks one by one during a batch deletion.

  • retypeVolume: Change the type of a disk.

begin_time

String

Definition

The start time.

Range

N/A

end_time

String

Definition

The end time.

Range

N/A

error_code

String

Definition

The error code returned if the task execution fails.

Range

N/A

fail_reason

String

Definition

The cause of the task execution failure.

Range

N/A

Table 4 JobEntities

Parameter

Type

Description

volume_type

String

Definition

The disk type.

Range

N/A

size

Integer

Definition

The disk size, in GiB.

Range

N/A

volume_id

String

Definition

The disk ID.

Range

N/A

name

String

Definition

The disk name.

Range

N/A

sub_jobs

Array of SubJob objects

Definition

The subtask information. If there is subtask information, other fields in entities are not returned.

Range

N/A

Table 5 SubJob

Parameter

Type

Description

status

String

Definition

The subtask status.

Range

  • SUCCESS: successful

  • RUNNING: running

  • FAIL: failed

  • INIT: initializing

entities

SubJobEntities object

Definition

The subtask response information.

Range

N/A

job_id

String

Definition

The subtask ID.

Range

N/A

job_type

String

Definition

The subtask type.

Range

  • *createVolume: Create a disk.

  • batchCreateVolume: Batch create disks.

  • deleteVolume: Delete a disk.

  • extendVolume: Expand the capacity of a disk.

  • bulkDeleteVolume: Batch delete disks.

  • deleteSingleVolume: Delete disks one by one during a batch deletion.

  • retypeVolume: Change the type of a disk.

begin_time

String

Definition

The start time.

Range

N/A

end_time

String

Definition

The end time.

Range

N/A

error_code

String

Definition

The error code returned if the subtask execution fails.

Range

N/A

fail_reason

String

Definition

The cause of the subtask execution failure.

Range

N/A

Table 6 SubJobEntities

Parameter

Type

Description

volume_type

String

Definition

The disk type.

Range

N/A

size

Integer

Definition

The disk size, in GiB.

Range

N/A

volume_id

String

Definition

The disk ID.

Range

N/A

name

String

Definition

The disk name.

Range

N/A

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error

Error object

Definition

The error code returned if an error occurs. For details about the error code, see Error Codes.

Range

N/A

Table 8 Error

Parameter

Type

Description

code

String

Definition

The error code returned if an error occurs.

Range

For details about the error code, see Error Codes.

message

String

Definition

The error message returned if an error occurs.

Range

N/A

Example Requests

GET https://{endpoint}/v1/{project_id}/jobs/{job_id}

https://{endpoint}/v1/{project_id}/jobs/{job_id}

Example Responses

Status code: 200

OK

{
  "status" : "RUNNING",
  "entities" : {
    "volume_id" : "bdf1bb37-f20f-4266-9a04-f43e0a127376"
  },
  "job_id" : "4010a32d535527910153552b492c0002",
  "job_type" : "createVolume",
  "begin_time" : "2016-03-08T07:40:13.219Z",
  "end_time" : ""
}

Status code: 400

Bad Request

{
  "error" : {
    "message" : "XXXX",
    "code" : "XXX"
  }
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See Error Codes.