Updated on 2025-08-20 GMT+08:00

Querying the pg_hba.conf Change History of a DB Instance

Function

This API is used to query the pg_hba.conf change history of a DB instance.

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/hba-info/history

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Instance ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    Table 2 Request parameters

    Parameter

    Mandatory

    Type

    Description

    start_time

    No

    String

    Definition

    Start time.

    Constraints

    N/A

    Range

    N/A

    Default Value

    If this parameter is not specified, 00:00 (UTC time zone) on the current day is used by default.

    end_time

    No

    String

    Definition

    End time.

    Constraints

    N/A

    Range

    N/A

    Default Value

    If this parameter is not specified, the current time (UTC time zone) is used by default.

Request

  • Request parameters

    None

  • URI example

    GET https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/e28979107ed04d3b8b2f1b819b8d2be3in03/hba-info/history?start_time=2023-08-01 00:00:00&end_time=2023-08-03 00:00:00

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    Array elements

    Array of objects

    Definition

    Parameter list.

    For details, see Table 4.

    Table 4 Parameters

    Parameter

    Type

    Description

    status

    String

    Definition

    Change result.

    Range

    • success: The change has taken effect.
    • failed: The change did not take effect.
    • setting: The change is in progress.

    time

    String

    Definition

    Time when the change was made.

    Range

    N/A

    fail_reason

    String

    Definition

    Reason for a change failure.

    Range

    N/A

    before_confs

    Array of objects

    Definition

    Original values.

    For details, see Table 5.

    after_confs

    Array of objects

    Definition

    New values.

    For details, see Table 6.

    Table 5 before_confs field description

    Parameter

    Type

    Description

    type

    String

    Definition

    Connection type.

    Range

    Enumerated values: host, hostssl, and hostnossl

    database

    String

    Definition

    Database name.

    Range

    The value can be any name other than template0 and template1. Use commas (,) to separate multiple names.

    user

    String

    Definition

    Name of a user other than rdsAdmin, rdsMetric, rdsBackup, rdsRepl, and rdsProxy.

    Range

    • all indicates all database users of the DB instance.
    • Use commas (,) to separate multiple usernames.

    address

    String

    Definition

    Client IP address. 0.0.0.0/0 indicates that the user can access the database from any IP address.

    Range

    N/A

    mask

    String

    Definition

    Subnet mask.

    Range

    The value is an empty character string by default.

    method

    String

    Definition

    Authentication mode.

    Range

    Enumerated values: reject, md5, and scram-sha-256

    priority

    Integer

    Definition

    Configuration priority.

    Range

    N/A

    Table 6 after_confs field description

    Parameter

    Type

    Description

    type

    String

    Definition

    Connection type.

    Range

    Enumerated values: host, hostssl, and hostnossl

    database

    String

    Definition

    Database name.

    Range

    The value can be any name other than template0 and template1. Use commas (,) to separate multiple names.

    user

    String

    Definition

    Name of a user other than rdsAdmin, rdsMetric, rdsBackup, rdsRepl, and rdsProxy.

    Range

    • all indicates all database users of the DB instance.
    • Use commas (,) to separate multiple usernames.

    address

    String

    Definition

    Client IP address. 0.0.0.0/0 indicates that the user can access the database from any IP address.

    Range

    N/A

    mask

    String

    Definition

    Subnet mask.

    Range

    The value is an empty character string by default.

    method

    String

    Definition

    Authentication mode.

    Range

    Enumerated values: reject, md5, and scram-sha-256

    priority

    Integer

    Definition

    Configuration priority.

    Range

    N/A

  • Example normal response
    [ { 
       "status" : "success", 
       "time" : "2023-08-01 09:00:00", 
       "fail_reason" : "", 
       "before_confs" : [ { 
         "type" : "host", 
         "database" : "all", 
         "user" : "all", 
         "address" : "0.0.0.0/0", 
         "mask" : "", 
         "method" : "md5", 
         "priority" : 0 
       } ], 
       "after_confs" : [ { 
         "type" : "hostssl", 
         "database" : "all", 
         "user" : "all", 
         "address" : "0.0.0.0/0", 
         "mask" : "", 
         "method" : "md5", 
         "priority" : 0 
       } ] 
     } ]

Status Code

Error Code

For details, see Error Codes.