Obtaining Links for Downloading Slow Query Logs
Function
This API is used to obtain links for downloading slow query logs. The downloaded logs contain only the logs of the primary node.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about request header parameters.
URI
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID of a tenant in a region.
To obtain the value, see Obtaining a Project ID.
Constraints
N/A
Range
N/A
Default Value
N/A
instance_id
Yes
Definition
ID of the instance to be queried.
Constraints
N/A
Range
N/A
Default Value
N/A
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file_name |
No |
String |
Definition Name of the file to be downloaded. To obtain the file name, click the instance name on the console and choose Logs > Slow Query Logs. Constraints This parameter is mandatory for Microsoft SQL Server. Range N/A Default Value N/A |
Example Request
Obtain the link for downloading the slow query log Database_slowlog_name.
POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/slowlog-download { "file_name":"Database_slowlog_name" }
Response
- Normal response
Table 3 Parameters Parameter
Type
Description
list
List
Definition
Indicates the links for downloading slow query logs. For details, see Table 4.
status
String
Definition
Indicates the status of generating links for downloading slow query logs.
Range
- 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
Definition
Indicates the number of links for downloading slow query logs.
Range
N/A
Table 4 linkInfo field data structure description Parameter
Type
Description
workflow_id
String
Definition
Task ID.
Range
For the MySQL DB engine, the value is always "".
file_name
String
Definition
Indicates the name of the generated file for downloading slow query logs.
Range
N/A
status
String
Definition
Indicates the generation status of the current link.
Range
- EXPORTING: indicates that the download link is being generated.
- SUCCESS: indicates that the download link is successfully generated.
- FAILED: indicates that the download link failed to be generated.
file_size
String
Definition
Indicates the file size in KB.
Range
N/A
file_link
String
Definition
Indicates the download link. The link is valid for 5 minutes.
Range
N/A
create_at
Long
Definition
Indicates the generation time.
Range
N/A
update_at
Long
Definition
Indicates the update time.
Range
N/A
- Example normal response
{ "list": [ { "workflow_id": "44fb1d85-2fcc-4d63-ad3b-c3d1ecd7000e", "file_name": "054bc9c1f680d55c1f36c006e5a9f67b_slowlog_download_20200515080614589", "status": "SUCCESS", "file_size": "0", "file_link": "https://rdsbucket.xxxr.obs.cn-xianhz-1.myhuaweicloud.com:443/054bc9c1f680d55c1f36c006e5a9f67b_slowlog_download_20200515080614589?AWSAccessKeyId=1BQ38TBCQHAVQXBUMUTC&Expires=1589530200&response-cache-control=no-cache%2Cno-store&Signature=Fgi4%2BLOJ9frAXyOkz5hRoW5O%2BUM%3D", "create_at": 1589529991385, "update_at": 1589529991385 } ], "status": "finish", "count": 1 }
- Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
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