首页 云数据库 RDS API参考 API目录 账号 ModifyPGHbaConfig - 修改RDS PostgreSQL实例pg_hba.conf文件配置

ModifyPGHbaConfig - 修改RDS PostgreSQL实例pg_hba.conf文件配置

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

接口说明

适用引擎

RDS PostgreSQL

相关功能文档

注意 使用该接口前,请仔细阅读功能文档,确保完全了解使用接口的前提条件及使用后造成的影响后,再进行操作。

调试

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

调试

授权信息

当前API暂无授权信息透出。

请求参数

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

预留参数,无需配置。

1
DBInstanceIdstring

实例ID。可调用DescribeDBInstances获取。

pgm-bp1lymyn1v3i****
OpsTypestring

配置类型,支持以下几种方式修改AD域服务信息。

  • add:添加一条或多条记录,不能与已有PriorityId参数重复。
  • delete:删除一条或多条记录,将删除当前配置中PriorityId参数取值对应的记录。
  • modify:修改一条或多条记录,将修改当前配置中PriorityId参数取值对应的记录。
  • update:全量更新,将使用传入的配置覆盖当前配置。
add
HbaItemobject []

AD域服务信息列表。

Typestring

连接类型。

支持配置以下取值:

  • host:该条记录验证TCP/IP连接,包括SSL连接和非SSL连接。
  • hostssl:该条记录只验证通过SSL建立的TCP/IP连接。
  • hostnossl:该条记录只验证通过非SSL建立的TCP/IP连接。
说明如果使用hostssl连接类型,需要打开SSL链路加密,具体请参见SSL链路加密
host
Maskstring

掩码。如果Address为IP地址,可以通过此参数指定IP地址的掩码。

0
Databasestring

数据库名。表示允许用户访问的数据库,all表示允许用户访问所有数据库。

如果配置多个,可通过逗号(,)分隔。

all
PriorityIdinteger

表示该条记录的优先级,取值范围:0~10000,0优先级最高。

此参数用于标识每条记录,新增记录时,不允许与已有记录重复。修改或删除时,需要与已有记录的PriorityId相同,用于匹配记录。

2
Addressstring

允许用户从哪个或哪些IP访问数据库,0.0.0.0/0表示允许用户从任意IP地址访问数据库。

0.0.0.0/0
Userstring

允许哪些用户访问数据库,填写实例的用户名。如果配置多个,可通过逗号(,)分隔。

ldapuser
Methodstring

认证方法。支持:

  • trust
  • reject
  • scram-sha-256
  • md5
  • password
  • gss
  • sspi
  • ldap
  • radius
  • cert
  • pam
ldap
Optionstring

认证方式对应的可选参数。本示例使用LDAP认证,需要配置。此参数的更多参数解释,请参见Authentication Methods

ldapserver=192.168.XX.XX ldapbasedn="CN=Users,DC=pgsqldomain,DC=net" ldapbinddn="CN=pgadminuser,CN=Users,DC=pgsqldomain,DC=net" ldapbindpasswd="Test123!" ldapsearchattribute="sAMAccountName"

返回参数

名称类型描述示例值
object

返回参数详情。

RequestIdstring

请求ID。

458E0781-C46C-55F5-A0E5-1DD284B28A3F

示例

正常返回示例

JSON格式

{
  "RequestId": "458E0781-C46C-55F5-A0E5-1DD284B28A3F"
}

错误码

HTTP status code错误码错误信息描述
400HbaItem.InvalidTypeSpecified hba item type is invalid.-
400HbaItem.InvalidMethodSpecified hba item auth method is invalid.指定的hba项身份验证方法无效。
400HbaItem.InvalidIPMaskSpecified hba item ip mask is invalid.-
400HbaItem.InvalidPrioritySpecified hba item priorityId is out of range or duplicate.-
400HbaItemOpsType.InvalidSpecified hba opsType is invalid.-
400InvalidConfigValueThe ConfigValue is not valid-
400MinorVersionNotSupportThe current database minor version does not support the operation.操作失败,当前小版本不支持该操作。
400InvalidDBInstanceName.NotFoundThe specified DB instance name does not exist.数据库实例名称不存在,请检查。
400IncorrectDBInstanceTypeCurrent DB instance type does not support this operation.操作失败,该实例状态下不支持此操作。
403HbaItemPriorityIdAlreadyExistSpecified hba item priorityId is exist.-
403IncorrectDBInstanceStateCurrent DB instance state does not support this operation.当前实例状态不支持此操作。
404HbaItemPriorityIdNotFoundSpecified hba item priorityId is not found.-
404IncorrectDBInstanceLockModeCurrent DB instance lock mode does not support this operation.操作失败,实例处于锁定状态。

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

变更历史

变更时间变更内容概要操作
2022-02-14OpenAPI 错误码发生变更
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
阿里云首页 关系型数据库 相关技术圈