Queries operation logs within a specified time range.
Operation description
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dms:GetOpLog |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Tid |
integer |
No |
The ID of the tenant. You can call the GetUserActiveTenant or ListUserTenants operation to query the tenant ID. |
3*** |
| Module |
string |
No |
The functional module for which you want to query operation logs. If you do not specify this parameter, operation logs for all functional modules are returned. Valid values:
|
SECURITY_RULE |
| StartTime |
string |
Yes |
The beginning of the time range to query. Specify the time in the yyyy-MM-DD HH:mm:ss format. |
2022-03-23 10:00:00 |
| EndTime |
string |
Yes |
The end of the time range to query. Specify the time in the yyyy-MM-DD HH:mm:ss format. |
2022-03-29 10:00:00 |
| PageSize |
integer |
Yes |
The number of entries to return on each page. Valid values:
|
30 |
| PageNumber |
integer |
Yes |
The number of the page to return. Pages start from page 1. |
1 |
| UserNick |
string |
No |
The display name of the user in DMS. |
test_name |
| DatabaseName |
string |
No |
The name of the database. |
dmstest@rm-bp1qb97d4b****.mysql.rds.aliyuncs.com:3306[poc_dev] |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| TotalCount |
integer |
The total number of operation logs that are returned. |
1 |
| RequestId |
string |
The ID of the request. |
47D56208-DB1D-4FD3-BE32-300E43185488 |
| ErrorCode |
string |
The error code. |
403 |
| OpLogDetails |
object |
||
| OpLogDetail |
array<object> |
The details of the operation log. |
|
|
object |
The details of the operation log. |
||
| Module |
string |
The functional module for which the operation log is queried. |
SECURITY_RULE |
| Database |
string |
The endpoint of the database instance. Note
|
dmstest@rm-bp1qb97d4b****.mysql.rds.aliyuncs.com:3306[poc_dev] |
| UserId |
string |
The ID of the Alibaba Cloud account. |
22275482072787**** |
| OpUserId |
integer |
The ID of the user who performed the operation. |
51**** |
| OpContent |
string |
The details of the operation. |
SELECT * FROM `orders` \n LIMIT 20 |
| UserNick |
string |
The display name of the user. |
test_name |
| OrderId |
integer |
The ID of the ticket or task. Note
This parameter is valid only for operations on the functional modules related to tasks and the task management module in system management. |
509**** |
| OpTime |
string |
The time when the operation was performed. |
2022-03-28 16:45:19 |
| ErrorMessage |
string |
The error message returned if the request failed. |
UnknownError |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"TotalCount": 1,
"RequestId": "47D56208-DB1D-4FD3-BE32-300E43185488",
"ErrorCode": "403",
"OpLogDetails": {
"OpLogDetail": [
{
"Module": "SECURITY_RULE",
"Database": "dmstest@rm-bp1qb97d4b****.mysql.rds.aliyuncs.com:3306[poc_dev]",
"UserId": "22275482072787****",
"OpUserId": 0,
"OpContent": "SELECT * FROM `orders` \\n LIMIT 20",
"UserNick": "test_name",
"OrderId": 0,
"OpTime": "2022-03-28 16:45:19"
}
]
},
"ErrorMessage": "UnknownError",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.