ListTasks
Lists tasks with pagination and optional filters.
Operation description
DataWorks Basic Edition or higher is required.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:* |
get |
*Task
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectEnv |
string |
No |
The project environment. Valid values:
|
Prod |
| ProjectId |
integer |
Yes |
The ID of the DataWorks workspace. |
100 |
| Name |
string |
No |
The name. Fuzzy match is supported. |
SQL node |
| Ids |
array |
No |
The list of task IDs. You can use this parameter to query multiple tasks in a batch. |
|
|
integer |
No |
The node ID. |
1234 |
|
| Owner |
string |
No |
The account ID of the task owner. |
1000 |
| TaskType |
string |
No |
The task type. Examples:
|
ODPS_SQL |
| RuntimeResource |
string |
No |
The resource group information. Specify the identifier of the scheduling resource group. |
S_res_group_524258031846018_1684XXXXXXXXX |
| WorkflowId |
integer |
No |
The ID of the workflow to which the task belongs. |
1234 |
| TriggerType |
string |
No |
Filters tasks by trigger type. Valid values:
|
Scheduler |
| TriggerRecurrence |
string |
No |
The running mode upon trigger. This parameter takes effect only when TriggerType is set to Scheduler. Valid values:
|
Normal |
| SortBy |
string |
No |
The sort field. Fields such as modification time and creation time are supported. The format is "Sort field + Sort order (Desc/Asc)" (Asc can be omitted). Valid values for the sort field:
Default value: |
Id Desc |
| PageSize |
integer |
No |
The number of entries per page. Default value: 10. Maximum value: 1000. |
10 |
| PageNumber |
integer |
No |
The page number. Pages start from 1. Default value: 1. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
ResultModel |
||
| RequestId |
string |
The request ID, which is used to locate logs and troubleshoot issues. |
22C97E95-F023-56B5-8852-B1A77A17XXXX |
| PagingInfo |
object |
The pagination information. |
|
| TotalCount |
integer |
The total number of scheduling tasks that match the query conditions. |
100 |
| PageSize |
integer |
The number of entries per page. |
10 |
| PageNumber |
integer |
The page number. |
1 |
| Tasks |
array<object> |
The list of tasks. |
|
|
array<object> |
|||
| Name |
string |
The name. |
SQL node |
| Description |
string |
The description. |
test |
| WorkflowId |
integer |
The ID of the workflow to which the task belongs. |
1234 |
| InstanceMode |
string |
The instance generation mode. Valid values:
|
T+1 |
| Type |
string |
The task type. |
ODPS_SQL |
| BaselineId |
integer |
The baseline ID. |
1234 |
| Priority |
integer |
The task priority. Valid values: 1 to 8. A larger value indicates a higher priority. Default value: 1. |
1 |
| Timeout |
integer |
The task execution timeout period, in seconds. |
3600 |
| RerunMode |
string |
The configuration that specifies whether the task can be rerun. Valid values:
|
AllAllowed |
| RerunTimes |
integer |
The number of retries. This parameter takes effect only when the task is configured to allow reruns. |
3 |
| RerunInterval |
integer |
The retry time interval, in seconds. |
60 |
| Trigger |
object |
The task trigger method. |
|
| Type |
string |
The trigger type. Valid values:
|
Scheduler |
| Recurrence |
string |
The running mode upon triggering. This parameter takes effect only when type is set to Scheduler. Valid values:
|
Normal |
| Cron |
string |
The cron expression. This parameter takes effect only when type is set to Scheduler. |
00 00 00 * * ? |
| StartTime |
string |
The time when periodic triggering starts. This parameter applies only when The format is |
1970-01-01 00:00:00 |
| EndTime |
string |
The expiration time for periodic triggering. This parameter takes effect only when type is set to Scheduler. The format is |
9999-01-01 00:00:00 |
| RuntimeResource |
object |
The runtime environment configuration, such as the resource group information. |
|
| ResourceGroupId |
string |
The identifier of the scheduling resource group configured for task execution. |
S_res_group_524258031846018_1684XXXXXXXXX |
| Image |
string |
The ID of the image configured for task execution. |
i-xxxxxx |
| Cu |
string |
The compute unit (CU) consumption configured for task execution. |
0.25 |
| DataSource |
object |
The associated data source information. |
|
| Name |
string |
The name of the data source. |
mysql_test |
| Id |
integer |
The unique identifier of the task. |
1234 |
| ProjectId |
integer |
The ID of the DataWorks workspace. |
100 |
| ProjectEnv |
string |
The project environment. Valid values:
|
Prod |
| Owner |
string |
The account ID of the task owner. |
1000 |
| CreateTime |
integer |
The creation time of the scheduling task. The value is a UNIX timestamp in milliseconds. |
1710239005403 |
| ModifyTime |
integer |
The last modification time of the scheduling task. The value is a UNIX timestamp in milliseconds. |
1710239005403 |
| CreateUser |
string |
The account ID of the user who created the task. |
1000 |
| ModifyUser |
string |
The account ID of the user who last modified the task. |
1000 |
| ScriptParameters |
string |
The list of script parameters. |
para1=$bizdate para2=$[yyyymmdd] |
Examples
Success response
JSON format
{
"RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX\n",
"PagingInfo": {
"TotalCount": 100,
"PageSize": 10,
"PageNumber": 1,
"Tasks": [
{
"Name": "SQL node\n",
"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
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.