Updated on 2024-04-13 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 an API, you need to understand the API in Authentication.

URI

  • URI format

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

  • Example

    https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/slowlog-download

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    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

    ID of the DB instance to be queried.

Request

  • Parameter description
    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    request_id

    Yes

    String

    Request ID. Enter any request ID in the UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) and use the request ID to call the API to obtain the workflow ID for generating the slow query log download link. For details, see Table 4.

    Use the obtained workflow ID as the request ID and call the API again to obtain the link for downloading the slow query logs of the instance.

    file_name

    No

    String

    Name of the file to be downloaded.

  • Request example
    Obtain the workflow ID for generating the slow query log download link:
    {
    	"request_id":"6e0e7ee2-a3b5-4bc1-a5a8-cb2987ac4771"
    }
    Obtain the link for downloading slow query logs:
    {
    	"request_id":"0202bf1a-4181-48b9-bdd8-27ea4cef05b2"
    }

Response

  • Normal response
    Table 3 Parameter description

    Name

    Type

    Description

    list

    List

    Indicates the links for downloading slow query logs. For details, see Table 4.

    status

    String

    Indicates the status of generating 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

    Indicates the number of links for downloading slow query logs.

    Table 4 linkInfo field data structure description

    Name

    Type

    Description

    workflow_id

    String

    Indicates the workflow ID.

    file_name

    String

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

    status

    String

    Indicates the generation status of the current link.

    file_size

    String

    Indicates the file size.

    file_link

    String

    Indicates the download link.

    create_at

    Long

    Indicates the generation time.

  • Example normal response
    Generating the link for downloading slow query logs:
    {
        "list": [
            {
                "workflow_id": "0202bf1a-4181-48b9-bdd8-27ea4cef05b2",
                "file_name": "054bc98b0a80d39b1faec01373f2f339_slowlog_download_20211117091141667",
                "status": "EXPORTING",
                "create_at": 1637140301659
            }
        ],
        "status": "CREATING",
        "count": 1
    }
    Link for downloading slow query logs obtained successfully:
    {
        "list": [
            {
                "workflow_id": "0202bf1a-4181-48b9-bdd8-27ea4cef05b2",
                "file_name": "054bc98b0a80d39b1faec01373f2f339_slowlog_download_20211117091141667",
                "status": "SUCCESS",
                "file_size": "922",
                "file_link": "https://rdsbucket.opxxx.svc.rds.xxxxx",
                "create_at": 1637140315066
            }
        ],
        "status": "FINISH",
        "count": 1
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.