调用DescribeDatabases接口查询PolarDB指定集群的数据库详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 否 | DescribeDatabases |
系统规定参数。取值:DescribeDatabases。 |
DBClusterId | String | 是 | pc-************** |
集群ID。 |
DBName | String | 否 | test_db |
数据库名。 说明 不支持填入多个数据库名称。
|
PageNumber | Integer | 否 | 1 |
页码,取值范围为大于0但不超过Integer最大值的整数,默认值为1。 |
PageSize | Integer | 否 | 30 |
每页记录数,取值范围如下:
默认值为30。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
PageRecordCount | Integer | 1 |
本页记录数。 |
Databases | Array of Database |
数据库信息详情。 |
|
Database | |||
DBDescription | String | test_des |
数据库备注。 |
DBStatus | String | Running |
数据库状态,取值范围如下:
|
DBName | String | test_db |
数据库名称。 |
Engine | String | MySQL |
数据库引擎类型,取值范围如下:
|
CharacterSetName | String | utf8mb4 |
字符集,详情请参见字符集表。 |
Accounts | Array of Account |
数据库账号信息详情。 说明 当集群为PolarDB MySQL引擎时,不含高权限账号。
|
|
Account | |||
PrivilegeStatus | String | Empowered |
授权状态,取值范围如下:
|
AccountStatus | String | Available |
账号状态,取值范围如下:
|
AccountPrivilege | String | ReadOnly |
账号权限,取值范围如下:
|
AccountName | String | test_acc |
账号名称。 说明 当集群为PolarDB MySQL引擎时,不含高权限账号。
|
RequestId | String | E1DF8CA6-2300-448B-9ABF-760C4B****** |
请求ID。 |
PageNumber | Integer | 1 |
页码。 |
示例
请求示例
http(s)://polardb.aliyuncs.com/?Action=DescribeDatabases
&DBClusterId=pc-**************
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeDatabasesResponse>
<PageRecordCount>1</PageRecordCount>
<Databases>
<Database>
<DBName>test_db</DBName>
<CharacterSetName>utf8mb4</CharacterSetName>
<DBStatus>Running</DBStatus>
<Engine>MySQL</Engine>
<DBDescription>test_des</DBDescription>
</Database>
<Database>
<Accounts>
<Account>
<AccountStatus>Available</AccountStatus>
<AccountPrivilege>ReadOnly</AccountPrivilege>
<PrivilegeStatus>Empowered</PrivilegeStatus>
<AccountName>test_acc</AccountName>
</Account>
</Accounts>
</Database>
</Databases>
<RequestId>E1DF8CA6-2300-448B-9ABF-760C4B******</RequestId>
<PageNumber>1</PageNumber>
</DescribeDatabasesResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"PageRecordCount" : 1,
"Databases" : {
"Database" : [ {
"DBName" : "test_db",
"CharacterSetName" : "utf8mb4",
"DBStatus" : "Running",
"Engine" : "MySQL",
"DBDescription" : "test_des"
}, {
"Accounts" : {
"Account" : {
"AccountStatus" : "Available",
"AccountPrivilege" : "ReadOnly",
"PrivilegeStatus" : "Empowered",
"AccountName" : "test_acc"
}
}
} ]
},
"RequestId" : "E1DF8CA6-2300-448B-9ABF-760C4B******",
"PageNumber" : 1
}
错误码
访问错误中心查看更多错误码。