Queries the databases 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 PolarDB cluster.

DBName String No testdb

The name of the database.

Note You cannot specify multiple database names.

Response parameters

Parameter Type Example Description
Databases Array of Database

The list of databases.

Database
Accounts Array of Account

The list of database accounts.

Note Privileged accounts are excluded.
Account
AccountName String test_acc

The name of the account.

Note Privileged accounts are excluded.
AccountPrivilege String ReadIndex

The account permission. Valid values:

  • ReadWrite: The account has the read and write permissions on the databases.
  • ReadOnly: The account has the read permissions on the databases.
  • 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 and index permissions on the databases.
AccountStatus String Available

The account status. 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 revoking 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 testdb

The name of the database.

DBStatus String Running

The database status. Valid values:

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

The database engine.

RequestId String 6BD026D5-BF5B-4B4C-869C-7EB70F******

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>
  <Databases>
        <Database>
              <CharacterSetName>utf8mb4</CharacterSetName>
              <DBDescription>test_des</DBDescription>
              <DBName>testdb</DBName>
              <DBStatus>Running</DBStatus>
              <Engine>POLARDB</Engine>
              <Accounts>
                    <Account>
                          <AccountStatus>Available</AccountStatus>
                          <AccountPrivilege>ReadIndex</AccountPrivilege>
                          <PrivilegeStatus>Empowered</PrivilegeStatus>
                          <AccountName>test_acc</AccountName>
                    </Account>
              </Accounts>
        </Database>
  </Databases>
  <RequestId>6BD026D5-BF5B-4B4C-869C-7EB70F******</RequestId>
</DescribeDatabasesResponse>

JSON format

{
    "Databases": {
        "Database": [
            {
                "CharacterSetName": "utf8mb4",
                "DBDescription": "test_des",
                "DBName": "testdb",
                "DBStatus": "Running",
                "Engine": "POLARDB",
                "Accounts": {
                    "Account": [
                        {
                            "AccountStatus": "Available",
                            "AccountPrivilege": "ReadIndex",
                            "PrivilegeStatus": "Empowered",
                            "AccountName": "test_acc"
                        }
                    ]
                }
            }
        ]
    },
    "RequestId": "6BD026D5-BF5B-4B4C-869C-7EB70F******"
}

Error codes

For a list of error codes, visit the API Error Center.