doc-exports/docs/dds/api-ref/dds_api_0094.html
Wang , Deng Ke 60010eb9d0 dds 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-13 08:55:41 +00:00

20 KiB

Obtaining Links for Downloading Slow Query Logs

Function

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

Constraints

The link for downloading slow query logs is valid within 15 minutes after being updated.

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.

    instance_id

    Yes

    Specifies the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.

Requests

Responses

  • Parameter description
    Table 2 Parameter description

    Name

    Type

    Description

    list

    List

    Indicates the download links of slow query logs.

    For details, see Table 3.

    status

    String

    Indicates the status of 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 3 list field data structure description

    Name

    Type

    Description

    node_name

    String

    Indicates the node name.

    file_name

    String

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

    status

    String

    Indicates the status of the current link.

    • SUCCESS: The download link has been generated.
    • EXPORTING: A file is being generated and the download link is to be prepared.
    • FAILED: Log files fail to be prepared.

    file_size

    String

    Indicates the file size in KB.

    file_link

    String

    Indicates the download link.

    NOTE:

    The download link is valid within 15 minutes after being updated. After the update time expires, the download link will be exported again.

    update_at

    Long

    Indicates the update time.

  • Response example

    1. If the body parameter is not specified, the following information is returned:
    {
        "list": [
            {
                "node_name": "dds-4ff4_replica_node_1",
                "file_name": "88f9e7914ab149049bbb57bc83b3f296_599fd21891264a348822db4c6fd7e6f7no02_slowlog_20221028070301",
                "status": "SUCCESS",
                "file_size": "0",
                "file_link": "https://obs.cn-datebase-ssh.myhuaweicloud.com:443/dbsbucket.cn.datebase.ssh.a5b2d082b6264f249283eed2b612e934/88f9e7914ab149049bbb57bc83b3f296_599fd21891264a348822db4c6fd7e6f7no02_slowlog_20221028070301?AWSAccessKeyId=IUMLNBNX6IDB9ERZTLBR&Expires=1666941149&response-cache-control=no-cache%2Cno-store&Signature=t%2FZCh1%2BNufd6tsg%2BG1KtPdW3c%2FE%3D",
                "updated_at": 1666940603596
            },
            {
                "node_name": "dds-4ff4_replica_node_2",
                "file_name": "88f9e7914ab149049bbb57bc83b3f296_8fa3da0256e14f8ab6ca118463f308bfno02_slowlog_20221028070301",
                "status": "SUCCESS",
                "file_size": "0",
                "file_link": "https://obs.cn-datebase-ssh.myhuaweicloud.com:443/dbsbucket.cn.datebase.ssh.a5b2d082b6264f249283eed2b612e934/88f9e7914ab149049bbb57bc83b3f296_8fa3da0256e14f8ab6ca118463f308bfno02_slowlog_20221028070301?AWSAccessKeyId=IUMLNBNX6IDB9ERZTLBR&Expires=1666941149&response-cache-control=no-cache%2Cno-store&Signature=NIjwbCBbiffqHFP7086vaxeLPgs%3D",
                "updated_at": 1666940606118
            },
            {
                "node_name": "dds-4ff4_replica_node_3",
                "file_name": "88f9e7914ab149049bbb57bc83b3f296_af6b1afbbc7b4453a2cfb5bcc1d0a587no02_slowlog_20221028070301",
                "status": "SUCCESS",
                "file_size": "0",
                "file_link": "https://obs.cn-datebase-ssh.myhuaweicloud.com:443/dbsbucket.cn.datebase.ssh.a5b2d082b6264f249283eed2b612e934/88f9e7914ab149049bbb57bc83b3f296_af6b1afbbc7b4453a2cfb5bcc1d0a587no02_slowlog_20221028070301?AWSAccessKeyId=IUMLNBNX6IDB9ERZTLBR&Expires=1666941149&response-cache-control=no-cache%2Cno-store&Signature=LpdZPw0UTk9mm1QdNBcBTeLJ4c0%3D",
                "updated_at": 1666940591261
            }
        ],
        "status": "FINISH",
        "count": 3
    }

    2. If the body parameter is specified, the following information is returned:
    {
      "list": [
        {     
          "node_name": "node_1",
          "file_name": "054bc9c1f680d55c1f36c006e5a9f67b_slowlog_download_20200515080614589",
          "status": "SUCCESS",
          "file_size": "0",
          "file_link": "https://rdsbucket.opxxx.svc.rds.xxxxx.cnxianhz1.ur.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",
          " updated_at ": 1589529991385
        }
      ],
      "status": "FINISH",
      "count": 1
    }

    3. If the download link expires, you will receive the following response:

    {
        "list": [
            {
                "node_name": "dds-4ff4_replica_node_1",
                "file_name": "88f9e7914ab149049bbb57bc83b3f296_599fd21891264a348822db4c6fd7e6f7no02_slowlog_20221028070301",
                "status": "EXPORTING",
                "file_size": null,
                "file_link": null,
                "updated_at": 1666940603596
            },
            {
                "node_name": "dds-4ff4_replica_node_2",
                "file_name": "88f9e7914ab149049bbb57bc83b3f296_8fa3da0256e14f8ab6ca118463f308bfno02_slowlog_20221028070301",
                "status": "EXPORTING",
                "file_size": null,
                "file_link": null,
                "updated_at": 1666940606118
            },
            {
                "node_name": "dds-4ff4_replica_node_3",
                "file_name": "88f9e7914ab149049bbb57bc83b3f296_af6b1afbbc7b4453a2cfb5bcc1d0a587no02_slowlog_20221028070301",
                "status": "EXPORTING",
                "file_size": null,
                "file_link": null,
                "updated_at": 1666940591261
            }
        ],
        "status": "CREATING",
        "count": 3
    }

Status Code

Status Code:200.

For more information, see Status Code.

Error Code

For more information, see Error Code.