tencent cloud

文档反馈

DescribeTasks

最后更新时间:2023-09-19 11:26:18

1. API Description

Domain name for API request: dlc.tencentcloudapi.com.

This API is used to query the list of tasks.

A maximum of 500 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeTasks.
Version Yes String Common Params. The value used for this API: 2021-01-25.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Limit No Integer Number of returned results. Default value: 10. Maximum value: 100.
Offset No Integer Offset. Default value: 0.
Filters.N No Array of Filter Filter. The following filters are supported, and the Name input parameter must be one of them. Up to 50 task-id values can be filtered, while up to 5 other parameters can be filtered in total.
task-id - String - (filter by task ID). task-id format: e386471f-139a-4e59-877f-50ece8135b99.
task-state - String - (filter exactly by task status). Valid values: 0 (initial), 1 (running), 2 (succeeded), -1 (failed).
task-sql-keyword - String - (filter fuzzily by SQL statement keyword, such as DROP TABLE).
task-operator- string (filter by sub-UIN)
task-kind - string (filter by task type)
SortBy No String Sorting field. Valid values: create-time (default value), update-time.
Sorting No String Sorting order. Valid values: asc (ascending order), desc (descending order). Default value: asc.
StartTime No String Start time in the format of yyyy-mm-dd HH:MM:SS, which is the current time seven days ago by default.
EndTime No String End time in the format of yyyy-mm-dd HH:MM:SS, which is the current time by default. The time span is (0, 30] days. Data in the last 45 days can be queried.
DataEngineName No String The data engine name for filtering.

3. Output Parameters

Parameter Name Type Description
TaskList Array of TaskResponseInfo List of task objects.
TotalCount Integer Total number of instances
TasksOverview TasksOverview The task overview.
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying the list of tasks

This example shows you how to query the list of tasks.

Input Example

POST / HTTP/1.1
Host: dlc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTasks
<Common request parameters>

{
    "Limit": 0,
    "Offset": 0,
    "Filters": [
        {
            "Name": "abc",
            "Values": [
                "abc"
            ]
        }
    ],
    "SortBy": "abc",
    "Sorting": "abc",
    "StartTime": "abc",
    "EndTime": "abc",
    "DataEngineName": "abc"
}

Output Example

{
    "Response": {
        "TaskList": [
            {
                "DatabaseName": "abc",
                "DataAmount": 0,
                "Id": "abc",
                "UsedTime": 0,
                "OutputPath": "abc",
                "CreateTime": "abc",
                "State": 0,
                "SQLType": "abc",
                "SQL": "abc",
                "ResultExpired": true,
                "RowAffectInfo": "abc",
                "DataSet": "abc",
                "Error": "abc",
                "Percentage": 0,
                "OutputMessage": "abc",
                "TaskType": "abc",
                "ProgressDetail": "abc",
                "UpdateTime": "abc",
                "DataEngineId": "abc",
                "OperateUin": "abc",
                "DataEngineName": "abc",
                "InputType": "abc",
                "InputConf": "abc",
                "DataNumber": 0,
                "CanDownload": true,
                "UserAlias": "abc",
                "SparkJobName": "abc",
                "SparkJobId": "abc",
                "SparkJobFile": "abc",
                "UiUrl": "abc",
                "TotalTime": 0,
                "CmdArgs": "abc",
                "ImageVersion": "abc",
                "DriverSize": "abc",
                "ExecutorSize": "abc",
                "ExecutorNums": 1,
                "ExecutorMaxNumbers": 1,
                "CommonMetrics": {
                    "CreateTaskTime": 0,
                    "ProcessTime": 0,
                    "QueueTime": 0,
                    "ExecutionTime": 0,
                    "IsResultCacheHit": true,
                    "MatchedMVBytes": 0,
                    "MatchedMVs": "abc",
                    "AffectedBytes": "abc",
                    "AffectedRows": 0,
                    "ProcessedBytes": 0,
                    "ProcessedRows": 0
                },
                "SparkMonitorMetrics": {
                    "ShuffleWriteBytesCos": 0,
                    "ShuffleWriteBytesTotal": 0
                },
                "PrestoMonitorMetrics": {
                    "LocalCacheHitRate": 0,
                    "FragmentCacheHitRate": 0
                }
            }
        ],
        "TotalCount": 1,
        "TasksOverview": {
            "TaskQueuedCount": 0,
            "TaskInitCount": 0,
            "TaskRunningCount": 0,
            "TotalTaskCount": 0
        },
        "RequestId": "abc"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError An internal error occurred.
InternalError.DBError A database error occurred.
InvalidParameter The parameter is incorrect.
InvalidParameterValue The parameter value is incorrect.