Recupera a configuração de um nó específico em um fluxo de tarefas com base no ID do nó. A configuração inclui as variáveis de tempo da tarefa.
Depuração
Parâmetros da solicitação
| Nome | Tipo | Obrigatório | Exemplo | Descrição |
| Action | String | Sim | GetTask | Parâmetro obrigatório. Defina o valor como GetTask. |
| Tid | Long | Não | 3*** | ID do locatário. Nota Para obter o ID do locatário, passe o ponteiro do mouse sobre sua foto de perfil no canto superior direito do console. Para mais informações, consulte Visualizar informações do locatário. |
| NodeId | Long | Sim | 51*** | ID do nó da tarefa. Chame a operação GetTaskInstanceRelation para obter esse ID. |
Dados retornados
| Nome | Tipo | Exemplo | Descrição |
| RequestId | String | 7838266C-E17B-58F4-B072-4DC356B58258 | ID da solicitação. Use este ID para localizar logs e solucionar problemas. |
| ErrorCode | String | UnknownError | Código de erro. |
| ErrorMessage | String | UnknownError | Mensagem de erro retornada caso a solicitação falhe. |
| Success | Boolean | true | Indica se a solicitação foi bem-sucedida. Valores válidos:
|
| Task | Object | Tarefa no fluxo de tarefas. |
|
| DagId | Long | 7321 | ID do fluxo de tarefas ao qual o nó pertence. |
| NodeName | String | Cross-database Spark SQL-1 | Nome do nó da tarefa. |
| NodeType | String | SPARK_SQL | Tipo do nó da tarefa. Para mais informações sobre os valores válidos, consulte Descrição do parâmetro NodeType. |
| NodeContent | String | {\"dbList\":[{\"instanceId\":177****}" } | Configuração do nó. |
| TimeVariables | String | {\"variables\":[{\"name\":\"Today\",\"pattern\":\"yyyy-MM-dd|+1d\"}]} | Variáveis de tempo do nó. |
| NodeConfig | String | {\"dbId\":39****,\"dbType\":\"mysql\",\"locale\":\"zh\",\"sql\":\"/* Make sure that the following SQL statements meet your change requirements before submitting them for execution. */\\n\\nCREATE TABLE IF NOT EXISTS `momo_weekGather` (\\n\\t`id` bigint AUTO_INCREMENT DEFAULT '0',\\n\\t`age` bit NULL,\\n\\t`action` varchar(150) NULL,\\n\\t`elapse_time` datetime NULL,\\n\\tPRIMARY KEY (`id`)\\n) ENGINE=InnoDB\\nDEFAULT CHARACTER SET=utf8;\"} | Configuração avançada do nó. |
| NodeOutput | String | { "outputs":[ "extractMethod":"json" , "variableName":"var", "description":"demo desc" } ] } | Variáveis de saída do nó. Retornado apenas para alguns tipos de nós. |
| GraphParam | String | {"{\"x\":0,\"y\":0,\"layoutType\":\"Horizontal\"}", "id": 51***} | Posição do nó no gráfico. |
O parâmetro TimeVariables é uma string JSON. O código a seguir apresenta um exemplo dessa string e descreve seu formato:
JSON
{
"variables":[
{
"name":"var",// The name of the variable
/*
Variable format. As shown in the example, the date can have one or more offsets, including minutes (m), hours (h), days (d), weeks (w), months (M), or years (y). The offsets are optional, and you can specify the offsets in a different order than described here.
*/
"pattern":"yyyy-MM-dd|+0d"
},
{
"name":"test",
"pattern":"yyyy-MM-dd|+0d"
}
]
}
Exemplos
Exemplo de solicitação
http(s)://dms-enterprise.aliyuncs.com/?Action=GetTask
&NodeId=51***
&Common request parameters
Exemplo de resposta
Formato XML
HTTP/1.1 200 OK
Content-Type:application/xml
<GetTaskResponse>
<Task>
<NodeName>Cross-database Spark SQL-1</NodeName>
<NodeType>SPARK_SQL</NodeType>
<DagId>73***</DagId>
<NodeContent>{"dbId":39****,"dbType":"mysql","locale":"zh","sql":"\n\nCREATE TABLE IF NOT EXISTS `momo_weekGather` (\n\t`id` bigint AUTO_INCREMENT DEFAULT '0',\n\t`age` bit NULL,\n\t`action` varchar(150) NULL,\n\t`elapse_time` datetime NULL,\n\tPRIMARY KEY (`id`)\n) ENGINE=InnoDB\nDEFAULT CHARACTER SET=utf8;"}</NodeContent>
<NodeConfig>{"rerun":{"rerunEnable":false}}</NodeConfig>
<GraphParam>{"x":0,"y":0,"layoutType":"Horizontal"}</GraphParam>
</Task>
<RequestId>7838266C-E17B-58F4-B072-4DC356B58258</RequestId>
<Success>true</Success>
</GetTaskResponse>
Formato JSON
HTTP/1.1 200 OK
Content-Type:application/json
{
"Task" : {
"NodeName" : "Cross-database Spark SQL-1",
"NodeType" : "SPARK_SQL",
"DagId" : "73***",
"NodeContent" : "{\"dbId\":39****,\"dbType\":\"mysql\",\"locale\":\"zh\",\"sql\":\"\\n\\nCREATE TABLE IF NOT EXISTS `momo_weekGather` (\\n\\t`id` bigint AUTO_INCREMENT DEFAULT '0',\\n\\t`age` bit NULL,\\n\\t`action` varchar(150) NULL,\\n\\t`elapse_time` datetime NULL,\\n\\tPRIMARY KEY (`id`)\\n) ENGINE=InnoDB\\nDEFAULT CHARACTER SET=utf8;\"}",
"NodeConfig" : "{\"rerun\":{\"rerunEnable\":false}}",
"GraphParam" : "{\"x\":0,\"y\":0,\"layoutType\":\"Horizontal\"}"
},
"RequestId" : "7838266C-E17B-58F4-B072-4DC356B58258",
"Success" : true
}
Códigos de erro
Para obter uma lista de códigos de erro, visite o Error Center.