All Products
Search
Document Center

Database Autonomy Service:DescribeSqlLogTasks

Last Updated:Dec 19, 2025

Queries the audit log tasks for an instance.

Operation description

Before you call this operation, note the following:

  • Use the latest version of the Alibaba Cloud or Database Autonomy Service (DAS) software development kit (SDK).

  • When you use an SDK to call the DAS service, set the region to cn-shanghai.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:DescribeSqlLogTasks

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

The ID of the database instance.

r-bp1nti25tc7bq5****

NodeId

string

No

The node ID.

Note

This parameter applies only to cluster instances. You can query the offline tasks for a specific node. If you do not specify this parameter, the offline tasks of the primary node are returned by default.

pi-bp1o58x3ib7e6z496

Filters

array<object>

No

The query filter conditions.

object

No

A query filter condition.

Key

string

No

The filter parameter.

Note

For information about the supported filter parameters and their valid values, see the Additional information about request parameters section.

delimiter

Value

string

No

The value of the filter parameter.

,

StartTime

integer

No

The beginning of the time range to query. This value is a UNIX timestamp. Unit: milliseconds.

1596177993000

EndTime

integer

No

The end of the time range to query. This value is a UNIX timestamp. Unit: milliseconds.

1608888296000

PageNo

integer

No

The page number. The value must be an integer that is greater than 0. Default value: 1.

1

PageSize

integer

No

The number of entries to return on each page. Valid values: 1 to 100. Default value: 10.

10

The supported filter parameters for Key are as follows:

  • taskId: The task ID.

  • keyWords: The task name.

  • status: The status of the task. Valid values: INIT (pending scheduling), RUNNING (running), FAILED (failed), CANCELED (canceled), and COMPLETED (completed).

Response elements

Element

Type

Description

Example

object

Code

string

The HTTP status code.

200

Message

string

The returned message.

Note

A value of Successful indicates that the request was successful. If the request failed, an error message is returned.

Successful

RequestId

string

The request ID.

B6D17591-B48B-4D31-9CD6-9B9796B2****

Success

string

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Data

object

The returned data.

List

array<object>

The list of returned information.

array<object>

The list of returned information.

TaskId

string

The task ID.

9a4f5c4494dbd6713185d87a97aa53e8

InstanceId

string

The ID of the database instance.

rm-2zew761kf7ho18752

Name

string

The task name.

test01

Start

integer

The start time of the task. This value is a UNIX timestamp. Unit: milliseconds.

1683859555482

End

integer

The end time of the task. This value is a UNIX timestamp. Unit: milliseconds.

1705975320000

Status

string

The task status.

  • INIT: Pending scheduling.

  • RUNNING: Running.

  • FAILED: Failed.

  • CANCELED: Canceled.

  • COMPLETED: Completed.

Note

You can view the results of the offline task when the task status is COMPLETED.

RUNNING

LogCount

integer

The total number of logs.

99999

Progress

integer

The progress of the task.

100

ScanFileSize

integer

The number of scanned files.

3000

Expire

boolean

Indicates whether the task has expired.

  • true: Yes.

  • false: No.

false

CreateTime

integer

The time when the task was created. This value is a UNIX timestamp. Unit: milliseconds.

1681363254423

AnalysisTaskFinishTime

integer

The time when the analysis task was complete. This value is a UNIX timestamp. Unit: milliseconds.

1712751923000

AnalysisTaskStatus

string

The status of the analysis task.

Note

This is an internal parameter. You can ignore it.

SCAN_ANALYZE_COMPLETED

Result

string

The URL that is returned if TaskType is set to Export.

https://das-sqllog-download-cn-shanghai.oss-cn-shanghai.aliyuncs.com/la

TaskType

string

The task type.

  • Export: Export task.

  • Query: Query task.

Export

Filters

array<object>

The query filter conditions.

object

A query filter condition.

Key

string

The filter parameter.

Note

For information about the supported filter parameters and their valid values, see the Additional information about request parameters section.

delimiter

Value

string

The value of the filter parameter.

,

InnerResult

string

Total

integer

The total number of tasks.

40

PageNo

integer

The page number.

1

PageSize

integer

The number of entries per page.

10

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "Successful",
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Success": "true",
  "Data": {
    "List": [
      {
        "TaskId": "9a4f5c4494dbd6713185d87a97aa53e8",
        "InstanceId": "rm-2zew761kf7ho18752",
        "Name": "test01",
        "Start": 1683859555482,
        "End": 1705975320000,
        "Status": "RUNNING",
        "LogCount": 99999,
        "Progress": 100,
        "ScanFileSize": 3000,
        "Expire": false,
        "CreateTime": 1681363254423,
        "AnalysisTaskFinishTime": 1712751923000,
        "AnalysisTaskStatus": "SCAN_ANALYZE_COMPLETED",
        "Result": "https://das-sqllog-download-cn-shanghai.oss-cn-shanghai.aliyuncs.com/la",
        "TaskType": "Export",
        "Filters": [
          {
            "Key": "delimiter",
            "Value": ","
          }
        ],
        "InnerResult": ""
      }
    ],
    "Total": 40,
    "PageNo": 1,
    "PageSize": 10
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid.
403 NoPermission You are not authorized to do this action.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.