You can call this operation to query detailed information of operation logs generated within a specified period.

The administrator of Data Management (DMS) Enterprisecan call this operation to query the operation logs generated for the enterprise.

Debugging

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
Tid Long Yes -1

The ID of the tenant.

Note To query the ID, log on to the DMS Enterprise console and choose System Management > Instance Management or System Management > User Management. The ID of the tenant appears in the Service Specification section.
StartTime String Yes 2018-11-01 10:00:00

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

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

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.

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
Action String Yes GetOpLog

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

Module String No PERMISSION

The functional module of DMS Enterprise from which the operation logs are queried. If you do not specify this parameter, all operation logs generated within the specified time range are returned. Valid values:

  • PERMISSION: permission
  • OWNER: data owner
  • SQL_CONSOLE: data query
  • SQL_CONSOLE_EXPORT: query result export
  • 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 rules
  • CONFIG_MANAGE: configuration management
  • RESOURCE_AUTH: resource authorization
  • ACCESS_WHITE_IP: IP whitelist access

Response parameters

Parameter Type Example Description
ErrorCode String 403

The error code.

ErrorMessage String The specified request parameter is invalid.

The error message.

OpLogDetails

The detailed information of operation logs.

OpLogDetail

The detailed information of an operation log.

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

The endpoint of the database instance. This parameter was set only when you added the database instance of the LocalInstance type in the DMS Enterprise console.

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

The functional module from which the operation log was queried.

OpContent String Apply for permission

The operation that was performed.

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

The time when the operation was performed.

OrderId Long 1

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 the system management module.
UserId Long 12345678

The unique ID (UID) of the user.

UserNick String dmstest

The display name of the user.

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

The ID of the request.

Success Boolean true

Indicates whether the request was successful.

TotalCount Long 22

The total number of operation logs that met the query conditions.

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

<GetOpLogResponse>
     <OpLogDetails>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 20:04:10</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 20:04:06</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 20:03:55</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 20:02:59</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 20:02:49</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:34:05</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:33:54</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>Add an SQL task. Task ID: 5486.</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:26:57</OpTime>
               <Module>DB_TASK</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>Add an SQL task. Task ID: 5485.</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:23:55</OpTime>
               <Module>DB_TASK</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>Add an SQL task. Task ID: 5484.</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:23:30</OpTime>
               <Module>DB_TASK</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>Add an SQL task. Task ID: 5483.</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:23:11</OpTime>
               <Module>DB_TASK</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>[Succeeded. Number of rows: 1]show CREATE TABLE multi_db_single_tbl</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:22:30</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:22:15</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:19:31</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>Add an SQL task.Task ID: 5482.</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:19:25</OpTime>
               <Module>DB_TASK</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:18:57</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>Add an SQL task. Task ID: 5481.</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:18:46</OpTime>
               <Module>DB_TASK</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:04:13</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 14:04:08</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent></OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 12:11:41</OpTime>
               <Module>SQL_CONSOLE</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>The administrator or DBA edits the database owner. Database name: dmstest_database@dmstest.rds... [Test instance]</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_database@dmstest.rds... [Test instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 12:11:14</OpTime>
               <Module>OWNER</Module>
          </OpLogDetail>
          <OpLogDetail>
               <OpContent>The administrator or DBA edits the database owner. Database name: dmstest_prod_database@dmstest.rds... [Production instance]</OpContent>
               <UserNick>dmstest</UserNick>
               <Database>dmstest_prod_database@dmstest.rds... [Production instance]</Database>
               <UserId>12345678</UserId>
               <OpTime>2018-11-22 12:11:07</OpTime>
               <Module>OWNER</Module>
          </OpLogDetail>
     </OpLogDetails>
     <TotalCount>22</TotalCount>
     <RequestId>DC3A5360-67CC-4A0B-B5BD-734CBEAF8A23</RequestId>
     <Success>true</Success>
</GetOpLogResponse>

JSON format

{
	"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 20:04:10",
				"Module":"SQL_CONSOLE"
			},
			{
				"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 20:04:06",
				"Module":"SQL_CONSOLE"
			},
			{
				"OpContent":"[Succeeded. Number of rows: 24]show topology FROM multi_db_multi_tbl",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 20:03:55",
				"Module":"SQL_CONSOLE"
			},
			{
				"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;user_log3&#39;",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 20:02:59",
				"Module":"SQL_CONSOLE"
			},
			{
				"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;user_log3&#39;",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 20:02:49",
				"Module":"SQL_CONSOLE"
			},
			{
				"OpContent":"[Succeeded. Number of rows: 1]show CREATE TABLE user_log3",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:34:05",
				"Module":"SQL_CONSOLE"
			},
			{
				"OpContent":"[Succeeded. Number of rows: 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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:33:54",
				"Module":"SQL_CONSOLE"
			},
			{
				"OpContent":"Add an SQL task. Task ID: 5486.",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:26:57",
				"Module":"DB_TASK"
			},
			{
				"OpContent":"Add an SQL task. Task ID: 5485.",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:23:55",
				"Module":"DB_TASK"
			},
			{
				"OpContent":"Add an SQL task. Task ID: 5484.",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:23:30",
				"Module":"DB_TASK"
			},
			{
				"OpContent":"Add an SQL task. Task ID: 5483.",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:23:11",
				"Module":"DB_TASK"
			},
			{
				"OpContent":"[Succeeded. Number of rows: 1]show CREATE TABLE multi_db_single_tbl",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:22:30",
				"Module":"SQL_CONSOLE"
			},
			{
				"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:22:15",
				"Module":"SQL_CONSOLE"
			},
			{
				"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:19:31",
				"Module":"SQL_CONSOLE"
			},
			{
				"OpContent":"Add an SQL task. Task ID: 5482.",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:19:25",
				"Module":"DB_TASK"
			},
			{
				"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:18:57",
				"Module":"SQL_CONSOLE"
			},
			{
				"OpContent":"Add an SQL task. Task ID: 5481.",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:18:46",
				"Module":"DB_TASK"
			},
			{
				"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:04:13",
				"Module":"SQL_CONSOLE"
			},
			{
				"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 14:04:08",
				"Module":"SQL_CONSOLE"
			},
			{
				"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 instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 12:11:41",
				"Module":"SQL_CONSOLE"
			},
			{
				"OpContent":"The administrator or DBA edits the database owner. Database name: dmstest_database@dmstest.rds... [Test instance]",
				"UserNick":"dmstest",
				"Database":"dmstest_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 12:11:14",
				"Module":"OWNER"
			},
			{
				"OpContent":"The administrator or DBA edits the database owner. Database name: dmstest_prod_database@dmstest.rds... [Test instance]",
				"UserNick":"dmstest",
				"Database":"dmstest_prod_database@dmstest.rds... [Test instance]",
				"UserId":12345678,
				"OpTime":"2018-11-22 12:11:07",
				"Module":"OWNER"
			}
		]
	},
	"TotalCount":22,
	"RequestId":"47D56208-DB1D-4FD3-BE32-300E43185488",
	"Success":true
}

Error codes

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

SDK example

For more information about how to use the SDK, see the 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("Your 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