Consulta uma lista de instâncias. Você também pode especificar condições de filtro para consultar instâncias específicas.
Descrição da operação
Você deve adquirir o DataWorks Basic Edition ou uma edição superior para usar este recurso.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
dataworks:ListTaskInstances |
get |
*TaskInstance
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| ProjectId |
integer |
Sim |
O ID do espaço de trabalho do DataWorks. |
100 |
| Bizdate |
integer |
Sim |
O timestamp dos dados. O valor deste parâmetro é 00:00:00 do dia anterior ao horário de agendamento da instância. O valor é um timestamp UNIX. Unidade: milissegundos. Exemplo: 1743350400000. |
1710239005403 |
| TaskId |
integer |
Não |
O ID da tarefa para a qual a instância é gerada. |
1234 |
| TaskIds |
array |
Não |
Os IDs das tarefas. Você pode consultar várias instâncias por vez por ID de tarefa. |
|
|
integer |
Não |
O ID da tarefa. |
1234 |
|
| TaskName |
string |
Não |
O nome da tarefa. Há suporte para correspondência aproximada. |
SQL node |
| Owner |
string |
Não |
O ID da conta do proprietário da tarefa. |
1000 |
| TaskType |
string |
Não |
O tipo da tarefa para a qual a instância é gerada. |
ODPS_SQL |
| RuntimeResource |
string |
Não |
As informações sobre o grupo de recursos. Defina este parâmetro como o identificador de um grupo de recursos para agendamento. |
S_res_group_524258031846018_1684XXXXXXXXX |
| WorkflowId |
integer |
Não |
O ID do fluxo de trabalho ao qual a instância pertence. |
1234 |
| UnifiedWorkflowInstanceId |
integer |
Não |
O ID da instância de fluxo de trabalho unificada. Para todas as instâncias de tarefa sob um timestamp de dados específico dentro de um único gatilho, este campo tem o mesmo valor. |
1234 |
| WorkflowInstanceType |
string |
Não |
O tipo da instância de fluxo de trabalho. Valores válidos:
|
Normal |
| WorkflowInstanceId |
integer |
Não |
O ID da instância de fluxo de trabalho. |
1234 |
| ProjectEnv |
string |
Não |
O ambiente do espaço de trabalho. Valores válidos:
|
Prod |
| Id |
integer |
Não |
O ID da instância. A instância pode ser reexecutada. Se a instância for reexecutada e você configurar este parâmetro, o sistema retornará as informações históricas da instância, incluindo as informações de reexecução. Você pode usar o parâmetro RunNumber para distinguir cada entrada nas informações históricas. |
1234 |
| Ids |
array |
Não |
Os IDs das instâncias. Você pode consultar várias instâncias por vez por ID de instância. |
|
|
integer |
Não |
O ID da instância. |
1234 |
|
| TriggerType |
string |
Não |
O tipo de gatilho. Valores válidos:
|
Normal |
| TriggerRecurrence |
string |
Não |
O modo de execução da instância após ser acionada. Este parâmetro só entra em vigor se o parâmetro TriggerType estiver definido como Scheduler. Valores válidos:
|
Normal |
| SortBy |
string |
Não |
O campo usado para classificação. Há suporte para campos como TriggerTime e StartedTime. O valor deste parâmetro está no formato Campo de classificação + Classificar por (Desc/Asc). Por padrão, os resultados são classificados em ordem crescente. 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 na página 1. Valor padrão: 1. |
1 |
| Status |
string |
Não |
O status da instância da tarefa.
|
Success |
| Filter |
string |
Não |
O filtro. Está no formato JSON e várias condições de filtro são combinadas com um AND lógico. Os campos com suporte atualmente incluem: startedTimeStart, startedTimeEnd, finishedTimeStart, finishedTimeEnd, createTimeStart, createTimeEnd. |
{ "startedTimeStart": "1763481600000", "startedTimeEnd": "1763481600000", "finishedTimeStart": "1763481600000", "finishedTimeEnd": "1763481600000", "createTimeStart": "1763481600000", "createTimeEnd": "1763481600000" } |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| RequestId |
string |
O ID da solicitação. |
22C97E95-F023-56B5-8852-B1A77A17XXXX |
| PagingInfo |
object |
Informações de paginação. |
|
| TaskInstances |
array<object> |
A lista de instâncias de tarefa. |
|
|
array<object> |
|||
| TaskId |
integer |
The ID of the task for which the instance is generated. |
1234 |
| TaskType |
string |
The type of the task for which the instance is generated. |
ODPS_SQL |
| TaskName |
string |
The name of the task for which the instance is generated. |
SQL node |
| Description |
string |
The description. |
test |
| WorkflowId |
integer |
The ID of the workflow to which the instance belongs. |
1234 |
| WorkflowName |
string |
The name of the workflow to which the instance belongs. |
Test workflow |
| TriggerType |
string |
The trigger type. Valid values:
|
Scheduler |
| TriggerRecurrence |
string |
The running mode of the instance after it is triggered. This parameter takes effect only if the TriggerType parameter is set to Scheduler. Valid values:
|
Normal |
| WorkflowInstanceId |
integer |
The workflow instance ID. |
1234 |
| UnifiedWorkflowInstanceId |
integer |
Unified workflow instance ID. All task instances triggered under the same data timestamp share the same value for this field. |
1234 |
| WorkflowInstanceType |
string |
The type of the workflow instance. Valid values:
|
Normal |
| Timeout |
integer |
The timeout period of task running. Unit: seconds. Note: The value of this parameter is rounded up by hour. |
3600 |
| RerunMode |
string |
The rerun mode Valid values:
|
AllAllowed |
| RunNumber |
integer |
The number of times the task is run. By default, the value starts from 1. |
1 |
| PeriodNumber |
integer |
The sequence number of the cycle. This parameter indicates the cycle of the task instance on the current day. |
1 |
| BaselineId |
integer |
The baseline ID. |
1234 |
| Priority |
integer |
The priority of the task. Minimum value: 1. Maximum value: 8. A larger value indicates a higher priority. Default value: 1. |
1 |
| RuntimeResource |
object |
The information about the resource group with which the instance is associated. |
|
| 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 CUs configured for task running. |
0.25 |
| Runtime |
object |
The runtime information about the instance. |
|
| ProcessId |
string |
The instance run ID. |
T3_123 |
| Gateway |
string |
The host for running. |
cn-shanghai.1.2 |
| DataSource |
object |
The information about the associated data source. |
|
| Name |
string |
The name of the data source. |
mysql_test |
| Status |
string |
The status of the instance. Valid values:
|
Success |
| TriggerTime |
integer |
The scheduling time. |
1710239005403 |
| Bizdate |
integer |
The data timestamp. |
1710239005403 |
| StartedTime |
integer |
The time when the instance started to run. |
1710239005403 |
| FinishedTime |
integer |
The time when the instance finished running. |
1710239005403 |
| Id |
integer |
The instance ID. |
1234 |
| ProjectId |
integer |
The DataWorks workspace ID. |
100 |
| ProjectEnv |
string |
The environment of the workspace. Valid values:
|
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 user who creates the instance. |
1000 |
| ModifyUser |
string |
The account ID of the user who modifies the instance. |
1000 |
| ScriptParameters |
string |
The script parameter list. |
para1=val1 para2=val2 |
| WaitingResourceTime |
integer |
The timestamp for when it started waiting for resources. |
1710239005403 |
| WaitingTriggerTime |
integer |
The timestamp for when it started waiting for the scheduled time. |
1710239005403 |
| 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 |
Exemplos
Resposta de sucesso
JSON formato
{
"RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
"PagingInfo": {
"TaskInstances": [
{
"TaskId": 1234,
"TaskType": "ODPS_SQL\n",
"TaskName": "SQL node\n",
"Description": "test\n",
"WorkflowId": 1234,
"WorkflowName": "Test workflow\n",
"TriggerType": "Scheduler\n",
"TriggerRecurrence": "Normal\n",
"WorkflowInstanceId": 1234,
"UnifiedWorkflowInstanceId": 1234,
"WorkflowInstanceType": "Normal",
"Timeout": 3600,
"RerunMode": "AllAllowed\n",
"RunNumber": 1,
"PeriodNumber": 1,
"BaselineId": 1234,
"Priority": 1,
"RuntimeResource": {
"ResourceGroupId": "S_res_group_524258031846018_1684XXXXXXXXX",
"Image": "i-xxxxxx\n",
"Cu": "0.25\n"
},
"Runtime": {
"ProcessId": "T3_123\n",
"Gateway": "cn-shanghai.1.2\n"
},
"DataSource": {
"Name": "mysql_test\n"
},
"Status": "Success",
"TriggerTime": 1710239005403,
"Bizdate": 1710239005403,
"StartedTime": 1710239005403,
"FinishedTime": 1710239005403,
"Id": 1234,
"ProjectId": 100,
"ProjectEnv": "Prod",
"Owner": "1000",
"CreateTime": 1710239005403,
"ModifyTime": 1710239005403,
"CreateUser": "1000",
"ModifyUser": "1000",
"ScriptParameters": "para1=val1 para2=val2",
"WaitingResourceTime": 1710239005403,
"WaitingTriggerTime": 1710239005403
}
],
"TotalCount": 100,
"PageSize": 10,
"PageNumber": 1
}
}
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.