Consulta uma lista de tarefas por página. Você também pode especificar condições de filtro para consultar tarefas.
Descrição da operação
É necessário o DataWorks Basic Edition ou superior.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
dataworks:* |
get |
*Task
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| ProjectEnv |
string |
Não |
O ambiente do workspace. Valores válidos:
Valores válidos:
|
Prod |
| ProjectId |
integer |
Sim |
O ID do workspace. |
100 |
| Name |
string |
Não |
O nome da tarefa. A correspondência aproximada é suportada. |
SQL node |
| Ids |
array |
Não |
O ID da tarefa. |
|
|
integer |
Não |
O ID da conta do proprietário da tarefa. |
1234 |
|
| Owner |
string |
Não |
O ID da conta do proprietário da tarefa. |
1000 |
| TaskType |
string |
Não |
O tipo da tarefa. Valores válidos:
|
ODPS_SQL |
| RuntimeResource |
string |
Não |
As informações sobre o grupo de recursos. Defina este parâmetro como o ID de um grupo de recursos para agendamento. |
S_res_group_524258031846018_1684XXXXXXXXX |
| WorkflowId |
integer |
Não |
O ID do workflow ao qual a tarefa pertence. |
1234 |
| TriggerType |
string |
Não |
O tipo de acionamento. Valores válidos:
Valores válidos:
|
Scheduler |
| TriggerRecurrence |
string |
Não |
O modo de execução quando acionado. Válido apenas se TriggerType for Scheduler. Valores válidos:
Valores válidos:
|
Normal |
| SortBy |
string |
Não |
O campo usado para ordenar as tarefas. Este parâmetro é configurado no formato "Campo de ordenação Ordem de classificação". Você pode definir a ordem de classificação como Desc ou Asc. Se você não especificar a ordem de classificação, Asc será usado por padrão. Valores válidos:
|
Id Desc |
| PageSize |
integer |
Não |
O número de entradas por página. Valor padrão: 10. |
10 |
| PageNumber |
integer |
Não |
O número da página. As páginas começam a partir da página 1. Valor padrão: 1. |
1 |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
ResultModel. |
||
| RequestId |
string |
O ID da solicitação. |
22C97E95-F023-56B5-8852-B1A77A17XXXX |
| PagingInfo |
object |
As informações de paginação. |
|
| TotalCount |
integer |
O número total de entradas retornadas. |
100 |
| PageSize |
integer |
O número de entradas por página. |
10 |
| PageNumber |
integer |
O número da página. |
1 |
| Tasks |
array<object> |
As tarefas. |
|
|
array<object> |
|||
| Name |
string |
The name of the task. |
SQL node |
| Description |
string |
The description of the task. |
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 type of the task. |
ODPS_SQL |
| BaselineId |
integer |
The baseline ID. |
1234 |
| Priority |
integer |
The priority of the task. Valid values: 1 to 8. A larger value indicates a higher priority. Default value: 1. |
1 |
| Timeout |
integer |
The timeout period of task running. Unit: seconds. |
3600 |
| RerunMode |
string |
The rerun mode. Valid values:
Valores válidos:
|
AllAllowed |
| RerunTimes |
integer |
The number of times that the task is rerun. This parameter takes effect only if the RerunMode parameter is set to AllAllowed or FailureAllowed. |
3 |
| RerunInterval |
integer |
The rerun interval. Unit: seconds. |
60 |
| Trigger |
object |
The method to trigger task scheduling. |
|
| Type |
string |
The trigger type. Valid values:
Valores válidos:
|
Scheduler |
| Recurrence |
string |
The running mode of the task after it is triggered. This parameter takes effect only if the Type parameter is set to Scheduler. Valid values:
Valores válidos:
|
Normal |
| Cron |
string |
The CRON expression of the task. This parameter takes effect only if the Type parameter is set to Scheduler. |
00 00 00 * * ? |
| StartTime |
string |
The start time of the time range during which the task is periodically scheduled. This parameter takes effect only if the Type parameter is set to Scheduler. |
1970-01-01 00:00:00 |
| EndTime |
string |
The end time of the time range during which the task is periodically scheduled. This parameter takes effect only if the Type parameter is set to Scheduler. |
9999-01-01 00:00:00 |
| RuntimeResource |
object |
The configurations of the runtime environment, such as the resource group information. |
|
| ResourceGroupId |
string |
The ID of the resource group for scheduling configured for task running. |
S_res_group_524258031846018_1684XXXXXXXXX |
| Image |
string |
The ID of the image configured for task running. |
i-xxxxxx |
| Cu |
string |
The default number of compute units (CUs) configured for task running. |
0.25 |
| DataSource |
object |
The information about the associated data source. |
|
| Name |
string |
The name of the data source. |
mysql_test |
| Id |
integer |
The task ID. |
1234 |
| ProjectId |
integer |
The workspace ID. |
100 |
| ProjectEnv |
string |
The environment of the workspace. Valid values:
Valores válidos:
|
Prod |
| Owner |
string |
The account ID of the task owner. |
1000 |
| CreateTime |
integer |
The creation time. |
1710239005403 |
| ModifyTime |
integer |
The modification time. |
1710239005403 |
| CreateUser |
string |
The account ID of the creator. |
1000 |
| ModifyUser |
string |
The account ID of the modifier. |
1000 |
| ScriptParameters |
string |
The list of script parameters. |
para1=$bizdate para2=$[yyyymmdd] |
Exemplos
Resposta de sucesso
JSON formato
{
"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] "
}
]
}
}
Códigos de erro
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.