You can call this operation to query the information of a database.

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 SearchDatabase

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

PageNumber Integer Yes 1

The page number of the returned page.

SearchKey String Yes testdb

The keyword to be matched.

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.

EnvType String No product

The environment to which the database belongs.

SearchRange String No HAS_PERMSSION

The permission on the database. Valid values:

  • HAS_PERMSSION: the current user has the permission for the database.
  • OWNER: The current user is the owner of the database.
  • MY_FOCUS: the focus of attention
  • UNKNOWN
SearchTarget String No SINGLE_DB

The target database to query. Valid values:

  • DB: The database type is not limited.
  • SINGLE_DB: Only single databases are queried.
  • LOGIC_DB: Only logical databases are queried.
DbType String No MySQL

The type of the database. For more information, see RegisterInstance.

Response parameters

Parameter Type Sample response Description
ErrorCode String UnknownError

The error codes.

ErrorMessage String UnknownError

The error message of the failure.

RequestId String E0D21075-CD3E-4D98-8264-FD8AD04A63B6

The ID of the API request.

SearchDatabaseList Array of SearchDatabase

The detailed list of search libraries.

SearchDatabase
Alias String test

The alias of the database.

DatabaseId String 1

The ID of the database.

DatalinkName String datalink_name

The database corresponding to datalink.

DbType String mysql

The type of the storage instance of the DRDS database.

DbaId String 1

The ID of the database administrator (DBA).

Encoding String utf8

The encoding of the database.

EnvType String product

The type of the environment.

Host String xxx.xxx.xxx.xxx

The connection address of the database instance.

Logic Boolean false

Indicates whether the database is a logical database.

OwnerIdList List 1

The IDs of database owners.

OwnerNameList List user1

The nicknames of the database owners.

Port Integer 3306

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

SchemaName String test

The schema of the PolarDB-X database.

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

The database search name.

Sid String testSid

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

Success Boolean true

Indicates whether the call was successful.

TotalCount Long 1

The total number of records.

Examples

Sample request


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

Sample success responses

XML format


     <TotalCount> 1 </TotalCount> <RequestId> E0D21075-CD3E-4D98-8264-FD8AD04A63B6 </RequestId> <SearchDatabaseList> <SearchDatabase> <Encoding> utf8mb4 </Encoding> <Host> pc-xxx.mysql.polardb.rds.aliyuncs.com </Host> <DbType> polardb </DbType> <EnvType> dev </EnvType> <OwnerIdList> <OwnerIds> 88653 </OwnerIds> <OwnerIds> 88656 </OwnerIds> <OwnerIds> 104442 </OwnerIds> </OwnerIdList> <Logic> false </Logic> <DbaId> 88653 </DbaId> <OwnerNameList> <OwnerNames> dmstest </OwnerNames> <OwnerNames> xx </OwnerNames> <OwnerNames> xx [account] </OwnerNames> </OwnerNameList> <Port> 3306 </Port> <DatabaseId> 117567 </DatabaseId> <Alias> xx line lower reservoir </Alias> <SearchName> xxx@pc-xxx.mysql.polardb.rds.aliyuncs.com:3306 [xx line lower reservoir] </SearchName> <DatalinkName> dblink_38 </DatalinkName> <SchemaName> xxx_0000 </SchemaName> </SearchDatabase> </SearchDatabaseList> <Success> true </Success> 
   

JSON


     {"TotalCount": 1, "RequestId": "E0D21075-CD3E-4D98-8264-FD8AD04A63B6", "SearchDatabaseList": { "SearchDatabase": [ { "Encoding": "utf8mb4", "Host": "pc-xxx.mysql.polardb.rds.aliyuncs.com", "DbType": "polardb", "EnvType": "dev", "OwnerIdList": { "OwnerIds": [ 88653, 88656, 104442 ] } , "Logic": false, "DbaId": 886.3, "OwnerNameList": { "OwnerNames": [ "dmstest", "xx", "xx [subaccount]" ] }, "Port": 3306, "DatabaseId": 117567, "Alias": "xx offline database", "SearchName": "xxx@pc-xxx.mysql.polardb.rds.aliyuncs.com:3306 [offline database]", "DatalinkName": "dblink_38", " SchemaName": "xxx_0000" } ] }, "Success": true} 
   

Error codes

For more information about error codes, see error center.