Queries detailed information of operation logs generated within a specified period.

The account role is Administrator , Security administrator You can call this operation. For more information about account roles, see User management .

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes GetOpLog

The operation that you want to perform. Valid values: GetOpLog .

Tid Long Yes -1

The ID of the tenant.

Note The tenant ID is taken from the avatar in the upper-right corner of the system. For more information, see Tenant ID and Tenant .
StartTime String Yes 2018-11-01 10:00:00

The start time. Specify the time in the yyyy-MM-DD HH:mm:ss format.

EndTime String Yes 2018-11-01 11:00:00

The end time, in the format of yyyy-MM-DD HH:mm:ss.

PageNumber Integer Yes 3

The number of the page to return. Pages start from page 1.

PageSize Integer Yes 30

The number of entries to return on each page. Valid values:

  • 30
  • 50
  • 100
Module String No PERMISSION

The logging module. By default, all modules in the corresponding time period return data. The values and descriptions of the logging module are as follows:

  • PERMISSION : permission
  • OWNER : Data Owner
  • SQL_CONSOLE : Data Query
  • SQL_CONSOLE_EXPORT : export query results
  • DATA_CHANGE : data change
  • DATA_EXPORT : Data export
  • SQL_REVIEW : SQL review
  • DT_SYNC : database and table synchronization
  • DT_DETAIL : database and table details
  • DB_TASK : Task Management
  • INSTANCE_MANAGE : instance management
  • USER_MANAGE : User Management
  • SECURITY_RULE : Security Rule
  • CONFIG_MANAGE : Configuration Management
  • RESOURCE_AUTH : Resource Authorization
  • ACCESS_WHITE_IP : Access IP whitelist
RegionId String No cn-hangzhou

Select a service region for DMS to call this operation. For more information about the valid values, see RegionID parameter .

Note Set the value to the ID of the region to which your applications are close.

Response parameters

Parameter Type Example Description
ErrorCode String 403

The error code.

ErrorMessage String The specified request parameter is invalid.

The error message.

OpLogDetails Array of OpLogDetail

The detailed list of Operation logs.

OpLogDetail
Database String dmstest_prod_database@dmstest.rds... [Test instance]

The database access address. This parameter is required only when the instance type is LocalInstance This parameter has a value.

Note This parameter is valid only for operations on the functional modules related to tasks.
Module String PERMISSION

Function module.

OpContent String Apply for permission

The operation content.

OpTime String 2018-11-01 10:00:00

The time when the operation was performed.

OrderId Long 1

The ticket number or task number.

Note This parameter is valid only for operations on the functional modules related to tasks and the task management module in the system management module.
UserId Long 12345678

The UID of the Alibaba Cloud account.

UserNick String dmstest

The display name of the user.

RequestId String 47D56208-DB1D-4FD3-BE32-300E43185488

The UID of the request.

Success Boolean true

Indicates whether the request is successful.

TotalCount Long 22

The total number of operation log entries.

Examples

Sample requests


     http(s)://[Endpoint]/? Action=GetOpLog &Tid=-1 &StartTime=2018-11-01 10:00:00 &EndTime=2018-11-01 11:00:00 &PageNumber=3 &PageSize=30 &<common request parameters> 
   

Sample success responses

