Queries information about databases in a specified PolarDB cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeDatabases |
The operation that you want to perform. Set the value to DescribeDatabases. |
DBClusterId | String | Yes | pc-************** |
The ID of the cluster. |
DBName | String | No | test_db |
The name of the database that you want to query. Note You can specify only one database.
|
PageNumber | Integer | No | 1 |
The number of the page to return. The value must be a positive integer that does not exceed the maximum value of the INTEGER data type. Default value: 1. |
PageSize | Integer | No | 30 |
The number of entries to return on each page. Valid values:
Default value: 30. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
PageRecordCount | Integer | 1 |
The number of entries returned per page. |
Databases | Array of Database |
The information about databases. |
|
Database | |||
DBDescription | String | test_des |
The description of the database. |
DBStatus | String | Running |
The state of the database. Valid values:
|
DBName | String | test_db |
The name of the database. |
Engine | String | MySQL |
The engine that the database runs. Valid values:
|
CharacterSetName | String | utf8mb4 |
The character set that the database uses. For more information, see Character set tables. |
Accounts | Array of Account |
The accounts that can be used to access the database. Note If you run the MySQL database engine on the cluster, the cluster does not support
privileged accounts.
|
|
Account | |||
PrivilegeStatus | String | Empowered |
The authorization state of the account. Valid values:
|
AccountStatus | String | Available |
The state of the account. Valid values:
|
AccountPrivilege | String | ReadOnly |
The permissions that are granted to the account. Valid values:
|
AccountName | String | test_acc |
The username of the account. Note If you run the MySQL database engine on the cluster, the cluster does not support
privileged accounts.
|
RequestId | String | E1DF8CA6-2300-448B-9ABF-760C4B****** |
The ID of the request. |
PageNumber | Integer | 1 |
The page number of the returned page. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=DescribeDatabases
&DBClusterId=pc-**************
&<Common request parameters>
Sample success responses
XML
format
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
format
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
}
Error codes
For a list of error codes, visit the API Error Center.