历史任务列表查询

最近更新时间:2025-11-26 01:35:39

我的收藏

1. 接口描述

接口请求域名: dlc.tencentcloudapi.com 。

该接口(DescribleTasks)用于查询任务列表

默认接口请求频率限制:20次/秒。

推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:DescribeTaskList。
Version String 公共参数,本接口取值:2021-01-25。
Region String 公共参数,详见产品支持的 地域列表
Limit Integer 返回数量,默认为10,最大值为100。
示例值:20
Offset Integer 偏移量,默认为0。
示例值:0
Filters.N Array of Filter 过滤条件,如下支持的过滤类型,传参Name应为以下其中一个,其中task-id支持最大50个过滤个数,其他过滤参数支持的总数不超过5个。
task-id - String - (任务ID准确过滤)task-id取值形如:e386471f-139a-4e59-877f-50ece8135b99。
task-state - String - (任务状态过滤)取值范围 0(初始化), 1(运行中), 2(成功), -1(失败)。
task-sql-keyword - String - (SQL语句关键字模糊过滤)取值形如:DROP TABLE。
task-operator- string (子uin过滤)
task-kind - string (任务类型过滤)
SortBy String 排序字段,支持如下字段类型,create-time(创建时间,默认)、update-time(更新时间)
示例值:create-time
Sorting String 排序方式,desc表示正序,asc表示反序, 默认为asc。
示例值:desc
StartTime String 起始时间点,格式为yyyy-mm-dd HH:MM:SS。默认为45天前的当前时刻
示例值:2019-01-21 00:00:00
EndTime String 结束时间点,格式为yyyy-mm-dd HH:MM:SS时间跨度在(0,30天],支持最近45天数据查询。默认为当前时刻
示例值:2019-01-22 00:00:00
DataEngineName String 数据引擎名称,用于筛选
示例值:shared_presto
ResourceGroupName String spark引擎资源组名称
示例值:ResourceGroupName1
HouseIds.N Array of String 引擎id列表
示例值:["DataEngine-18j7ot11"]

3. 输出参数

参数名称 类型 描述
TaskList Array of TaskFullRespInfo 任务对象列表。
TotalCount Integer 实例总数。
示例值:21
RequestId String 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 DescribleTasks接口示例

输入示例

POST / HTTP/1.1
Host: dlc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTaskList
<公共请求参数>

{
    "Limit": 10,
    "Offset": 10,
    "Filters": [
        {
            "Name": "task-id",
            "Values": [
                "3434747dfe5911efadef76cfa258de8c"
            ]
        }
    ]
}

输出示例

