调用DescribePGHbaConfig接口查询RDS PostgreSQL实例的pg_hba.conf文件的配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribePGHbaConfig |
系统规定参数。取值:DescribePGHbaConfig。 |
ClientToken | String | 否 | 1 |
预留参数,无需配置。 |
DBInstanceId | String | 是 | pgm-bp1lymyn1v3i**** |
实例ID。可以通过接口DescribeDBInstances查看。 |
ResourceGroupId | String | 否 | rg-acfmy***** |
资源组ID。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
HbaModifyTime | String | 2021-11-25T06:00:40Z |
pg_hba.conf文件最近一次修改的时间。 |
ModifyStatusReason | String | The specified users (testuser) is not exist. |
此参数显示pg_hba.conf文件最近一次修改状态对应的原因。 |
RequestId | String | A147A124-A147-5CCF-9609-B73C028848DF |
请求ID。 |
LastModifyStatus | String | success |
pg_hba.conf文件最近一次修改的状态。返回值如下:
|
DefaultHbaItems | Array of HbaItem |
pg_hba.conf文件的默认配置项列表。 |
|
HbaItem | |||
Type | String | host |
连接类型,固定值:host。 |
Mask | String | null |
掩码,固定为空。 |
Database | String | all |
数据库名称,固定值:all和replication。 |
PriorityId | Integer | 0 |
优先级,自动生成。 |
Address | String | 0.0.0.0/0 |
IP地址,固定值:0.0.0.0/0。 |
Option | String | null |
认证方式对应配置参数,固定为空。 |
Method | String | md5 |
认证方式,固定值:md5。 |
User | String | all |
用户名,固定值:all。 |
RunningHbaItems | Array of HbaItem |
pg_hba.conf文件的当前配置项。 |
|
HbaItem | |||
Type | String | host |
连接类型,返回值如下:
|
Mask | String | null |
掩码。 |
Database | String | all |
数据库名。 |
PriorityId | Integer | 3 |
优先级。 |
Address | String | 0.0.0.0/0 |
客户端IP地址。 |
Option | String | null |
认证方式对应的配置参数。不需要配置时,置为空。 |
Method | String | md5 |
认证方式。 |
User | String | all |
用户名。 |
DBInstanceId | String | rm-bp1***** |
实例ID。 |
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=DescribePGHbaConfig
&ClientToken=1
&DBInstanceId=pgm-bp1lymyn1v3i****
&ResourceGroupId=rg-acfmy*****
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribePGHbaConfigResponse>
<HbaModifyTime>2021-11-25T06:00:40Z</HbaModifyTime>
<ModifyStatusReason/>
<RequestId>A147A124-A147-5CCF-9609-B73C028848DF</RequestId>
<LastModifyStatus>success</LastModifyStatus>
<DefaultHbaItems>
<Type>host</Type>
<Database>all</Database>
<PriorityId>0</PriorityId>
<Address>0.0.0.0/0</Address>
<Method>md5</Method>
<User>all</User>
</DefaultHbaItems>
<RunningHbaItems>
<Type>host</Type>
<Database>all</Database>
<PriorityId>3</PriorityId>
<Address>0.0.0.0/0</Address>
<Method>md5</Method>
<User>all</User>
</RunningHbaItems>
</DescribePGHbaConfigResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"HbaModifyTime" : "2021-11-25T06:00:40Z",
"ModifyStatusReason" : "",
"RequestId" : "A147A124-A147-5CCF-9609-B73C028848DF",
"LastModifyStatus" : "success",
"DefaultHbaItems" : {
"Type" : "host",
"Database" : "all",
"PriorityId" : 0,
"Address" : "0.0.0.0/0",
"Method" : "md5",
"User" : "all"
},
"RunningHbaItems" : {
"Type" : "host",
"Database" : "all",
"PriorityId" : 3,
"Address" : "0.0.0.0/0",
"Method" : "md5",
"User" : "all"
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | IncorrectDBInstanceType | Current DB instance type does not support this operation. | 操作失败,该实例状态下不支持此操作。 |
400 | InvalidDBInstanceName.NotFound | The specified DB instance name does not exist. | 数据库实例名称不存在,请检查。 |
访问错误中心查看更多错误码。