Query task status¶
Read the status summary of the export task.
GET https://moi.matrixorigin.cn/newmoi/export/task/$TASK_ID/state
Preparation before calling¶
First Query task details to confirm the export task whose status you want to view. Prepare a personal access token with access to the target workspace, the target workspace ID, and the export task ID.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$TASK_ID: To view the status of the exported task ID, fill in the task ID position in the request address.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/export/task/$TASK_ID/state" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The export task ID whose status is to be queried. |
Successful response¶
Returns 200 on success. data only provides an aggregate count of file processing status; pending, running and failed must be checked, HTTP success cannot be considered export completion.
{
"code": "OK",
"msg": "OK",
"data": {
"total": 4,
"pending": 0,
"running": 1,
"failed": 1,
"completed": 2
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
integer |
The total number of files in the task. |
|
integer |
Number of files to be processed. |
|
integer |
The number of files being exported. |
|
integer |
The number of files that failed to export. |
|
integer |
Number of files that have been successfully completed. |
Error response¶
{
"code": "ErrServer",
"msg": "Internal server error",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The task does not exist or the status statistics reading fails. |
Check |
|
|
The current identity does not have permission to read the task. |
Request that read permission be granted to the export task. |
Follow-up operations¶
When there are still files waiting or being processed, continue to query this interface with the same task ID. The export is complete when both the waiting and processing quantities are 0 and there are no failures. When there is a failure, Query export files locates the failed item, and if necessary, Rerun task.