Lists tasks by conditions such as time range or tag.
Operation description
Before you call this operation, familiarize yourself with IMM billing.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
imm:ListTasks |
list |
*Project
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectName |
string |
Yes |
|
test-project |
| TaskTypes |
array |
No |
The task types. |
|
|
string |
No |
The task type. Valid values are listed in Task types. |
["OfficeConversion","VideoLabelClassification"] |
|
| NextToken |
string |
No |
The pagination token that retrieves the next page of results. If results exceed MaxResults, use the returned NextToken value in the next request. The next call to the operation returns results lexicographically after the NextToken parameter value. Note
Leave empty for the first request. |
MTIzNDU2Nzg6aW1tdGVzdDpleGFtcGxlYnVja2V0OmRhdGFzZXQwMDE6b3NzOi8vZXhhbXBsZWJ1Y2tldC9zYW1wbGVvYmplY3QxLmpwZw== |
| MaxResults |
integer |
No |
The maximum number of results to return. Valid value range: (0, 100]. Default value: 100. |
1 |
| TagSelector |
string |
No |
The custom tags of tasks. |
test=val1 |
| Sort |
string |
No |
The sort field. Valid values:
|
TaskId |
| Order |
string |
No |
The sort order. Valid values:
Valid values:
|
asc |
| Status |
string |
No |
The task status. Valid values:
Valid values:
|
Succeeded |
| StartTimeRange | TimeRange |
No |
The time range for task start time. Only tasks that started within this range are returned. |
|
| EndTimeRange | TimeRange |
No |
The time range for task end time. Only tasks that ended within this range are returned. |
|
| RequestDefinition |
boolean |
No |
Whether to include the original task creation request parameters in the response. Default value: False. |
True |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| RequestId |
string |
The request ID. |
9847E7D0-A9A3-0053-84C6-BA16FFFA726E |
| ProjectName |
string |
The name of the project. |
immtest |
| NextToken |
string |
A pagination token returned only when more results are available. Pass this value in the next request to retrieve the remaining results. |
MTIzNDU2Nzg6aW1tdGVzdDpleGFtcGxlYnVja2V0OmRhdGFzZXQwMDE6b3NzOi8vZXhhbXBsZWJ1Y2tldC9zYW1wbGVvYmplY3QxLmpwZw== |
| MaxResults |
string |
The number of results returned. |
1 |
| Tasks |
array |
The tasks. |
|
| TaskInfo |
The task details. |
Examples
Success response
JSON format
{
"RequestId": "9847E7D0-A9A3-0053-84C6-BA16FFFA726E",
"ProjectName": "immtest",
"NextToken": "MTIzNDU2Nzg6aW1tdGVzdDpleGFtcGxlYnVja2V0OmRhdGFzZXQwMDE6b3NzOi8vZXhhbXBsZWJ1Y2tldC9zYW1wbGVvYmplY3QxLmpwZw==",
"MaxResults": "1",
"Tasks": [
{
"Status": "Running",
"Code": "ResourceNotFound",
"Message": "The specified resource project is not found.",
"StartTime": "2021-12-24T03:01:41.662060377Z",
"EndTime": "2021-12-24T03:01:49.480109219Z",
"UserData": "{\"ID\": \"user1\",\"Name\": \"test-user1\",\"Avatar\": \"http://example.com?id=user1\"}",
"TaskType": "VideoLabelClassification",
"TaskId": "c2b277b9-0d30-4882-ad6d-ad661382****",
"Tags": {
"test": "test",
"test2": 1
},
"TaskRequestDefinition": "{\n\t\"ProjectName\":\"test-project\",\n\t\"CompressedFormat\":\"zip\",\n\t\"TargetURI\":\"oss://test-bucket/output/test.zip\",\n\t\"Sources\":[{\"URI\":\"oss://test-bucket/input/test.jpg\"}]\n}",
"Progress": 0
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.