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. 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 | Details 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 type of the database engine. Valid values:
|
MasterID | String | 2 | The ID of the primary node in the cluster of Multi-master Cluster (Database/Table) Edition. |
CharacterSetName | String | utf8mb4 | The character set that the database uses. For more information, see Character set tables. |
Accounts | Array of Account | Details about accounts. Note For a PolarDB for MySQL cluster, privileged accounts are not included. | |
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 name of the account. Note For a PolarDB for MySQL cluster, privileged accounts are not included. |
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 response
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeDatabasesResponse>
<PageRecordCount>1</PageRecordCount>
<Databases>
<DBDescription>test_des</DBDescription>
<DBStatus>Running</DBStatus>
<DBName>test_db</DBName>
<Engine>MySQL</Engine>
<MasterID>2</MasterID>
<CharacterSetName>utf8mb4</CharacterSetName>
<Accounts>
<PrivilegeStatus>Empowered</PrivilegeStatus>
<AccountStatus>Available</AccountStatus>
<AccountPrivilege>ReadOnly</AccountPrivilege>
<AccountName>test_acc</AccountName>
</Accounts>
</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" : [ {
"DBDescription" : "test_des",
"DBStatus" : "Running",
"DBName" : "test_db",
"Engine" : "MySQL",
"MasterID" : "2",
"CharacterSetName" : "utf8mb4",
"Accounts" : [ {
"PrivilegeStatus" : "Empowered",
"AccountStatus" : "Available",
"AccountPrivilege" : "ReadOnly",
"AccountName" : "test_acc"
} ]
} ],
"RequestId" : "E1DF8CA6-2300-448B-9ABF-760C4B******",
"PageNumber" : 1
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | The error message returned because the specified DBClusterId parameter is invalid. |
400 | InvalidPageSize.Malformed | The specified parameter PageSize is not valid. | The error message returned because the specified PageSize parameter is invalid. |
400 | InvalidPageNumber.Malformed | The specified parameter PageNumber is not valid. | The error message returned because the specified PageNumber parameter is invalid. |
400 | Database.ConnectError | db instance %s connect failed, please check instance status and database processlist | The error message returned because the cluster %s is not connected. Check the cluster status and database process list. |
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | The error message returned because the specified cluster ID does not exist in the current record. |
For a list of error codes, see Service error codes.