You can call this operation to query detailed information of databases in a specified instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes ListDatabases

The operation that you want to perform. Set the value to ListDatabases.

InstanceId String Yes 1

The instance ID, which must be obtained from the instance ID returned by the ListInstances operation. Make sure that the value is not the ID of an RDS instance.

PageNumber Integer Yes 1

The page number of the returned page.

Tid Long Yes -1

The ID of the tenant.

Note The tenant ID is taken from the tenant ID displayed when you move the pointer on your profile picture. For more information, see View tenant information .
PageSize Integer No 10

The number of the entries to return on each page.

Response parameters

Parameter Type Sample response Description
DatabaseList Array of Database

The details about a database.

Database
CatalogName String 1

The catalog name of the database.

DatabaseId String 1

The ID of the database.

DbType String mysql

The type of the database instance.

DbaId String 1

The ID of the database administrator (DBA).

DbaName String dba_user

The nickname of the DBA.

Encoding String utf-8

The encoding format of the database.

EnvType String dev

The type of the environment to which the database belongs.

Host String xxx.xxx.xxx.xxx

The endpoint of the instance to which the database belongs.

InstanceId String 1

The ID of the instance to which the database belongs.

OwnerIdList List 1

The ID of a database owner.

OwnerNameList List owner_name

The nickname of a database owner.

Port Integer 3306

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

SchemaName String test

The name of the database.

SearchName String test@xxx.xxx.xxx.xxx:3306

The query name of the database.

Sid String test

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

State String NORMAL

The status of the database. Valid values:

  • NORMAL: The database is normal.
  • DISABLE: The database is disabled.
  • OFFLINE: The database is taken offline.
  • NOT_EXIST: The database does not exist.
ErrorCode String UnknownError

The error codes.

ErrorMessage String UnknownError

The error message of the failure.

RequestId String 5541CDA6-F674-435C-81BD-40C2FB926CE3

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

TotalCount Long 1

The number of databases in the instance.

Examples

Sample request


     http(s)://[Endpoint]/? Action=ListDatabases &InstanceId=1 &PageNumber=1 &Tid=-1 &<common request parameters> 
   

Sample success responses

XML format


     <TotalCount> 1 </TotalCount> <RequestId> 5541CDA6-F674-435C-81BD-40C2FB926CE3 </RequestId> <Success> true </Success> <DatabaseList> <Database> <Encoding> utf8 </Encoding> <Host> pc-xxx.rwlb.rds.aliyuncs.com </Host> <InstanceId> 24710 </InstanceId> <DbType> polardb </DbType> <EnvType> product </EnvType> <OwnerIdList> <OwnerIds> 88653 </OwnerIds> </OwnerIdList> <DbaId> 104442 </DbaId> <OwnerNameList> <OwnerNames> dmstest </OwnerNames> </OwnerNameList> <Port> 3306 </Port> <DatabaseId> 116366 </DatabaseId> <State> NORMAL </State> <SearchName> xxx_test@pc-xxx.rwlb.rds.aliyuncs.com:3306 [xxx_test] </SearchName> <DbaName> xxx [account] </DbaName> <SchemaName> xxx_test </SchemaName> </Database> </DatabaseList> 
   

JSON


     {"TotalCount": 1, "RequestId": "5541CDA6-F674-435C-81BD-40C2FB926CE3", "Success": true, "DatabaseList": { "Database": [ { "Encoding": "utf8", "Host": "pc-xxx.rwlb.rds.aliyuncs.com", "InstanceId": 24710, "DbType": "polardb", "EnvType": "product", "OwnerIdList": { " OwnerIds ": [ 88653 ] }, " DbaId ": 104442, " OwnerNameList ": { " OwnerNames ": [ " dmstest " ] }, " Port ": 3306, " DatabaseId ": 116366," State ": " NORMAL ", " SearchName ": 3306" xxx_test@pc-xxx.rwlb.rds.aliyuncs.com: [xxx_xxtest] "DbaName": "xxx [Ram user]", "SchemaName": "xxx_test" } ] } } 
   

Error codes

For more information about error codes, see error center.