You can call this operation to query detailed information 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 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 number of the page to return.

SearchKey String Yes testdb

The keyword used to query databases.

Tid Long Yes -1

The ID of the tenant in Data Management (DMS) Enterprise.

DbType String No MySQL

The type of the database. For more information about the valid values, see the description of the RegisterInstance operation.

EnvType String No product

The type of the environment to which the database belongs.

PageSize Integer No 10

The number of entries to return on each page.

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 current user follows the database.
  • UNKNOWN: No permission is required.
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.

Response parameters

Parameter Type Example Description
ErrorCode String UnknownError

The error code.

ErrorMessage String UnknownError

The error message.

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

The ID of the request.

SearchDatabaseList

The detailed information of databases.

SearchDatabase

The detailed information of a database.

Alias String test

The alias of the database.

DatabaseId String 1

The ID of the database.

DatalinkName String datalink_name

The name of the data link for the database.

DbType String mysql

The type of the database.

DbaId String 1

The ID of the database administrator (DBA).

Encoding String utf8

The encoding format of the database.

EnvType String product

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.

Logic Boolean false

Indicates whether the database was a logical database.

OwnerIdList 1

The IDs of database owners.

OwnerIds

The ID of a database owner.

OwnerNameList user1

The nicknames of database owners.

OwnerNames

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 testSid

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

Success Boolean true

Indicates whether the request was successful.

TotalCount Long 1

The total number of databases that met the query conditions.

Examples

Sample requests


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[RAM user]</OwnerNames>
        </OwnerNameList>
        <Port>3306</Port>
        <DatabaseId>117567</DatabaseId>
        <Alias>xx offline database</Alias>
        <SearchName>xxx@pc-xxx.mysql.polardb.rds.aliyuncs.com:3306[xx offline database]</SearchName>
        <DatalinkName>dblink_38</DatalinkName>
        <SchemaName>xxx_0000</SchemaName>
    </SearchDatabase>
</SearchDatabaseList>
<Success>true</Success>

JSON 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[RAM user]"
					]
				},
				"Port":3306,
				"DatabaseId":117567,
				"Alias":"xx offline database",
				"SearchName":"xxx@pc-xxx.mysql.polardb.rds.aliyuncs.com:3306[xx offline database]",
				"DatalinkName":"dblink_38",
				"SchemaName":"xxx_0000"
			}
		]
	},
	"Success":true
}

Error codes

For a list of error codes, visit the API Error Center.