Help Center/ Relational Database Service/ API Reference/ API v3 (Recommended)/ Log Information Queries/ Obtaining Links for Downloading Error Logs (RDS for PostgreSQL)
Updated on 2024-08-28 GMT+08:00

Obtaining Links for Downloading Error Logs (RDS for PostgreSQL)

Function

This API is used to obtain links for downloading error logs of a DB instance.

You need to call this API repeatedly until FINISH is returned for status.

Or, you can use the workflow_id value returned by the first API call to query the task status. After the task is successfully executed, call the API again to obtain the download link.

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

Constraints

This API can only be used to obtain links for downloading error logs of an available instance.

URI

  • URI format

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

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Explanation:

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    Constraints:

    N/A

    Value range:

    N/A

    Default value:

    N/A

    instance_id

    Yes

    Explanation:

    ID of the instance to be queried.

    Constraints:

    N/A

    Value range:

    N/A

    Default value:

    N/A

Request

  • Parameter description

    None

  • URI example

    POST https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/3d39c18788b54a919bab633874c159dfin01/errorlog-download

Response

  • Normal response
    Table 2 Parameters

    Parameter

    Type

    Description

    list

    Array of objects

    Explanation:

    List of links for downloading error logs. For details, see Table 3.

    status

    String

    Explanation:

    Status of the error log download link.

    Value range:

    • FINISH: The download link has been generated.
    • CREATING: A file is being generated and the download link is being prepared.
    • FAILED: The log file fails to be prepared.

    count

    Integer

    Explanation:

    Number of error log links.

    Value range:

    N/A

    Table 3 Data structure description of the list field

    Parameter

    Type

    Description

    workflow_id

    String

    Explanation:

    Task ID.

    Value range:

    N/A

    file_name

    String

    Explanation:

    Name of the generated file for downloading.

    Value range:

    N/A

    status

    String

    Explanation:

    Status of the current link.

    Value range:

    N/A

    file_size

    String

    Explanation:

    File size.

    Value range:

    N/A

    file_link

    String

    Explanation:

    Download link.

    Value range:

    N/A

    create_at

    Long

    Explanation:

    Generation time.

    Value range:

    N/A

    update_at

    Long

    Explanation:

    Update time.

    Value range:

    N/A

  • Example normal response

    Link for downloading error logs obtained successfully.

    { 
       "list" : [ { 
         "workflow_id" : "44fb1d85-2fcc-4d63-ad3b-c3d1ecd7000e", 
         "file_name" : "054bc9c1f680d55c1f36c006e5a9f67b_errorlog_download_20200515080614589", 
         "file_size" : "0", 
         "file_link" : "https://rdsbucket.xxx.myhuaweicloud.com:443/054bc9c1f680d55c1f36c006e5a9f67b_errorlog_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

Error Code

For details, see Error Codes.