Queries the database details of a specified PolarDB cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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:

  • 30
  • 50
  • 100

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:

  • ReadWrite: The account has the read and write permissions on the database.
  • ReadOnly: The account has the read-only permissions on the database.
  • DMLOnly: The account has the permissions to execute only data manipulation language (DML) statements on the databases.
  • DDLOnly: The account has the permissions to execute only data definition language (DDL) statements on the databases.
  • ReadIndex: The account has the read-only and index permissions on the database.
AccountStatus String Available

The status of the account. Valid values:

  • Creating: The account is being created.
  • Available: The account is available.
  • Deleting: The account is being deleted.
PrivilegeStatus String Empowered

The authorization status. Valid values:

  • Empowering: The system is granting permissions to the account.
  • Empowered: The system has granted permissions to the account.
  • Removing: The system is removing permissions from the account.
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:

  • Creating: The database is being created.
  • Running: The database is running.
  • Deleting: The database is being deleted.
Engine String MySQL

The type of the database engine. Valid values:

  • MySQL
  • Oracle
  • PostgreSQL
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.