Queries the database details of a specified PolarDB cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | No | 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 a database. Note You can specify only one database name.
|
PageNumber | Integer | No | 1 |
The number of the page to return. The value must be an integer that is larger than 0. 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 |
---|---|---|---|
Databases | Array of Database |
The details of the database. |
|
Database | |||
Accounts | Array of Account |
The details of the database account. Note Privileged accounts are excluded.
|
|
Account | |||
AccountName | String | test_acc |
The name of the account. Note Privileged accounts are excluded.
|
AccountPrivilege | String | ReadOnly |
The permissions of the account. Valid values:
|
AccountStatus | String | Available |
The status of the account. Valid values:
|
PrivilegeStatus | String | Empowered |
The authorization status. Valid values:
|
CharacterSetName | String | utf8mb4 |
The character set. For more information, see Character set. |
DBDescription | String | test_des |
The description of the database. |
DBName | String | test_db |
The name of the database. |
DBStatus | String | Running |
The of the database. Valid values:
|
Engine | String | MySQL |
The type of the database engine. Valid values:
|
PageNumber | Integer | 1 |
The page number of the returned page. |
PageRecordCount | Integer | 1 |
The number of entries returned on the current page. |
RequestId | String | E1DF8CA6-2300-448B-9ABF-760C4B****** |
The ID of the request. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/? Action=DescribeDatabases
&DBClusterId=pc-**************
&<Common request parameters>
Sample success responses
XML
format
<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
{
"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.