All Products
Search
Document Center

ApsaraDB RDS:DescribeDatabases

Last Updated:May 29, 2023

Queries the information about the databases of an instance.

Operation Description

NoteIf the specified request parameters are invalid, no database information is returned.

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
  • RDS
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the instance.

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 to return on each page. Valid values:

  • 30
  • 50
  • 100

Default value: 30.

30
PageNumberintegerNo

The number of the page to return. Valid values: any non-zero positive integer.

Default value: 1.

1
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmy****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

An array that consists of the information about databases.

DBDescriptionstring

The description of the database.

testdb
DBStatusstring

The status of the database. Valid values:

  • Creating
  • Running
  • Deleting
Creating
DBNamestring

The name of the database.

testDB01
DBInstanceIdstring

The ID of the instance to which the database belongs.

rm-uf6wjk5****
Enginestring

The database engine of the instance to which the database belongs.

MySQL
CharacterSetNamestring

The name of the character set.

utf8
Collatestring

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

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

The type of the character set.

NoteThis 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.

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

The tablespace of the database.

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

The ID of the resource group.

rg-acfmy****
Accountsobject []

An array that consists of the details of the accounts. Each account has specific permissions on the database.

Accountstring

The username of the account.

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 details of the permissions that the account has on the database.

SELECT
PageSizeinteger

The reserved parameter.

30
TotalCountinteger

The total number of entries returned.

100

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
      }
    ]
  }
}

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.

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

Change history

Change timeSummary of changesOperation
2023-03-24The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change
2023-01-06The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
2022-09-15The error codes of the API operation change.,The response structure of the API operation changes.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
Output ParametersThe response structure of the API operation changes.
2022-09-15The error codes of the API operation change.,The response structure of the API operation changes.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
Output ParametersThe response structure of the API operation changes.