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:
- Learn how to authenticate it.
- Obtain the required region and endpoint.
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.
URI
GET /v3/{project_id}/instances/{instance_id}/ddl-log
| 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 |
| 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
| 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 Default Value en-us |
Response Parameters
Status code: 200
| 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 |
| 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 |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 500
| 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot