Querying a System Task
Function
This API is used to query details about asynchronous tasks.
URI
- Parameter description
Table 1 URI parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID. For details about how to obtain a project ID, see Project ID and Account ID.
task_id
Yes
String
Task ID.
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
workspace |
No |
String |
Workspace ID.
|
Response
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
Yes |
String |
Task ID. |
name |
Yes |
String |
Name of the task. |
startTime |
Yes |
Long |
Start time. |
endTime |
No |
Long |
End time. |
lastUpdate |
Yes |
Long |
Time when the task was last updated. |
status |
Yes |
String |
Task status.
|
message |
No |
String |
Task information. |
subtasks |
No |
List<SubTask> |
Subtask. For details, see Table 4. |
Example 1
After the solution is imported successfully, query the task information.
- Request
GET /v1/b384b9e9ab9b4ee8994c8633aabc9505/system-tasks/008aae2e675d3bcb01675d3c66f20000
- Response
{ { "endTime":1543457514000, "id":"008aae2e675d3bcb01675d3c66f20000", "lastUpdate":1543457514000, "name": "Import the solution from OBS path obs://aaaaa/traffic.zip.", "projectId":"b384b9e9ab9b4ee8994c8633aabc9505", "startTime":1543457499000, "status":"SUCCESSFUL", "subtasks":[ { "id":"008aae2e675d3bcb01675d3c9f5f0002", "lastUpdate":1543457513000, "name": "Import the job_batch job.", "status":"SUCCESSFUL", "taskId":"008aae2e675d3bcb01675d3c66f20000" }, { "id":"008aae2e675d3bcb01675d3c9fdc0003", "lastUpdate":1543457513000, "name": "Import the job_stream job.", "status":"SUCCESSFUL", "taskId":"008aae2e675d3bcb01675d3c66f20000" } ] }
Example 2
After the solution fails to be imported, query the task information.
- Request
GET /v1/b384b9e9ab9b4ee8994c8633aabc9505/systemTasks/008aae2e675d3bcb01675d3e6b960004
- Response
{ "endTime":1543457631000, "id":"008aae2e675d3bcb01675d3e6b960004", "lastUpdate":1543457631000, "message": "Failed to read the OBS file obs://aaaaa/traffic2.zip. " "name": "Import the solution from OBS path obs://aaaaa/traffic2.zip.", "projectId":"b384b9e9ab9b4ee8994c8633aabc9505", "startTime":1543457631000, "status":"FAILED", "subtasks":[] }
Example 3
Query the task for starting a solution.
- Request
GET /v1/b384b9e9ab9b4ee8994c8633aabc9505/systemTasks/008aae2e675d3bcb01675d40ab3f0005
- Response
{ "endTime":1543457794000, "id":"008aae2e675d3bcb01675d40ab3f0005", "lastUpdate":1543457794000, "name":"Start the traffic solution", "projectId":"b384b9e9ab9b4ee8994c8633aabc9505", "startTime":1543457778000, "status":"FAILED", "subtasks":[ { "id":"008aae2e675d3bcb01675d40e8560006", "lastUpdate":1543457794000, "name": "Start the job_batch job", "status":"FAILED", "taskId":"008aae2e675d3bcb01675d40ab3f0005" } ] }
Example 4
Query the task for exporting a job.
- Request
GET /v1/b384b9e9ab9b4ee8994c8633aabc9505/systemTasks/008aae2e675d3bcb01675d40ab3f0005
- Response
{ "endTime": 1544777083000, "id": "008aae2e67abe2ff0167abe3a28f0000", "lastUpdate": 1544777083000, "name": "Import the job from obs://aaaaa/job_batch.zip.", "projectId": "b384b9e9ab9b4ee8994c8633aabc9505", "startTime": 1544777081000, "status": "SUCCESSFUL", "subtasks": [{ "id": "008aae2e67abe2ff0167abe3a7e70002", "lastUpdate": 1544777083000, "name": "Import the job_batch job.", "status": "SUCCESSFUL", "taskId": "008aae2e67abe2ff0167abe3a28f0000" }] }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot