Help Center/ TaurusDB/ API Reference/ APIs (Recommended)/ Log Management/ Querying DDL Logs That Can Be Downloaded
Updated on 2026-06-12 GMT+08:00

Querying DDL Logs That Can Be Downloaded

Function

This API is used to query the DDL logs that can be downloaded of a specified instance. Before calling this API:

Calling Method

For details, see Calling APIs.

Authorization Information

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

  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • 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

    Dependency

    gaussdbformysql:log:list

    List

    instance *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    gaussdb:log:list

    -

URI

GET /v3/{project_id}/instances/{instance_id}/ddl-log

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 contains 32 characters. Only letters and digits are allowed.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID, which uniquely identifies an instance.

To obtain this value, see Querying DB Instances.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

node_id

Yes

String

Definition

Instance node ID.

To obtain this value, see Querying Details of a DB Instance.

Constraints

N/A

Range

The value contains 36 characters, starting with a UUID and ending with no07. Only letters and digits are allowed.

Default Value

N/A

offset

No

Integer

Definition

Index offset. The query starts from the next piece of data indexed by this parameter.

Constraints

The value must be an integer and cannot be a negative number.

Range

≥ 0

Default Value

0

limit

No

Integer

Definition

Number of records displayed on each page.

Constraints

N/A

Range

1–100

Default Value

10

start_time

No

String

Definition

Start time in the yyyy-mm-ddThh:mm:ssZ format.

T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the offset is +0800.

Constraints

N/A

Range

N/A

Default Value

N/A

end_time

No

String

Definition

End time in the yyyy-mm-ddThh:mm:ssZ format.

T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the offset is +0800.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. To obtain this value, call the IAM API for obtaining a user token.

The value of X-Subject-Token in the response header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Request language type.

Constraints

N/A

Range

  • en-us: English

  • zh-cn: Chinese

Default Value

en-us

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

ddl_logs

Array of DdlLogInfo objects

Definition

List of DDL logs that can be downloaded.

total_count

Integer

Definition

Total records.

Range

N/A

keep_days

Integer

Definition

Log retention period.

Range

N/A

switch_status

String

Definition

Whether DDL log download is enabled.

Range

  • ON: enabled

  • OFF: disabled

Table 5 DdlLogInfo

Parameter

Type

Description

id

String

Definition

Log file ID.

Range

N/A

file_name

String

Definition

Log file name.

Range

N/A

file_size

Integer

Definition

Log file size, in bytes.

Range

N/A

create_time

String

Definition

Creation time for log file upload.

Range

N/A

end_time

String

Definition

End time for log file upload.

Range

N/A

status

String

Definition

Log file status.

Range

  • Active: The log file is active.

  • Disable: The log file is unavailable.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying DDL logs that can be downloaded

GET https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/instances/7e8dfe8f580043d4a424f65b51c0e1f0in07/ddl-log&node_id=3f84063164ee4a308d02a050234d32e3no07&offset=0&limit=10

Example Response

Status code: 200

Success.

{
  ddl_logs" : [ {
    "id" : "a193e8a9f1cdt49d886153ced55b5b661br07",
    "file_name" : "20260325190036_OmaLog",
    "file_size" : 1024000,
    "create_time" : "2026-03-25 12:00:00",
    "end_time" : "2026-03-25 13:00:00",
    "status" : "Active"
  }, {
    "id" : "3f18b461f8a8t4a4539b2a76151bbb0b0br07",
    "file_name" : "20260325150000_OmaLog",
    "file_size" : 1844832,
    "create_time" : "2026-03-25 06:59:34",
    "end_time" : "2026-03-25 07:59:29",
    "status" : "Active"
  } ],
  "keep_days" : 7,
  "switch_status" : true,
  "total_count" : 2
}

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.