Query task status

Read a summary of the file processing status of the export task.

HTTP
GET $CLOUDSIGMA_API_BASE/export/task/$TASK_ID/state

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Get the task ID from Query export task details. Prepare personal access token and target workspace ID that can access the target workspace.

Path parameters

Replace $CLOUDSIGMA_API_KEY, $WORKSPACE_ID and $TASK_ID with actual values.

Shell
curl "$CLOUDSIGMA_API_BASE/export/task/$TASK_ID/state" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Type

Required

Description

task_id

string

Yes

The export task ID whose status is to be read.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "total": 4,
    "pending": 0,
    "running": 0,
    "failed": 1,
    "completed": 3
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

object

Summary of file processing status.

data.total

integer

The total number of files in the task.

data.pending

integer

Number of files to be processed. and running are both 0, this processing has ended.

data.running

integer

The number of files being exported.

data.failed

integer

The number of files that failed to export. When it is 0 and the processing has ended, it means that all files are successful.

data.completed

integer

The number of files that have been successfully completed.

Error response

When the query fails, HTTP 200 may still be returned, but the code in the response is ErrServer and the data is null. Both the HTTP status and the business code must be checked, and the status count can only be read when the code is OK.

The following are common error responses. This response may also be received when the task does not exist, but it cannot be judged that the task does not exist based on ErrServer or the error message alone. First check the workspace and task ID, and then use Export task list to find readable tasks. Check the status after confirming the target task. When the target is confirmed but the query still fails, retain the HTTP status, business code, and request time, and contact support.

JSON
{
  "code": "ErrServer",
  "msg": "服务器内部错误",
  "data": null
}

Field

Type

Description

code

string

error code.

msg

string

Readable error message.

data

null

The error response is null.

Last updated on