All Products
Search
Document Center

Data Management:ListInstanceLoginAuditLog

Last Updated:Apr 26, 2024

Queries the logon records of an instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:ListInstanceLoginAuditLogRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
StartTimestringYes

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.
2021-11-18 11:00:00
EndTimestringYes

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.
2021-11-18 18:00:00
SearchNamestringNo

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

The alias of the user.

test_OpUserName
PageSizeintegerYes

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

20
PageNumberintegerYes

The number of the page to return.

1
TidlongNo

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

3***

Response parameters

ParameterTypeDescriptionExample
object
TotalCountlong

The number of entries returned.

1
RequestIdstring

The ID of the request.

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

The error code returned.

InvalidPageSize
ErrorMessagestring

The error message returned.

Specified parameter PageSize is not valid.
Successboolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.
true
InstanceLoginAuditLogListobject []

The logon records of the instance.

OpTimestring

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

2021-11-18 11:13:26
UserNamestring

The alias of the user.

test_UserName
UserIdlong

The ID of the user.

12****
InstanceNamestring

The name of the instance.

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

The ID of the instance.

177****
DbUserstring

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

test_User
RequestIpstring

The source IP address of the request.

117.36.XX.XX,100.104.XX.XX

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history