Updated on 2025-10-24 GMT+08:00

Obtaining Links for Downloading Slow Query Logs

Description

This API is used to obtain links for downloading slow query logs.

Constraints

The link for downloading slow query logs is valid within 15 minutes after being updated.

URI

  • URI format

    POST /v3/{project_id}/instances/{instance_id}/slowlog-download

  • URI example

    https://dds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/6ade8143870047b8999aba8f1891b48ein02/slowlog-download

Table 1 Path parameters

Name

Mandatory

Type

IN

Description

project_id

Yes

string

path

Explanation:

Project ID of a tenant in a region. To obtain the project ID, see Obtaining a Project ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

instance_id

Yes

string

path

Explanation:

Instance ID, which can be obtained by calling the API described in Querying Instances and Details. If you do not have an instance, call the API described in Creating a DB Instance to create one.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Request Parameters

Table 2 Request header parameters

Name

Mandatory

Type

IN

Description

X-Auth-Token

Yes

string

header

Definition

User token obtained from IAM. For details, see Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 Parameter description

Name

Type

Mandatory

Description

file_name_list

Array of strings

No

The list of the names of the files to be downloaded.

node_id_list

Array of strings

No

The node ID list. If this parameter is left blank, all nodes in the instance can be queried.

For details, see the id value in the nodes data structure table in section "Querying Instances" in the DDS API Reference.

Nodes that can be queried:

  • Shard nodes in a cluster.
  • All nodes in a replica set or single node instance.

Example Requests

Obtaining the link for downloading slow query logs based on the file name list or node ID list
{
"file_name_list":["0541c9f81e80d2201fccc00b92ad6ec0_052f8a12dfed43fbb27c2020e3c3c507no02_slowlog_20201117104809"],
"node_id_list":["052f8a12dfed43fbb27c2020e3c3c507no02"]
}

Response Parameters

  • Parameter description
    Table 4 Parameter description

    Name

    Type

    Description

    list

    List

    The links for downloading slow query logs.

    For details, see Table 5.

    status

    String

    The status of links for downloading slow query logs.

    • FINISH: The download link has been generated.
    • CREATING: A file is being generated and the download link is to be prepared.
    • FAILED: Log files fail to be prepared.

    count

    Integer

    The number of links for downloading slow query logs.

    Table 5 Data structure description of the list field

    Name

    Type

    Description

    node_name

    String

    The node name.

    file_name

    String

    The name of the generated file for downloading slow query logs.

    status

    String

    The status of the current link.

    • SUCCESS: The download link has been generated.
    • EXPORTING: A file is being generated and the download link is to be prepared.
    • FAILED: Log files fail to be prepared.

    file_size

    String

    The file size in KB.

    file_link

    String

    The download link.

    NOTE:

    The download link is valid within 15 minutes after being updated. After the update time expires, the download link will be obtained again.

    update_at

    Long

    The update time.

  • Example Responses
    {
      "list": [
        {
          "node_name": "dds-2a78_replica_node_3",
          "file_name": "054bc9f81e80d2201fccc00b92ad6ec0_ca327a60b3084fa79ce072d7299b905ano02_slowlog_20201117060412",
          "status": "SUCCESS",
          "file_size": "0",
          "file_link": "https://rdsbucket.xxxr.obs.xxxxx.myhuaweicloud.com:443/054bc9c1f680d55c1f36c006e5a9f67b_slowlog_download_20200515080614589?AWSAccessKeyId=1BQ38TBCQHAVQXBUMUTC&Expires=1589530200&response-cache-control=no-cache%2Cno-store&Signature=Fgi4%2BLOJ9frAXyOkz5hRoW5O%2BUM%3D",
          "update_at": 1605593100566
        }
      ],
      "status": "FINISH",
      "count": 1
    }

Status Code

For more information, see Status Code.

Error Code

For more information, see Error Code.