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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 ID of the database instance.

PageNumber Integer Yes 1

The number of the page to return.

Tid Long Yes -1

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

PageSize Integer No 10

The number of entries to return on each page.

Response parameters

Parameter Type Example Description
DatabaseList

The detailed information of databases.

Database

The detailed information of a 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.

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 1

The IDs of database owners.

OwnerIds

The ID of a database owner.

OwnerNameList owner_name

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 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 code.

ErrorMessage String UnknownError

The error message.

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

The ID of the request.

Success Boolean true

Indicates whether the request was successful.

TotalCount Long 1

The total number of databases in the instance.

Examples

Sample requests


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[RAM user]</DbaName>
        <SchemaName>xxx_test</SchemaName>
    </Database>
</DatabaseList>

JSON format

{
	"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":"xxx_test@pc-xxx.rwlb.rds.aliyuncs.com:3306[xxx_test]",
				"DbaName":"xxx[RAM user]",
				"SchemaName":"xxx_test"
			}
		]
	}
}

Error codes

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