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
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
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 |
| 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.
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.
|
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 |
| 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.