全部产品
Search
文档中心

云数据库 RDS:DescribePGHbaConfig - 查询RDS PostgreSQL实例pg_hba.conf文件配置

更新时间:Mar 13, 2024

该接口用于查询RDS PostgreSQL实例的pg_hba.conf文件的配置。

接口说明

适用引擎

RDS PostgreSQL

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
rds:DescribePGHbaConfigRead
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag

请求参数

名称类型必填描述示例值
ClientTokenstring

预留参数,无需配置。

1
DBInstanceIdstring

实例 ID。可调用 DescribeDBInstances 获取。

pgm-bp1lymyn1v3i****
ResourceGroupIdstring

资源组 ID。

rg-acfmy****

返回参数

名称类型描述示例值
object

返回参数详情。

HbaModifyTimestring

pg_hba.conf 文件最近一次修改的时间。

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

此参数显示 pg_hba.conf 文件最近一次修改状态对应的原因。

The specified users (testuser) is not exist.
RequestIdstring

请求 ID。

A147A124-A147-5CCF-9609-B73C028848DF
LastModifyStatusstring

pg_hba.conf 文件最近一次修改的状态。返回值如下:

  • success:成功
  • setting:设置中
  • failed:失败
success
DefaultHbaItemsobject []

pg_hba.conf 文件的默认配置项列表。

Typestring

连接类型,固定值:host。

host
Maskstring

掩码,固定为空。

null
Databasestring

数据库名称,固定值:all 和 replication。

all
PriorityIdinteger

优先级,自动生成。

0
Addressstring

IP 地址,固定值:0.0.0.0/0。

0.0.0.0/0
Optionstring

认证方式对应配置参数,固定为空。

null
Methodstring

认证方式,固定值:md5。

md5
Userstring

用户名,固定值:all。

all
RunningHbaItemsobject []

pg_hba.conf 文件的当前配置项列表。

Typestring

连接类型,返回值如下:

  • host:该条记录验证 TCP/IP 连接,包括 SSL 连接和非 SSL 连接。
  • hostssl:该条记录只验证通过 SSL 建立的 TCP/IP 连接。
  • hostnossl:该条记录只验证通过非 SSL 建立的 TCP/IP 连接。
host
Maskstring

掩码。

null
Databasestring

数据库名。

all
PriorityIdinteger

优先级。

3
Addressstring

客户端 IP 地址。

0.0.0.0/0
Optionstring

认证方式对应的配置参数。不需要配置时,置为空。

null
Methodstring

认证方式。

md5
Userstring

用户名。

all
DBInstanceIdstring

实例 ID。

rm-bp1****

示例

正常返回示例

JSON格式

{
  "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****"
}

错误码

HTTP status code错误码错误信息描述
400IncorrectDBInstanceTypeCurrent DB instance type does not support this operation.操作失败,该实例状态下不支持此操作。
400InvalidDBInstanceName.NotFoundThe specified DB instance name does not exist.数据库实例名称不存在,请检查。
400Order.ComboInstanceNotAllowOperateA package instance is not allowed to operate independently.套餐实例不允许单独操作。
400Price.PricingPlanResultNotFoundPricing plan price result not found.定价计划价格结果没有找到。
400Order.NoRealNameAuthenticationYou have not passed the real-name authentication and do not meet the purchase conditions. Please log in to the user center for real-name authentication.您还未通过实名认证,不符合购买条件,请登录用户中心进行实名认证。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2022-08-04OpenAPI 错误码发生变更、OpenAPI 入参发生变更、OpenAPI 返回结构发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
入参OpenAPI 入参发生变更
    新增入参:ResourceGroupId
出参OpenAPI 返回结构发生变更
2022-02-14OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    新增错误码:400