Lists the audit log tasks for an instance.
Operation description
The following prerequisites must be met to call this operation:
We recommend that you use the latest version of the Alibaba Cloud SDK or the DAS SDK.
When you use an SDK to call the DAS service, you must set the region to
cn-shanghai.
Try it now
Test
RAM authorization
|
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
For cluster instances only. You can specify a node ID to query its offline tasks. If this parameter is omitted, the offline tasks of the primary node are returned by default. |
pi-bp1o58x3ib7e6**** |
| Filters |
array<object> |
No |
An array of filter conditions. |
|
|
object |
No |
A filter condition. |
||
| Key |
string |
No |
The filter parameter. Note
See Additional information about request parameters for the supported filter parameters and their valid values. |
keyWords |
| Value |
string |
No |
The value of the filter parameter. |
select |
| StartTime |
integer |
No |
The start time of the query range. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1596177993000 |
| EndTime |
integer |
No |
The end time of the query range. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1608888296000 |
| PageNo |
integer |
No |
The page number. The value must be a positive integer. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Maximum value: 100. Default value: 10. |
10 |
The Key parameter supports the following values:
taskId: The task ID.
keyWords: The task name.
status: The task status. Valid values: INIT (pending scheduling), RUNNING, FAILED, CANCELED, and COMPLETED.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Code |
string |
The returned status code. |
200 |
| Message |
string |
The response message. Note
If the request is successful, Successful is returned. If the request fails, 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 |
| Data |
object |
The returned data. |
|
| List |
array<object> |
The list of tasks. |
|
|
array<object> |
The details of an offline task. |
||
| TaskId |
string |
The task ID. |
9a4f5c4494dbd6713185d87a97aa53e8 |
| InstanceId |
string |
The ID of the database instance. |
r-bp1nti25tc7bq5**** |
| Name |
string |
The name of the task. |
SQL审计导出1 |
| Start |
integer |
The task start time, represented as a unix timestamp in milliseconds. |
1683859555482 |
| End |
integer |
The task end time, represented as a unix timestamp in milliseconds. |
1705975320000 |
| Status |
string |
The task status. Valid values:
Note
You can view the result of an offline task only when its status is COMPLETED. |
RUNNING |
| LogCount |
integer |
The total number of logs. |
99999 |
| Progress |
integer |
The progress of the task. |
100 |
| ScanFileSize |
integer |
The total size of the scanned files, in bytes. |
3000 |
| Expire |
boolean |
Indicates whether the task has expired. Valid values:
|
false |
| CreateTime |
integer |
The task creation time, represented as a unix timestamp in milliseconds. |
1681363254423 |
| AnalysisTaskFinishTime |
integer |
The analysis completion time, represented as a unix timestamp in 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 when TaskType is set to Export. |
https://das-sqllog-download-cn-shanghai.oss-cn-shanghai.aliyuncs.com/la |
| TaskType |
string |
The task type. Valid values:
|
Export |
| Filters |
array<object> |
A list of filter conditions. |
|
|
object |
A filter condition. |
||
| Key |
string |
The filter parameter. Note
For information about the supported filter parameters and their valid values, see Additional information about request parameters. |
keyWords |
| Value |
string |
The value of the filter parameter. |
select |
| InnerResult |
string |
The VPC-internal URL for accessing the task result. |
https://das-sqllog-download-oss-cn-shanghai-internal.aliyuncs.com /la |
| Total |
integer |
The total number of tasks. |
40 |
| PageNo |
integer |
The page number. |
1 |
| PageSize |
integer |
The page size. |
10 |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "Successful",
"RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Success": "true",
"Data": {
"List": [
{
"TaskId": "9a4f5c4494dbd6713185d87a97aa53e8",
"InstanceId": "r-bp1nti25tc7bq5****\n",
"Name": "SQL审计导出1",
"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": "keyWords\n",
"Value": "select\n"
}
],
"InnerResult": "https://das-sqllog-download-oss-cn-shanghai-internal.aliyuncs.com\n/la"
}
],
"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.