All Products
Search
Document Center

Data Management:ListDatabases

Last Updated:Nov 28, 2024

Queries the databases in a database instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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
dms:ListDatabaseslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TidlongNo

The ID of the tenant.

Note : To view the ID of the tenant, move the pointer over the profile picture in the upper-right corner of the Data Management (DMS) console. For more information, see Manage DMS tenants.
3***
InstanceIdstringYes

The ID of the instance. The valid value is returned if you call the ListInstances operation. The instance ID is not the ID of the RDS instance.

12***
PageNumberintegerYes

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return per page.

10

Response parameters

ParameterTypeDescriptionExample
object
TotalCountlong

The number of databases that belong to an instance.

1
RequestIdstring

The ID of the request.

5541CDA6-F674-435C-81BD-40C2FB926CE3
DatabaseListarray<object>

The details of the databases.

Databaseobject
DatabaseIdstring

The ID of the database.

1
Hoststring

The endpoint of the instance to which the database belongs.

xxx.xxx.xxx.xxx
CatalogNamestring

The name of the catalog to which the database belongs.

1
DbaNamestring

The nickname of the Database administrator (DBA) to which the database belongs.

dba_user
Statestring

The state of the database. Valid values:

  • NORMAL: The database is normal.
  • DISABLE: The database is disabled.
  • OFFLINE: The database is unpublished.
  • NOT_EXIST: The database does not exist.
NORMAL
DbaIdstring

The ID of the DBA.

1
SchemaNamestring

The name of the database.

test
InstanceIdstring

The ID of the instance to which the database belongs.

1
Portinteger

The connection port of the instance to which the database belongs.

3306
EnvTypestring

The type of the environment to which the database belongs.

dev
Sidstring

The system ID (SID) of the instance to which the database belongs.

test
OwnerIdListarray

The IDs of the owners of the database.

OwnerIdsstring

The ID of the owner of the database.

1
Encodingstring

The encoding format of the database.

utf-8
DbTypestring

The type of the database engine.

mysql
OwnerNameListarray

The nicknames of the database owners.

OwnerNamesstring

The nickname of the database owner.

owner_name
SearchNamestring

The name that is used for searching the database.

test@xxx.xxx.xxx.xxx:3306
ErrorCodestring

The error code returned if the request failed.

UnknownError
ErrorMessagestring

The error message returned if the request failed.

UnknownError
Successboolean

Indicates whether the request is successful.

true

Examples

Sample success responses

JSONformat

{
  "TotalCount": 1,
  "RequestId": "5541CDA6-F674-435C-81BD-40C2FB926CE3",
  "DatabaseList": {
    "Database": [
      {
        "DatabaseId": "1",
        "Host": "xxx.xxx.xxx.xxx",
        "CatalogName": "1",
        "DbaName": "dba_user",
        "State": "NORMAL",
        "DbaId": "1",
        "SchemaName": "test",
        "InstanceId": "1",
        "Port": 3306,
        "EnvType": "dev",
        "Sid": "test",
        "OwnerIdList": {
          "OwnerIds": [
            "1"
          ]
        },
        "Encoding": "utf-8",
        "DbType": "mysql",
        "OwnerNameList": {
          "OwnerNames": [
            "owner_name"
          ]
        },
        "SearchName": "test@xxx.xxx.xxx.xxx:3306"
      }
    ]
  },
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history