Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Log Information Queries/ Obtaining Links for Downloading Extended Logs (RDS for SQL Server)
Updated on 2024-06-07 GMT+08:00

Obtaining Links for Downloading Extended Logs (RDS for SQL Server)

Function

This API is used to obtain links for downloading extended logs.

  • Before calling an API, you need to understand the API in Authentication.

Constraints

This API is supported only for RDS for SQL Server.

URI

  • URI format

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

  • Parameter description
    Table 1 Parameters

    Parameter

    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 instance to be queried.

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

file_name

Yes

String

Name of the file to be downloaded. The value cannot be null or empty. It can contain only uppercase letters, lowercase letters, digits, and underscores (_) and ends with .xel.

You can obtain the file name from Querying Extended Logs (RDS for SQL Server).

Example Request

Obtain links for downloading extended logs.

POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/xellog-download

{
	"file_name":"sqlserver_xellog_name.xel"
}

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    list

    List

    List of links for downloading extended logs. For details, see Table 4.

    count

    Integer

    Number of extended log links.

    Table 4 linkInfo field data structure description

    Parameter

    Type

    Description

    file_name

    String

    Name of the generated file for downloading.

    status

    String

    Generation status of the link.

    • FINISH: The download link has been generated.
    • EXPORTING: The file is being generated.
    • FAILED: The log file fails to be prepared.

    file_size

    String

    File size in KB.

    file_link

    String

    Download link. If the link generation status is EXPORTING or FAILED, no value is returned.

    create_at

    String

    Generation time.

    update_at

    String

    Update time.

  • Example normal response
    Generating links for downloading extended logs
    {
        "list": [
            {
                "file_name": "HkEngineEventFile_0_133337769850300000.xel",
                "status": "EXPORTING",
                "file_size": "0",
                "create_at": "2023-08-14T03:35:24+0000",
                "update_at": "2023-08-14T03:35:24+0000"
            }
        ],
        "count": 1
    }
    Links for downloading extended logs obtained successfully
    {
        "list": [
            {
                "file_name": "HkEngineEventFile_0_133337769850300000.xel",
                "status": "SUCCESS",
                "file_size": "0",
                "file_link": "https://obs.xxx:443/xxx-7a95af72c4d54a31ae0663263f0e35ea/6e22b18b43a74e4486264194f6e09f66_EL_HkEngineEventFile_0_133337769850300000.xel?xxx",
                "create_at": "2023-08-14T03:35:41+0000",
                "update_at": "2023-08-14T03:35:41+0000"
            }
        ],
        "count": 1
    }
  • Abnormal response

    For details, see Abnormal Request Results.

Status Code

Error Code

For details, see Error Codes.