All Products
Search
Document Center

Data Management:GetTask

Last Updated:Oct 21, 2024

Queries the configurations, including time variables, of a specified task node based on the task node ID.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TidlongNo

The ID of the tenant.

Note : To view the ID of the tenant, go to the Data Management (DMS) console and move the pointer over the profile picture in the upper-right corner. For more information, see View information about the current tenant.
3***
NodeIdlongYes

The ID of the task node. You can call the GetTaskInstanceRelation operation to query the node ID.

51***

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request. You can use the ID to query logs and troubleshoot issues.

7838266C-E17B-58F4-B072-4DC356B58258
ErrorCodestring

The error code returned if the request failed.

UnknownError
ErrorMessagestring

The error message returned if the request failed.

UnknownError
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true
Taskobject

The task node.

DagIdlong

The ID of the task flow to which the node belongs.

7321
NodeNamestring

The name of the node.

Cross-database Spark SQL-1
NodeTypestring

The type of the node. For more information about the valid values for this parameter, see NodeType parameter.

SPARK_SQL
NodeContentstring

The configuration for the node.

{\"dbList\":[{\"instanceId\":177****}" }
TimeVariablesstring

The time variables configured for the node.

{\"variables\":[{\"name\":\"Today\",\"pattern\":\"yyyy-MM-dd|+1d\"}]}
NodeConfigstring

The advanced configuration for the node.

{\\"dbId\\":39\*\*\*\*,\\"dbType\\":\\"mysql\\",\\"locale\\":\\"zh\\",\\"sql\\":\\"/\* Make sure that the following SQL statements meet your business requirements before submitting the SQL statements 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;\\"}
NodeOutputstring

The output variables for the node. This parameter is available only for some types of nodes.

{ "outputs":[ "extractMethod":"json" , "variableName":"var", "description":"demo desc" } ] }
GraphParamstring

The position of the node on the Directed Acyclic Graph (DAG).

{"{\"x\":0,\"y\":0,\"layoutType\":\"Horizontal\"}", "id": 51***}

The value of TimeVariables is a JSON string. The following section provides an example of the TimeVariables value and describes the variables:

{
    "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"
        }
    ]
}

Examples

Sample success responses

JSONformat

{
  "RequestId": "7838266C-E17B-58F4-B072-4DC356B58258",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "Success": true,
  "Task": {
    "DagId": 7321,
    "NodeName": "Cross-database Spark SQL-1\n",
    "NodeType": "SPARK_SQL",
    "NodeContent": "{\\\"dbList\\\":[{\\\"instanceId\\\":177****}\"   }",
    "TimeVariables": "{\\\"variables\\\":[{\\\"name\\\":\\\"Today\\\",\\\"pattern\\\":\\\"yyyy-MM-dd|+1d\\\"}]}",
    "NodeConfig": "{\\\\\"dbId\\\\\":39\\*\\*\\*\\*,\\\\\"dbType\\\\\":\\\\\"mysql\\\\\",\\\\\"locale\\\\\":\\\\\"zh\\\\\",\\\\\"sql\\\\\":\\\\\"/\\* Make sure that the following SQL statements meet your business requirements before submitting the SQL statements 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;\\\\\"}\n",
    "NodeOutput": "{ \"outputs\":[ \"extractMethod\":\"json\" , \"variableName\":\"var\",   \"description\":\"demo desc\" } ] }",
    "GraphParam": "{\"{\\\"x\\\":0,\\\"y\\\":0,\\\"layoutType\\\":\\\"Horizontal\\\"}\",  \"id\": 51***}"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history