All Products
Search
Document Center

ApsaraDB RDS:DescribeDatabases

Last Updated:Mar 13, 2024

Queries the details about the databases on an instance.

Operation description

Supported database engines

  • MySQL
  • PostgreSQL
  • SQL Server
  • MariaDB

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
rds:DescribeDatabasesREAD
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID. You can call the DescribeDBInstances operation to query the instance ID.

rm-uf6wjk5****
DBNamestringNo

The name of the database.

testDB01
DBStatusstringNo

The status of the database. Valid values:

  • Creating
  • Running
  • Deleting
Creating
PageSizeintegerNo

The number of entries per page. Valid values:

  • 30
  • 50
  • 100

Default value: 30.

30
PageNumberintegerNo

The page number. Pages start from page 1.

Default value: 1.

1
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmy****

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

2603CA96-B17D-4903-BC04-61A2C829CD94
Databasesobject []

The information about the database.

DBDescriptionstring

The description of the database.

testdb
DBStatusstring

The database status. Valid values:

  • Creating
  • Running
  • Deleting
Creating
DBNamestring

The database name.

testDB01
DBInstanceIdstring

The ID of the instance to which the database belongs.

rm-uf6wjk5****
Enginestring

The database engine of the instance.

MySQL
CharacterSetNamestring

The name of the character set.

utf8
Collatestring

The collation of the character set. The example value C stands for localization.

Note This parameter is returned only for instances that run PostgreSQL.
C
Ctypestring

The type of the character set.

Note This parameter is returned only for instances that run PostgreSQL.
en_US.utf8
ConnLimitstring

The limit on the number of concurrent requests. The value -1 indicates that the number of concurrent requests is unlimited.

Note This parameter is returned only for instances that run PostgreSQL.
-1
Tablespacestring

The database tablespace.

Note This parameter is returned only for instances that run PostgreSQL.
pg_default
ResourceGroupIdstring

The resource group ID.

rg-acfmy****
Accountsobject []

The information about the account. Each account has specific permissions on the database.

Accountstring

The account username.

test
AccountPrivilegestring

The permissions that the account has on the database. Valid values:

  • ReadWrite: read and write permissions
  • ReadOnly: read-only permissions
  • DMLOnly: DML-only permissions
  • DDLOnly: DDL-only permissions
DMLOnly
AccountPrivilegeDetailstring

The permission that the account has on the database.

SELECT
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

30
TotalCountinteger

The total number of entries returned.

Note This parameter is returned only for instances that run SQL Server.
100
BasicInfoobject []

The basic information about the database.

Note This parameter is returned only for instances that run SQL Server.
object

The details of the basic information about the database.

{ "allowedValues": [ "CHECKSUM" ], "databasePropertyName": "page_verify", "allowModify": true, "excludeLock": "0", "currentValue": "CHECKSUM" }
RuntimeInfoobject []

The runtime information about the database.

Note This parameter is returned only for instances that run SQL Server.
object

The runtime information about the database.

{ "allowedValues": [], "databasePropertyName": "TotalDataSizeInMB", "allowModify": false, "currentValue": "5.38" }
AdvancedInfoobject []

The advanced information about the database.

Note This parameter is returned only for instances that run SQL Server.
object

The details of the advanced information about the database.

{ "allowedValues": [ "OFF", "ON" ], "databasePropertyName": "ansi_nulls", "allowModify": true, "excludeLock": "0", "currentValue": "OFF" }

Examples

Sample success responses

JSONformat

{
  "RequestId": "2603CA96-B17D-4903-BC04-61A2C829CD94",
  "Databases": {
    "Database": [
      {
        "DBDescription": "testdb",
        "DBStatus": "Creating",
        "DBName": "testDB01",
        "DBInstanceId": "rm-uf6wjk5****",
        "Engine": "MySQL",
        "CharacterSetName": "utf8",
        "Collate": "C",
        "Ctype": "en_US.utf8",
        "ConnLimit": "-1",
        "Tablespace": "pg_default",
        "ResourceGroupId": "rg-acfmy****",
        "Accounts": {
          "AccountPrivilegeInfo": [
            {
              "Account": "test",
              "AccountPrivilege": "DMLOnly",
              "AccountPrivilegeDetail": "SELECT"
            }
          ]
        },
        "PageNumber": 1,
        "PageSize": 30,
        "TotalCount": 100,
        "BasicInfo": {
          "BasicDbProperty": [
            {
              "allowedValues": [
                "CHECKSUM"
              ],
              "databasePropertyName": "page_verify",
              "allowModify": true,
              "excludeLock": "0",
              "currentValue": "CHECKSUM"
            }
          ]
        },
        "RuntimeInfo": {
          "RuntimeDbProperty": [
            {
              "allowedValues": [],
              "databasePropertyName": "TotalDataSizeInMB",
              "allowModify": false,
              "currentValue": "5.38"
            }
          ]
        },
        "AdvancedInfo": {
          "AdvancedDbProperty": [
            {
              "allowedValues": [
                "OFF",
                "ON"
              ],
              "databasePropertyName": "ansi_nulls",
              "allowModify": true,
              "excludeLock": "0",
              "currentValue": "OFF"
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Database.ConnectErrorDatabase connect error. please check instance status and database processlistA database connection error occurred. Check the instance state and the database connection pool.
400InvalidDBInstanceStatus.NotSupportThe Specified instance status is not supported to query account list.-
400Database.QueryErrorQuery Db failed, please check input value and instance status.Failed to query the database. Check the specified parameters and the instance state.
400SqlExcutionFailedDatabase is in transition. Try the statement later.The database is being modified. Try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-08-09The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
2023-06-21The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2023-03-24The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
2023-01-06The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
2022-09-15The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2022-09-15The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.