doc-exports/docs/rds/api-ref/rds_05_0039.html
Wang , Deng Ke 21e968a153 rds api 2.0.38sp24 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com>
Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2023-01-12 13:50:31 +00:00

22 KiB

Obtaining Links for Downloading Slow Query Logs

Function

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

Description

You need to do this API in two steps:

For MySQL and PostgreSQL:

  1. Sent empty object "{}" in request body, in order to initiate exporting of download link.
  2. Repeat 1 with same "{}" to receive download link.

For SQLServer:

  1. Sent "file_name": "SQLTrace.trc" in request body, in order to initiate exporting of download link.
  2. Repeat 1 with same "file_name": "SQLTrace.trc" to receive download link.

URI

  • URI format

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

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the 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

    Specifies the ID of the DB instance to be queried.

Request

  • Parameter description
    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    file_name

    No

    String

    Specifies the name of the file to be downloaded.

    This parameter is mandatory for SQL Server.

    The value is SQLTrace.trc

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.

    • EXPORTING: The download link is being generated.
    • SUCCESS: The download link is successfully generated.
    • FAILED: The download link failed to be generated.

    file_size

    String

    Indicates the file size.

    file_link

    String

    Indicates the download link.

    This link is valid for 5 minutes.

    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
    }

Status Code

Error Code

For details, see Error Codes.