{
    "Response": {
        "RequestId": "f337202f-4b7a-4ae6-a976-64196f1b818e",
        "TaskList": [
            {
                "AnalysisStatusType": 0,
                "CanDownload": false,
                "CmdArgs": "",
                "CommonMetrics": null,
                "CreateTime": "1741694628056",
                "CreatorAlias": "100017140401",
                "CreatorUin": "100017140401",
                "CustomizedConf": "",
                "DataAmount": 0,
                "DataEngineId": "DataEngine-iwcrcjq1",
                "DataEngineName": "super_spark",
                "DataNumber": 0,
                "DataSet": "",
                "DatabaseName": "",
                "DriverSize": "",
                "EngineHasListenerConfig": false,
                "EngineType": "",
                "EngineTypeDetail": "SparkSQL",
                "Error": "",
                "ExecutorMaxNumbers": 0,
                "ExecutorNums": 0,
                "ExecutorSize": "",
                "Id": "e39b2b73fe7011ef852f5254007d4e2c",
                "ImageVersion": "SuperSQL-S 3.5",
                "InputConf": "",
                "InputRecordsSum": 0,
                "InputType": "",
                "OperateUin": "100017140401",
                "OutputBytesSum": 1049893,
                "OutputFilesNum": 1,
                "OutputMessage": "",
                "OutputPath": "lakefs://6000000186bb9b4e5d6a01f0bab6dc05c73b2c64995d45690e45cbc6ec2e36703bafdc3a@dlca10f-100017140401-1739416252-100040138245-1333670961/1304581893/.system/result/20250311/e39b2b73fe7011ef852f5254007d4e2c/",
                "OutputRecordsSum": 10,
                "OutputSmallFilesNum": 1,
                "Percentage": 100,
                "PrestoMonitorMetrics": null,
                "ProgressDetail": "[{\"jobId\":\"1\",\"stages\":[{\"stageId\":\"1\",\"schedule\":1},{\"stageId\":\"2\",\"schedule\":1}],\"jobState\":\"SUCCEEDED\",\"totalTime\":2728,\"firstLaunchTime\":1741694751313},{\"jobId\":\"0\",\"stages\":[{\"stageId\":\"0\",\"schedule\":1}],\"jobState\":\"SUCCEEDED\",\"totalTime\":5934,\"firstLaunchTime\":1741694749494}]",
                "ResourceGroupId": "",
                "ResourceGroupName": "",
                "ResultExpired": false,
                "ResultFormat": "csv",
                "RowAffectInfo": "10 rows affected (11.542000 seconds)",
                "SQL": "INSERT INTO `f284_database_thea`.`optimize_iceberg_native_table_1` VALUES (int(current_timestamp())+1,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+2,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+3,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+4,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+5,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+6,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+7,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+8,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+9,'optimize_iceberg_native_table_1数据写入',current_timestamp()),(int(current_timestamp())+10,'optimize_iceberg_native_table_1数据写入',current_timestamp())",
                "SQLType": "DML",
                "ShuffleReadBytesSum": 1021,
                "ShuffleReadRecordsSum": 10,
                "Source": "dataExploration",
                "SourceExtra": "",
                "SparkAppId": "",
                "SparkJobFile": "",
                "SparkJobId": "",
                "SparkJobName": "",
                "SparkMonitorMetrics": null,
                "StageStartTime": 1741694749494,
                "State": 2,
                "TaskCategory": "SQL",
                "TaskName": "sql_query_20250311200348_c806d895",
                "TaskTimeSum": 8,
                "TaskType": "SparkSQLTask",
                "TotalTime": 128454,
                "UiUrl": "http://11.142.253.112/history/spark-5d3e75773a2d4d979e8ac93f5b590ba0/none/0/SQL/?group=0",
                "UpdateTime": "1741694756510",
                "UsedTime": 4541,
                "UserAlias": "100017140401"
            }
        ],
        "TotalCount": 1420
    }
}

5. 开发者资源

腾讯云 API 平台

腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。

API Inspector

用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码

错误码 描述
InternalError 内部错误。
InternalError.DBError 数据库错误。
InternalError.InternalSystemException 业务系统异常,请重试或提工单联系我们。
InvalidParameter 参数错误。
InvalidParameter.FiltersValuesNumberOutOfLimit 指定Filter.Values参数数量超限,当前应小于等于50个
InvalidParameter.InvalidFilterLength 过滤条件个数非法,当指定了过滤条件时,过滤条件的个数应该大于等于1个,且小于等于5个
InvalidParameter.InvalidTasksFilterLength 任务长度超限
InvalidParameter.InvalidTimeFormat 指定时间格式不合规,当前仅支持: YYYY-mm-dd HH:MM:SS
InvalidParameter.ParameterBase64DecodeFailed 指定参数Base64解析失败
InvalidParameter.ParameterNotFoundOrBeNone 找不到参数或参数为空
InvalidParameter.SQLTaskFiltersKeyTypeNotMath 指定的Filter.Key不匹配,当前仅支持: task-id/task-sql-keyword/task-kind/task-operator/batch-id/session-id/task-state
InvalidParameter.SQLTaskNotFound 指定的SQL任务不存在
InvalidParameter.SQLTaskSortByTypeNotMatch SQL任务指定SortBy类型不匹配,当前仅支持: create-time/data-amount/used-time/resource-usage
InvalidParameter.SparkJobNotFound 指定的Spark任务不存在
InvalidParameter.TaskListSortByTypeNotMatch 过滤字段类型不匹配,当前仅支持: task-id/task-sql-keyword/task-kind/task-operator/batch-id/session-id/task-state/task-time-sum/stage-start-time/input-records-sum/output-records-sum/output-bytes-sum/output-files-num/output-small-files-num/shuffle-read-records-sum/shuffle-read-bytes-sum
InvalidParameter.TaskStateTypeNotMath 指定的任务状态不匹配,当前仅支持: 0:初始化, 1:运行中, 2:成功, 3:数据写入中, 4:排队中, -1:失败, -3:删除
InvalidParameterValue 参数取值错误。