Queries the logon records of an instance.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListInstanceLoginAuditLog

The operation that you want to perform. Set the value to ListInstanceLoginAuditLog.

StartTime String Yes 2021-11-18 11:00:00:00

The beginning of the time range to query.

Note The start time supports fuzzy match. Specify the time in the YYYY-MM-DD hh:mm:ss format.
EndTime String Yes 2021-11-18 18:00:00

The end of the time range to query.

Note The end time supports fuzzy match. Specify the time in the YYYY-MM-DD hh:mm:ss format. We recommend that you use the StartTime and EndTime parameters to specify a time range that does not exceed one day. This way, the returned entries can be displayed by page to increase query efficiency.
SearchName String No test_SearchName

The name of the database or instance whose logon records you want to query.

Note If SQL statements are executed at the instance level, you can set this parameter to an instance name. If SQL statements are executed at the database level, you can set this parameter to a database name.
OpUserName String No test_OpUserName

The alias of the user.

PageSize Integer Yes 20

The number of entries to return on each page. Maximum value: 100.

PageNumber Integer Yes 1

The number of the page to return.

Tid Long No 3***

The ID of the tenant. You can call the GetUserActiveTenant operation to query the tenant ID.

RegionId String No cn-hangzhou

The region in which DMS is activated. For more information, see RegionID parameter.

Response parameters

Parameter Type Example Description
TotalCount Long 1

The number of entries returned.

RequestId String 074CE7C9-4F9C-5B62-89BC-7B4914A3****

The ID of the request.

ErrorCode String InvalidPageSize

The error code returned.

ErrorMessage String Specified parameter PageSize is not valid.

The error message returned.

Success Boolean true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
InstanceLoginAuditLogList Array of InstanceLoginAuditLog

The logon records of the instance.

OpTime String 2021-11-18 11:13:26

The time when the user performed an operation on the instance.

UserName String test_UserName

The alias of the user.

UserId Long 12****

The ID of the user.

InstanceName String rm-bp144d5ky4l4rli0417****.mysql.rds.aliyuncs.com:3306[rm-bp144d5ky4l4r****]

The name of the instance.

InstanceId Long 177****

The ID of the instance.

DbUser String test_User

The database account that is used to log on to the instance.

RequestIp String 117.36.XX.XX,100.104.XX.XX

The source IP address of the request.


Sample requests

&StartTime=2021-11-18 11:00:00:00
&EndTime=2021-11-18 18:00:00:00
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK

            <RequestIp>117.36.XX.XX, 100.104.XX.XX</RequestIp>
            <OpTime>2021-11-18 11:13:26</OpTime>

JSON format

HTTP/1.1 200 OK

  "InstanceLoginAuditLogList" : {
    "InstanceLoginAuditLog" : [ {
      "InstanceName" : "rm-bp144d5ky4l4rli0417****.mysql.rds.aliyuncs.com:3306[rm-bp144d5ky4l4r****]",
      "UserName" : "test_UserName",
      "InstanceId" : "177****",
      "UserId" : "12****",
      "RequestIp" : "117.36.XX.XX, 100.104.XX.XX",
      "OpTime" : "2021-11-18 11:13:26",
      "DbUser" : "test_User"
    } ]
  "TotalCount" : 1,
  "RequestId" : "074CE7C9-4F9C-5B62-89BC-7B4914A3****",
  "Success" : true

Error codes

For a list of error codes, visit the API Error Center.