All Products
Search
Document Center

Data Management:GetTask

Last Updated:Apr 26, 2024

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

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:GetTaskRead
  • All Resources
    *
    none
none

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