tencent cloud

Feedback

DescribeTasks

Last updated: 2024-08-08 15:32:02

    1. API Description

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

    This API is used to query the list of tasks.

    A maximum of 1000 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.
    ResourceGroupName No String Resource group name of the spark engine

    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, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). 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.
    InternalError.InternalSystemException The business system is abnormal. Please try again or submit a ticket to contact us.
    InvalidParameter The parameter is incorrect.
    InvalidParameter.FiltersValuesNumberOutOfLimit The number of specified Filter.Values parameters exceeds the limit. Currently, it should be less than or equal to 50.
    InvalidParameter.InvalidFilterLength The number of filter conditions is invalid. When filter conditions are specified, the number of filter conditions should be greater than or equal to 1 and less than or equal to 5.
    InvalidParameter.InvalidTimeFormat The specified time format is not compliant. Currently, only YYYY-mm-dd HH:MM:SS is supported.
    InvalidParameter.ParameterBase64DecodeFailed Base64 parsing of the specified parameter failed.
    InvalidParameter.ParameterNotFoundOrBeNone The parameter is not found or empty.
    InvalidParameter.SQLTaskFiltersKeyTypeNotMath The specified Filter.Key does not match. Currently, only task-id/task-sql-keyword/task-kind/task-operator/batch-id/session-id/task-state is supported.
    InvalidParameter.SQLTaskNotFound The specified SQL task does not exist.
    InvalidParameter.SQLTaskSortByTypeNotMatch The SortBy type specified in the SQL task does not match. Currently, only create-time/data-amount/used-time/resource-usage is supported.
    InvalidParameter.SparkJobNotFound The specified Spark task does not exist.
    InvalidParameter.TaskStateTypeNotMath The specified task status does not match. Currently, it only supports 0: initializing, 1: running, 2: successful, 3: writing data, 4: queuing, -1: failed, and -3: deleted.
    InvalidParameterValue The parameter value is incorrect.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support