Help Center/ TaurusDB/ API Reference/ APIs (Recommended)/ Log Management/ Obtaining Links for Downloading Slow Query Logs
Updated on 2025-09-04 GMT+08:00

Obtaining Links for Downloading Slow Query Logs

Function

This API is used to obtain links for downloading slow query logs. Before calling this API:

URI

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

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.

Constraints

N/A

Range

The value contains 36 characters with a suffix of in07. Only letters and digits are allowed.

Default Value

N/A

node_id

Yes

String

Definition

Node ID.

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

Request Parameters

Table 2 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

  • zh-cn

Default Value

en-us

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

list

Array of DownloadSlowLogFileItem objects

Definition

Links for downloading slow query logs.

count

Integer

Definition

Number of slow query logs.

Range

N/A

Table 4 DownloadSlowLogFileItem

Parameter

Type

Description

job_id

String

Definition

Task ID.

Range

N/A

file_name

String

Definition

File name.

Range

N/A

status

String

Definition

Download status.

Range

  • SUCCESS: The download link has been generated.

  • EXPORTING: The download link is being generated.

  • FAILED: The download link failed to be generated.

file_size

String

Definition

File size, in KB.

Range

N/A

file_link

String

Definition

Download link. The link is valid for 5 minutes.

Range

N/A

create_at

Long

Definition

Creation time.

Range

N/A

updated_at

Long

Definition

Update time.

Range

N/A

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Obtaining links for downloading slow query logs

POST https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/6754902da1f447269c6979b0590102a5in07/941d21130b3c4899ad1a752a0945befdno07/slowlog-download

Example Response

Status code: 200

Success.

{
  "list" : [ {
    "job_id" : "73a5f4df-a111-4e09-b543-5ff3863eda71",
    "file_name" : "62b83dfd385f4d96afa6c7afd36dad7b_gaussdbformysql_slowlog_download_20240816081247776",
    "status" : "SUCCESS",
    "file_size" : 0,
    "file_link" : "https://obs.cn-southwest-244.ulanqab.huawei.com:443/dbsbucket-0-cn-southwest-244-ea3ffcbdb5cc4b5789a77884f9******/62b83dfd385f4d96afa6c7afd36dad7b_gaussdbformysql_slowlog_download_20240816081247776?AWSAccessKeyId=********************&Expires=1723796280&response-cache-control=no-cache%2Cno-store&Signature=51RXPvQJg2RSolfqCHOqF5********",
    "create_at" : 1723795967769,
    "updated_at" : 1723795980907
  } ],
  "count" : 1
}

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.