XML format


     <OpLogDetails> <OpLogDetail> <OpContent> (success, number of rows: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND 'table_schema ' = 'dmstest_database' AND 'table_name' = 'multi_db_multi_tbl' </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 20:04:10 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (succeeded, row count: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = &#39;BASE TABLE&#39; AND 'table_schema ' = &#39;dmstest_database&#39; AND 'table_name' = &#39;multi_db_multi_tbl&#39; </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 20:04:06 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (success, number of rows: 24)show topology FROM multi_db_multi_tbl </OpContent> <UserNick> dmstest </UserNick> Data Query <Module> </Module> <Database> dmstest_database@dmstest.rds...(test) </Database> </OpLogDetail> <UserId> 12345678 </UserId> <OpLogDetail> <OpTime> 2018-11-22 20:03:55 </OpTime> <OpContent> (succeeded, row count: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = &#39;BASE TABLE&#39; AND 'table_schema ' = 'dmstest_database' AND 'table_name' = 'user_log3' </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 20:02:59 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (Succeeded, row count: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = &#39;BASE TABLE&#39; AND 'table_schema ' = &#39;dmstest_database&#39; AND 'table_name' = &#39;user_log3&#39; </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) 2018-11-22 20:02:49 </OpTime> </Database> <UserId> 12345678 </UserId> <OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (success, number of rows: 1)show CREATE TABLE user_log3 </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:34:05 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (Success, number of rows: 9)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = 'BASE TABLE' AND table_schema = 'dmstest_database' </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:33:54 </OpTime> <Module> Data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> New SQL task, the task number: 5486 </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:26:57 </OpTime> <Module> task management </Module> </OpLogDetail> <OpLogDetail> <OpContent> New SQL task, the task number: 5485 </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:23:55 </OpTime> <Module> task management </Module> </OpLogDetail> <OpLogDetail> <OpContent> New SQL task, the task number: 5484 </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:23:30 </OpTime> <Module> task management </Module> </OpLogDetail> <OpLogDetail> <OpContent> New SQL task, the task number: 5483 </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:23:11 </OpTime> <Module> task management </Module> </OpLogDetail> <OpLogDetail> <OpContent> (succeeded, row count: 1)show CREATE TABLE multi_db_single_tbl </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> data query </OpTime> <Module> </Module> </OpLogDetail> at 14:22:30 <OpLogDetail> on 2018-11-22 <OpContent> (succeeded, row count: 2)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39; </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:22:15 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (success, number of rows: 2)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = 'BASE TABLE' AND table_schema = 'dmstest_database' </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:19:31 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> add SQL task, task number: 5482 </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <Module> <OpTime> 2018-11-22 14:19:25 </OpTime> </Module> task management </OpLogDetail> <OpLogDetail> <OpContent> (succeeded, number of rows: 1)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39; </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:18:57 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> New SQL task, the task number: 5481 </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:18:46 </OpTime> <Module> task management </Module> </OpLogDetail> <OpLogDetail> <OpContent> (succeeded, row count: 0)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39; </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:04:13 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (success, number of rows: 0)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = 'BASE TABLE' AND table_schema = 'dmstest_database' </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 14:04:08 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> (success, number of rows: 0)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = 'BASE TABLE' AND table_schema = 'dmstest_database' </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <OpTime> 2018-11-22 12:11:41 </OpTime> <Module> data query </Module> </OpLogDetail> <OpLogDetail> <OpContent> administrator or DBA edit Library, the OWNER of the name: dmstest_database@dmstest.rds...(test) </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <Module> <OpTime> 2018-11-22 12:11:14 </OpTime> </Module> the data Owner </OpLogDetail> <OpLogDetail> <OpContent> administrator or DBA to edit the library OWNER. Database name: dmstest_prod_database@dmstest.rds...(test) </OpContent> <UserNick> dmstest </UserNick> <Database> dmstest_prod_database@dmstest.rds...(test) </Database> <UserId> 12345678 </UserId> <Module> the data Owner </Module> <OpTime> 2018-11-22 12:11:07 </OpTime> The </OpLogDetails> <TotalCount> 22 </TotalCount> <RequestId> </OpLogDetail> D-4FD3-BE32-300E43185488 47D56208-DB1 </RequestId> <Success> true </Success> 
   

JSON Syntax


     {"OpLogDetails": { "OpLogDetail": [{ "OpContent": "(succeeded, number of rows: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = &#39;BASE TABLE&#39; AND 'table_schema ' = &#39;dmstest_database&#39; AND 'table_name' = &#39;multi_db_multi_tbl&#39;", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 20:04:10", "Module": "data query" },{ "OpContent": "(succeeded, number of rows: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = &#39;BASE TABLE&#39; AND 'table_schema ' = &#39;dmstest_database&#39; AND 'table_name' = &#39;multi_db_multi_tbl&#39;", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12347856, "OpTime": "2018-11-22 20:04:06", "Module": "data query" },{ "OpContent": "(succeeded, number of rows: 24)show topology FROM multi_db_multi_tbl", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 20:03:55", "Module": "Data Query" }, { " OpContent ": " (succeeded, row count: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = &#39;BASE TABLE&#39; AND 'table_schema ' = &#39;dmstest_database&#39; AND 'table_name' = &#39;user_log3&#39;", " UserNick ": " dmstest ", " Database ": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 20:02:59 ", " Module ": " data query "} , { "OpContent": "(succeeded, row count: 1)SELECT (data_length + index_length) AS store_capacity FROM information_schema.tables WHERE table_type = &#39;BASE TABLE&#39; AND 'table_schema ' = &#39;dmstest_database&#39; AND 'table_name' = &#39;user_log3&#39;", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 20:02:49", "Module": " Data query "},{" OpContent ": " (succeeded, number of rows: 1)show CREATE TABLE user_log3 ", " UserNick ": " dmstest ", " Database ": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 14:34:05 ", " Module ": " Data Query " }, { " OpContent ": " (Succeeded, row count: 9)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39;", " UserNick ": " dmstest ", " Database ": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 14:33:54 ", " Module ": " data query "},{" OpContent ": " add an SQL task. Task id: 5486 ", " UserNick ": " dmstest ", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:26:57", "Module": "task management" }, { "OpContent": "added SQL task, task no.: 5485", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:23:55", "Module": "Task management" },{ "OpContent": "add an SQL task. Task number: 5484", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:23:30", "Module": "task management" },{ "OpContent": "Add an SQL task. Task ID: 5483", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:23:11", "Module": "task management" },{ "OpContent": "(succeeded, number of rows: 1)show CREATE TABLE multi_db_single_tbl", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:22:30", "Module": "Data query" }, { "OpContent": "(succeeded, number of rows: 2)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39;", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:22:15", "Module": "data query" }, { " OpContent ": " (succeeded, row count: 2)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39;", " UserNick ": " dmstest ", " Database ": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 14:19:31 ", " Module ": " data query "},{" OpContent ": " add an SQL task. Task id: 5482 ", " UserNick ": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:19:25", "Module": "task management" }, { "OpContent": "(succeeded, number of rows: 1)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39;", "UserNick": "dmstest", "Database": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 14:18:57 ", " Module ": " data query "},{" OpContent ": " added SQL task. Task id: 5481 ", " UserNick ": " dmstest ", " Database ": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 14:18:46 ", " Module ": " task management "} , { "OpContent": "(succeeded. Number of rows: 0)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39;", "UserNick": "dmstest", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 14:04:13", "Module": "Data Query" }, { "OpContent": " (Succeeded, row count: 0)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39;", " UserNick ": " dmstest ", " Database ": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 14:04:08 ", " Module ": " Data Query " }, { " OpContent ": " (Succeeded, row count: 0)SELECT 'TABLE_NAME' FROM information_schema.tables WHERE TABLE_TYPE = &#39;BASE TABLE&#39; AND table_schema = &#39;dmstest_database&#39;", " UserNick ": " dmstest ", " Database ": " dmstest_database@dmstest.rds...(test)", " UserId ": 12345678, " OpTime ": " 2018-11-22 12:11:41 ", " Module ": " data query "},{" OpContent ": " administrator or DBA edit library OWNER, library name: dmstest_database@dmstest.rds...(test)", " UserNick ": " dmstest ", "Database": "dmstest_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 12:11:14", "Module": "data Owner" },{ "OpContent": "the library OWNER edited by the administrator or DBA. Library name: dmstest_prod_database@dmstest.rds...(test)", "UserNick": "dmstest", "Database": "dmstest_prod_database@dmstest.rds...(test)", "UserId": 12345678, "OpTime": "2018-11-22 12:11:07", "Module": "Data Owner" }] }, "TotalCount": 22, "RequestId": "47D56208-DB1 D-4FD3-BE32-300E43185488", "Success": true} 
   

Error codes

The port number of a client that accesses a Error Center For more information, see error codes.

SDK examples

For more information about the basic information of SDK usage, see: Alibaba Cloud Python SDK

Example:


     from aliyunsdkcore.client import AcsClient from aliyunsdkdms_enterprise.request.v20181101.GetOpLogRequest import GetOpLogRequest client = AcsClient( "<your-access-key-id> "," <your-access-key-secret> ", " <your-region-id> ") request = GetOpLogRequest() request.set_Tid(" Please enter your enterprise tenant id ") request.set_StartTime(" 2018-11-20 00:00:00 ") request.set_EndTime(" 2018-11-23 00:00:00 ") request.set_PageNumber(1) request.set_PageSize(50) response = client.do_action_with_exception(request) print response