GetSqlConsoleOperationLog

Updated at:

Queries the operation logs of the SQL window.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

integer

No

The instance ID.

1

Username

string

No

The username.

user

Schema

string

No

The database schema.

mysql

SqlType

string

No

The type of the SQL statement.

SELECT

PageNumber

integer

Yes

The page number. Pages start from page 1.

1

PageSize

integer

Yes

The number of entries per page. Maximum value: 100.

20

StartTime

string

Yes

The start time of the logs.

2026-01-01 00:00:00

EndTime

string

Yes

The end time of the logs.

2026-06-01 00:00:00

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID, which is used to locate logs and troubleshoot issues.

C0A813EB-4623-523A-8598-86390CB4****

Data

array<object>

The response struct.

object

The response struct.

StartTime

string

The start time of the logs.

2026-01-01 00:00:00

Schema

string

The database schema.

mysql

Sql

string

The SQL statement.

SELECT * FROM user;

Success

boolean

Indicates whether the statement is executed.

true

AffectRows

integer

The number of affected rows.

100

Cost

integer

The execution duration. Unit: milliseconds.

10

Error

string

The error message.

Access Denied

Username

string

The username.

user

DatabaseSearchName

string

The database search name.

mysql@xxx.com

SqlType

string

The SQL type.

SELECT

ErrorCode

string

The error code.

400

ErrorMessage

string

The error message returned if the call failed.

UnknownError

Success

boolean

Indicates whether the request is successful.

true

TotalCount

integer

The total number of logs.

100

Examples

Success response

JSON format

{
  "RequestId": "C0A813EB-4623-523A-8598-86390CB4****",
  "Data": [
    {
      "StartTime": "2026-01-01 00:00:00",
      "Schema": "mysql",
      "Sql": "SELECT * FROM user;",
      "Success": true,
      "AffectRows": 100,
      "Cost": 10,
      "Error": "Access Denied",
      "Username": "user",
      "DatabaseSearchName": "mysql@xxx.com",
      "SqlType": "SELECT"
    }
  ],
  "ErrorCode": "400",
  "ErrorMessage": "UnknownError",
  "Success": true,
  "TotalCount": 100
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.