Queries a list of tasks by page. You can also specify filter conditions to query tasks.
Debugging
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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| dataworks:* | get | *Task acs:dataworks:{#regionId}:{#accountId}:task/* |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ProjectEnv | string | No | The workspace environment. Valid values:
| Prod |
| ProjectId | long | Yes | The workspace ID. | 100 |
| Name | string | No | The name of the task. Fuzzy match is supported. | SQL node |
| Ids | array | No | The ID of the task. | |
| long | No | The account ID of the owner of the task. | 1234 | |
| Owner | string | No | The account ID of the task owner. | 1000 |
| TaskType | string | No | The type of the task. Valid values:
| ODPS_SQL |
| RuntimeResource | string | No | The information about the resource group. Set this parameter to the ID of a resource group for scheduling. | S_res_group_524258031846018_1684XXXXXXXXX |
| WorkflowId | long | No | The ID of the workflow to which the task belongs. | 1234 |
| TriggerType | string | No | The trigger type. Valid values:
| Scheduler |
| TriggerRecurrence | string | No | The run mode when triggered. Valid only if TriggerType is Scheduler. Valid values:
| Normal |
| SortBy | string | No | The field that is used to sort tasks. This parameter is configured in the format of "Sorting field Sorting order". You can set the sorting order to Desc or Asc. If you do not specify the sorting order, Asc is used by default. Valid values:
| Id Desc |
| PageSize | integer | No | The number of entries per page. Default value: 10. | 10 |
| PageNumber | integer | No | The page number. Pages start from page 1. Default value: 1. | 1 |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX\n",
"PagingInfo": {
"TotalCount": 100,
"PageSize": 10,
"PageNumber": 1,
"Tasks": [
{
"Name": "SQL node",
"Description": "test\n",
"WorkflowId": 1234,
"InstanceMode": "T+1",
"Type": "ODPS_SQL",
"BaselineId": 1234,
"Priority": 1,
"Timeout": 3600,
"RerunMode": "AllAllowed\n",
"RerunTimes": 3,
"RerunInterval": 60,
"Trigger": {
"Type": "Scheduler\n",
"Recurrence": "Normal\n",
"Cron": "00 00 00 * * ?",
"StartTime": "1970-01-01 00:00:00\n",
"EndTime": "9999-01-01 00:00:00\n"
},
"RuntimeResource": {
"ResourceGroupId": "S_res_group_524258031846018_1684XXXXXXXXX",
"Image": "i-xxxxxx\n",
"Cu": 0.25
},
"DataSource": {
"Name": "mysql_test\n"
},
"Id": 1234,
"ProjectId": 100,
"ProjectEnv": "Prod",
"Owner": 1000,
"CreateTime": 1710239005403,
"ModifyTime": 1710239005403,
"CreateUser": 1000,
"ModifyUser": 1000,
"ScriptParameters": "para1=$bizdate para2=$[yyyymmdd] "
}
]
}
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-11-25 | API Description Update | View Change Details |
| 2025-01-21 | The response structure of the API has changed | View Change Details |
| 2025-01-15 | The request parameters of the API has changed | View Change Details |
| 2025-01-06 | The response structure of the API has changed | View Change Details |
| 2024-11-20 | The response structure of the API has changed | View Change Details |
