Mencantumkan tugas log audit untuk sebuah instans.
Deskripsi operasi
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.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:DescribeSqlLogTasks |
list |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
No |
ID Instansiasi basis data. |
r-bp1nti25tc7bq5**** |
| NodeId |
string |
No |
ID node. Catatan
Hanya untuk instans kluster. Anda dapat menentukan ID node untuk mengkueri Tugas offline-nya. Jika parameter ini dihilangkan, Tugas offline dari node utama dikembalikan secara default. |
pi-bp1o58x3ib7e6**** |
| Filters |
array<object> |
No |
Array kondisi filter. |
|
|
object |
No |
A filter condition. |
||
| Key |
string |
No |
The filter parameter. Catatan
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 |
Pengatur waktu mulai rentang kueri. Nilai ini adalah Stempel waktu UNIX yang merepresentasikan jumlah milidetik yang telah berlalu sejak 1 Januari 1970, 00:00:00 UTC. |
1596177993000 |
| EndTime |
integer |
No |
Pengatur waktu akhir rentang kueri. Nilai ini adalah Stempel waktu UNIX yang merepresentasikan jumlah milidetik yang telah berlalu sejak 1 Januari 1970, 00:00:00 UTC. |
1608888296000 |
| PageNo |
integer |
No |
Nomor halaman. Nilai harus berupa bilangan bulat positif. Nilai default: 1. |
1 |
| PageSize |
integer |
No |
Jumlah entri per halaman. Nilai maksimum: 100. Nilai default: 10. |
10 |
Parameter Key mendukung nilai berikut:
-
taskId: ID Tugas.
-
keyWords: Nama Tugas.
-
status: Status Tugas. Nilai valid: INIT (menunggu penjadwalan), RUNNING, FAILED, CANCELED, dan COMPLETED.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Code |
string |
The returned status code. |
200 |
| Message |
string |
The response message. Catatan
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 start time of the task. This value is a UNIX timestamp in milliseconds. |
1683859555482 |
| End |
integer |
The end time of the task. This value is a UNIX timestamp in milliseconds. |
1705975320000 |
| Status |
string |
The task status. Valid values:
Catatan
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 number of scanned files. |
3000 |
| Expire |
boolean |
Indicates whether the task has expired. Valid values:
|
false |
| CreateTime |
integer |
The time when the task was created. This value is a UNIX timestamp in milliseconds. |
1681363254423 |
| AnalysisTaskFinishTime |
integer |
The time when the analysis task completed. This value is a UNIX timestamp in milliseconds. |
1712751923000 |
| AnalysisTaskStatus |
string |
The status of the analysis task. Catatan
This is an internal parameter. Ignore it. |
SCAN_ANALYZE_COMPLETED |
| Result |
string |
The URL returned if 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> |
The filter conditions. |
|
|
object |
A filter condition. |
||
| Key |
string |
The filter parameter. Catatan
For 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 |
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 |
Contoh
Respons sukses
JSONformat
{
"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
}
}
Kode kesalahan
|
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. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.