Queries the logon records of an instance.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dms:ListInstanceLoginAuditLog | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
StartTime | string | Yes | 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 |
EndTime | string | Yes | 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 |
SearchName | string | No | 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 |
OpUserName | string | No | The alias of the user. | test_OpUserName |
PageSize | integer | Yes | The number of entries to return on each page. Maximum value: 100. | 20 |
PageNumber | integer | Yes | The number of the page to return. | 1 |
Tid | long | No | The ID of the tenant. You can call the GetUserActiveTenant operation to query the tenant ID. | 3*** |
Response parameters
Examples
Sample success responses
JSON
format
{
"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 time | Summary of changes | Operation |
---|
No change history