Help Center> GaussDB> API Reference> APIs (Recommended)> Log Management> Creating a Slow Query Log Download Task
Updated on 2024-07-12 GMT+08:00

Creating a Slow Query Log Download Task

Function

This API is used to create a slow query log download task. Before calling this API:

URI

POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/slow-log/download

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID, which is compliant with the UUID format.

Request Parameters

None

Response Parameters

Table 2 Response body parameters

Parameter

Type

Description

list

Array of SlowLogDownloadInfo objects

Downloaded slow query log information. For details, see Table 3.

Table 3 SlowLogDownloadInfo field data structure description

Parameter

Type

Description

id

String

Slow query log ID.

instance_id

String

Instance ID.

node_id

String

Node ID.

workflow_id

String

Workflow ID.

file_name

String

File name.

file_size

String

File size in bytes.

file_link

String

Link for downloading the file.

bucket_name

String

Bucket name

created_at

Long

Creation time.

updated_at

Long

Update time.

version

String

Version.

status

String

Status.

message

String

Message.

Example Request

POST https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cc6fd964d93f4003851dfc29d57d30a5in14/slow-log/download

Example Response

When a request is delivered for the first time, the response is an empty list.

{ 
  "list" : [] 
}
{ 
  "list" : [ { 
    "id" : "64d7bad3-6665-4590-baa2-eb5394e49625", 
    "instance_id" : "9b2f4cc6cd584c67bc179a2bfbb37f90in14", 
    "node_id" : "9d8c79cc41074452977a564b335220f5no14", 
    "workflow_id" : "7d77153c12dde-4f3c-a333-7d30503267f2", 
    "file_name" : "c7025305deb34ae9af1be94f698e7949_slowlog_download__9d8c79cc41074452977a564b335220f5no1420230823024331782", 
    "file_size" : "719.0", 
    "file_link" : "***", 
    "bucket_name" : null, 
    "created_at" : 1692758611782, 
    "updated_at" : 1692758611782, 
    "version" : null, 
    "status" : "EXPORTING", 
    "message" : null 
  }, { 
    "id" : "4712c3b1-d26a-49d4-9652-211d6ac106c5", 
    "instance_id" : "9b2f4cc6cd584c67bc179a2bfbb37f90in14", 
    "node_id" : "9d03b0a73ebd415eb2f692862f326cb7no14", 
    "workflow_id" : "7d77153c12dde-4805-bd0b-d70c803a873a", 
    "file_name" : "c7025305deb34ae9af1be94f698e7949_slowlog_download__9d03b0a73ebd415eb2f692862f326cb7no1420230823024331727", 
    "file_size" : "719.0", 
    "file_link" : "***", 
    "bucket_name" : null, 
    "created_at" : 1692758611727, 
    "updated_at" : 1692758611727, 
    "version" : null, 
    "status" : "EXPORTING", 
    "message" : null 
  } ] 
}

Status Code

Error Code

For details, see Error Codes.