Updated on 2026-01-20 GMT+08:00

Querying Historical Transactions

Function

  • This API is used to query historical transactions.
  • Currently, this API is only available to RDS for MySQL. Only historical transactions in the last seven days can be viewed.

Authorization Information

Each account has permissions to call all APIs, but IAM users must have the required permissions specifically assigned.

  • If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    das::showCloudDBAInfo

    Read

    -

    -

    -

    -

URI

GET /v3/{project_id}/instances/{instance_id}/transaction

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters, including only letters and digits.

Default Value

N/A

instance_id

Yes

String

Definition

Unique ID of an instance

Constraints

N/A

Range

The value can contain 32 characters, including only letters and digits.

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

datastore_type

Yes

String

Definition

Database type

Constraints

N/A

Range

Only RDS for MySQL is supported.

Default Value

N/A

start_at

Yes

Long

Definition

Collection start time

Constraints

Unix timestamp, in milliseconds

Range

[0, 2^31-1]. The actual value depends on the query result.

Default Value

N/A

end_at

Yes

Long

Definition

Collection end time

Constraints

Unix timestamp, in milliseconds

Range

[0, 2^31-1]. The actual value depends on the query result.

Default Value

N/A

page_num

No

Integer

Definition

Number of pages

Constraints

N/A

Range

[1, 2^31-1]

Default Value

N/A

page_size

No

Integer

Definition

Page size

Constraints

N/A

Range

5, 10, 20, and 50

Default Value

N/A

order

No

String

Definition

Sorting field

Constraints

N/A

Range

N/A

Default Value

N/A

order_by

No

String

Definition

Sorting order, which can be ascending or descending

Constraints

N/A

Range

  • asc
  • desc

Default Value

N/A

last_sec_min

No

Long

Definition

Minimum duration

Constraints

N/A

Range

N/A

Default Value

N/A

last_sec_max

No

Long

Definition

Maximum duration

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Definition

Total number of historical transactions

Range

[0, 2^31-1]

transaction_info_list

Array of Table 4 objects

Definition

Historical transaction information

Range

N/A

Table 4 transaction_info_list

Parameter

Type

Description

last_sec

Integer

Definition

Transaction duration

Range

N/A

wait_locks

Integer

Definition

Number of wait locks

Range

N/A

hold_locks

Integer

Definition

Number of held locks

Range

N/A

occurrence_time

Integer

Definition

Occurrence time

Range

N/A

detail

String

Definition

Transaction content

Range

N/A

collect_time

Long

Definition

Collection time

Range

N/A

Example Requests

Querying historical transactions

"GET https://das.cn-north-1.myhuaweicloud.com/v3/054c630ff780d4cc2f40c00d7f6fb21d/instances/a77c88dcfd404a64a466ca2cd2f5b8e5in01/transaction?datastore_type=MySQL&start_at=1&end_at=1717399020000"

Example Responses

Status code: 200

Successful response

{
  "total": 1,
  "transaction_info_list": [
    {
      "collect_time": 1717398965000,
      "last_sec": 5,
      "wait_locks": 3,
      "hold_locks": 3,
      "occurrence_time": 1717398965000,
      "detail": "MySQL thread id 17485282, OS thread handle 140455451772672, query id 48549222 xxx root updating\ndelete from dead_lock_test where v1 = 5 and v2 = 5\n*** HOLDS THE LOCK:\nRECORD LOCKS space id 34691 page no 3 n bits 80 index PRIMARY of table `at_cloud_dba_001`.`dead_lock_test` trx id 690888 lock_mode X locks rec but not gap\nRecord lock, heap no 7 PHYSICAL RECORD: n_fields 5; compact format; info bits 0\n"
    }
  ]
}

Status Codes

Status Code

Description

200

Successful response

400

Client error

500

Server error

Error Codes

See Error Codes.