Queries details of databases.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request Parameter

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 that searches for the database name.

Tid Long Yes 1

The ID of the tenant.

Note Take the tenant ID information displayed in the upper right corner of the system. For details, see Tenant ID and Tenant .
PageSize Integer No 10

The number of entries returned per page.

EnvType String No product

The environment type of the database. For more information, see Instance environment description .

SearchRange String No HAS_PERMSSION

The permission on the database. Valid values:

  • HAS_PERMSSION : Permitted
  • OWNER : My Owner's
  • MY_FOCUS : What I care about
  • UNKNOWN : unlimited
SearchTarget String No SINGLE_DB

The target database to query. Valid values:

  • DB : Unlimited (does not distinguish between single library or logical library)
  • SINGLE_DB : single library
  • LOGIC_DB : logical library
DbType String No MySQL

The type of the database instance. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
  • Oracle
  • DRDS
  • OceanBase
  • Mongo
  • Redis

Response parameters

Parameter Type Example Description
ErrorCode String UnknownError

The error code returned.

ErrorMessage String UnknownError

The returned message.

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

The ID of the API request.

SearchDatabaseList Array of SearchDatabase

The list of search library details.

SearchDatabase
Alias String test

The library alias.

DatabaseId String 1

The ID of the database.

DatalinkName String datalink_name

the datalink corresponding to the library.

DbType String mysql

The type of the database instance. Valid values:

  • MySQL
  • SQLServer
  • PostgreSQL
  • Oracle
  • DRDS
  • OceanBase
  • Mongo
  • Redis
DbaId String 1

The DBA ID of the library.

Encoding String utf8

Library encoding.

EnvType String product

The environment type of the database. For more information, see Instance environment description .

Host String xxx.xxx.xxx.xxx

The instance where the library is located corresponds to the connection address.

Logic Boolean false

Whether it is a logical library. Value:

  • true : Yes
  • false : No
OwnerIdList List 1

The list of library Owner ID.

OwnerNameList List user1

The list of library Owner nicknames.

Port Integer 3306

The instance port corresponding to the library.

SchemaName String test

The schema of the PolarDB-X database.

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

The library search name.

Sid String testSid

The Sid of the instance corresponding to the library.

Success Boolean true

Indicates whether the request is successful.

TotalCount Long 1

The total number of records that meet the conditions.

Examples

Sample requests


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

Sample success responses

XML format


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

JSON Address format


     { "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": 88653, "OwnerNameList": { "OwnerNames": ["dmstest", "xx", "xx [sub-account]" ] }, "Port": 3306, "DatabaseId": 117567, "Alias": "xx offline library", "SearchName": "xxx@pc-xxx.mysql.polardb.rds.aliyuncs.com:3306 [xx offline library]", "DatalinkName": "dblink_38", "SchemaName": "xxx_0000" } ] }, "Success": true } 
   

Error code

Go to the Error Center See more error codes.