Query task details

Read the definition and current status of an import task. After creating, pausing, resuming, or retrying, you can use this interface to confirm whether the task has entered the expected state.

HTTP
GET $CLOUDSIGMA_API_BASE/task/get?task_id=$TASK_ID

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. Prepare personal access token, target workspace ID and task ID that can access the target workspace.

Query parameters

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

Shell
curl "$CLOUDSIGMA_API_BASE/task/get?task_id=$TASK_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Type

Required

Description

task_id

string

Yes

The import task ID to view.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "task": {
      "id": "task_01",
      "name": "import_orders",
      "config_type": 1,
      "source_connector_id": "conn_01",
      "connector_name": "orders_s3",
      "volume_id": "vol_01",
      "status": 1,
      "total_rows": 100,
      "imported_rows": 0
    }
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.task

object

Task definition and current processing status. For the meaning of the fields, see Import task return field.

data.task.id

string

Task ID.

data.task.name

string

Task name.

data.task.config_type

integer

Task configuration type.

data.task.source_connector_id

string

Source connector ID.

data.task.connector_name

string

Source connector name.

data.task.volume_id

string

Target volume ID.

data.task.status

integer

Current task status.

data.task.total_rows

integer

The cumulative number of rows to be processed.

data.task.imported_rows

integer

The cumulative number of imported rows.

Error response

Some deployments may return HTTP 200 and the following generic errors when querying for non-existent tasks. HTTP 200 does not mean that the task has been read. You must confirm that the code in the response is OK and contains data.task before reading the task status.

ErrServer may also be caused by a service failure. It cannot be judged that the task does not exist based only on the business code or error message. First check the workspace and task ID, and then use Import task list to find readable tasks. If the details return 404, check the target before calling. If 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