List SQL Execution Logs
List NineData SQL execution audit logs with pagination. This API requires Audit module permissions.
Endpoint: /openapi/v1/actionSQL/list
Method: GET
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| accountId | String | No | Account ID. Omit it to query all accounts. |
| startTime | DateTime | No | Start of the operation time range in ISO 8601 format. |
| endTime | DateTime | No | End of the operation time range in ISO 8601 format. |
| module | String | No | Module. Use the values listed in List Operation Logs. |
| sqlType | String | No | SQL type: UPDATE, DELETE, INSERT, SELECT, CREATE, DROP, ALTER, TRUNCATE, CALL, EXECUTE, GRANT, REVOKE, OPTIMIZE, or OTHER. |
| datasourceId | String | No | Data source ID. |
| databaseName | String | No | Database name. |
| tableName | String | No | Table name. |
| sql | String | No | SQL statement keyword for fuzzy matching. |
| current | Integer | No | Current page number, starting at 1. Default: 1. |
| pageSize | Integer | No | Records per page. Default: 10; maximum: 1000. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| success | Boolean | Whether the request succeeded. |
| requestId | String | Request ID. |
| current | Integer | Current page. |
| pageSize | Integer | Page size. |
| total | Integer | Total number of records. |
| data | Array | SQL execution log details. |
| data[].trailId | String | Log ID. |
| data[].eventTime | DateTime | Event operation time. |
| data[].accountId | String | Account ID. |
| data[].accountName | String | Account name. |
| data[].host | String | Client IP address. |
| data[].module | String | Module. |
| data[].type | String | Event type. |
| data[].sqlType | String | SQL type. |
| data[].datasourceId | String | Data source ID. |
| data[].databaseName | String | Database name. |
| data[].sql | String | SQL statement. |
| data[].status | String | Execution status. |
| data[].affectedRows | Long | Affected row count. |
| data[].sensitiveColumns | String | Sensitive-column information. |
| data[].elaspedTime | Float | Execution time in seconds. |
| data[].tables | Array | Involved table objects. |
| data[].tables[].databaseName | String | Database name. |
| data[].tables[].schemaName | String | Schema name. |
| data[].tables[].name | String | Table name. |
| data[].tables[].alias | String | Table alias. |
Success response
{"success": true, "requestId": "<requestId>", "current": 1, "pageSize": 10, "total": 1, "data": [{"trailId": "<trailId>", "module": "sqlWindow", "type": "execute", "sqlType": "SELECT", "datasourceId": "<datasourceId>", "databaseName": "example_db", "sql": "SELECT 1", "status": "success", "affectedRows": 0, "tables": []}]}