All Products
Search
Document Center

ApsaraDB RDS:DescribePGHbaConfig

Last Updated:Mar 24, 2023

You can call the DescribePGHbaConfig operation to query the configuration of the pg_hba.conf file of an ApsaraDB RDS for PostgreSQL instance.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ClientTokenstringNo

This parameter is reserved. You do not need to specify this parameter.

1
DBInstanceIdstringYes

The ID of the instance. You can call the DescribeDBInstances operation to query the ID of instance.

pgm-bp1lymyn1v3i****
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmy*****

Response parameters

ParameterTypeDescriptionExample
object
HbaModifyTimestring

The time when the previous modification was made to the pg_hba.conf file.

2021-11-25T06:00:40Z
ModifyStatusReasonstring

The reason why the previous modification was made to the pg_hba.conf file.

The specified users (testuser) is not exist.
RequestIdstring

The ID of the request.

A147A124-A147-5CCF-9609-B73C028848DF
LastModifyStatusstring

The status of the previous modification to the pg_hba.conf file.

Valid values:

  • success: The modification is successful.
  • setting: The modification is being applied.
  • failed: The modification fails.
success
DefaultHbaItemsarray

An array that consists of the default configuration items in the pg_hba.conf file.

object
Typestring

The type of connection to the instance. The value is fixed as host.

host
Maskstring

The mask of the instance. The value is fixed as null.

null
Databasestring

The names of the databases that the specified users are allowed to access. The value is fixed as all or replication.

all
PriorityIdinteger

The priority of the configuration items in the pg_hba.conf file. This value is automatically generated.

0
Addressstring

The IP addresses from which the specified users can access the specified databases. The value is fixed as 0.0.0.0/0.

0.0.0.0/0
Optionstring

The value of this parameter is based on the value of the Method parameter. The value is fixed as null.

null
Methodstring

The authentication method. The value is fixed as md5.

md5
Userstring

The user that is allowed to access the instance. The value is fixed as all.

all
RunningHbaItemsarray

An array that consists of the current configuration items in the pg_hba.conf file.

object
Typestring

The type of the connection.

  • host: The record matches TCP/IP connections, including SSL connections and non-SSL connections.
  • hostssl: The record matches only TCP/IP connections that are established over SSL.
  • hostnossl: The record matches only TCP/IP connections that are not established over SSL.
host
Maskstring

The mask of the instance.

null
Databasestring

The name of the database that the specified users are allowed to access.

all
PriorityIdinteger

The priority of the instance.

3
Addressstring

The IP address of the client.

0.0.0.0/0
Optionstring

The value of this parameter varies based on the value of the Method parameter. The value is fixed as null.

null
Methodstring

The authentication method.

md5
Userstring

The username of the account that is used to connect to the instance.

all
DBInstanceIdstring

The ID of the instance.

rm-bp1*****

Examples

Sample success responses

JSONformat

{
  "HbaModifyTime": "2021-11-25T06:00:40Z",
  "ModifyStatusReason": "The specified users (testuser) is not exist.",
  "RequestId": "A147A124-A147-5CCF-9609-B73C028848DF",
  "LastModifyStatus": "success",
  "DefaultHbaItems": {
    "HbaItem": [
      {
        "Type": "host",
        "Mask": "null",
        "Database": "all",
        "PriorityId": 0,
        "Address": "0.0.0.0/0",
        "Option": "null",
        "Method": "md5",
        "User": "all"
      }
    ]
  },
  "RunningHbaItems": {
    "HbaItem": [
      {
        "Type": "host",
        "Mask": "null",
        "Database": "all",
        "PriorityId": 3,
        "Address": "0.0.0.0/0",
        "Option": "null",
        "Method": "md5",
        "User": "all"
      }
    ]
  },
  "DBInstanceId": "rm-bp1*****"
}

Error codes

HTTP status codeError codeError messageDescription
400IncorrectDBInstanceTypeCurrent DB instance type does not support this operation.The operation failed. The RDS instance is not in a ready state.
400InvalidDBInstanceName.NotFoundThe specified DB instance name does not exist.The instance name does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-08-04The error codes of the API operation change.,The input parameters of the API operation change.,The response structure of the API operation changes.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: ResourceGroupId
Output ParametersThe response structure of the API operation changes.
2022-02-14The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Added Error Codes: 400