All Products
Search
Document Center

Intelligent Media Management:ListTasks

Last Updated:Dec 11, 2024

Lists tasks based on specific conditions, such as by time range and by tag.

Operation description

Before you call this operation, make sure that you are familiar with the billing of Intelligent Media Management (IMM).

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
imm:ListTaskslist
*Project
acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectNamestringYes

The name of the project.

test-project
TaskTypesarrayNo

The task types.

stringNo

The task type. For more information, see Task types.

["OfficeConversion","VideoLabelClassification"]
NextTokenstringNo

The pagination token.

The pagination token is used in the next request to retrieve a new page of results if the total number of results exceeds the value of the MaxResults parameter. The next call to the operation returns results lexicographically after the NextToken parameter value.

Note Leave this parameter empty in your first call to the operation.
MTIzNDU2Nzg6aW1tdGVzdDpleGFtcGxlYnVja2V0OmRhdGFzZXQwMDE6b3NzOi8vZXhhbXBsZWJ1Y2tldC9zYW1wbGVvYmplY3QxLmpwZw==
MaxResultslongNo

The maximum number of results to return. Valid value range: (0, 100]. Default value: 100.

1
TagSelectorstringNo

The custom tags of tasks.

test=val1
SortstringNo

The field used to sort the results by. Valid values:

  • TaskId: sorts the results by task ID. This is the default sort field.
  • StartTime: sorts the results by task start time.
  • StartTime: sorts the results by task end time.
TaskId
OrderstringNo

The sort order. Valid values:

  • ASC: sorts the results in ascending order. This is the default sort order.
  • DES: sorts the results in descending order.
ASC
StatusstringNo

The task status. Valid values:

  • Running: The task is running.
  • Succeeded: The task is successful.
  • Failed: The task failed.
Succeeded
StartTimeRangeTimeRangeNo

The range of task start time. You can specify this parameter to filter tasks that start within the specified range.

EndTimeRangeTimeRangeNo

The range of task end time. You can specify this parameter to filter tasks that end within the specified range.

RequestDefinitionbooleanNo

Specifies whether to return request parameters in the initial request to create the task. Default value: False.

True

Response parameters

ParameterTypeDescriptionExample
object

The tasks.

RequestIdstring

The request ID.

9847E7D0-A9A3-0053-84C6-BA16FFFA726E
ProjectNamestring

The name of the project.

immtest
NextTokenstring

The pagination token. The pagination token is used in the next request to retrieve a new page of results if the total number of results exceeds the value of the MaxResults parameter. This parameter has a value only when not all results are returned.

You can specify the value of the NextToken parameter in the next request to list remaining results.

MTIzNDU2Nzg6aW1tdGVzdDpleGFtcGxlYnVja2V0OmRhdGFzZXQwMDE6b3NzOi8vZXhhbXBsZWJ1Y2tldC9zYW1wbGVvYmplY3QxLmpwZw==
MaxResultsstring

The length of the returned result list.

1
Tasksarray

The tasks.

TasksTaskInfo

The details of the task.

Examples

Sample success responses

JSONformat

{
  "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": "",
      "Progress": 0
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-05-11The request parameters of the API has changedView Change Details