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
InstanceId String Yes 1

The id of the instance. The value is the instance id returned by the ListInstances operation.

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
RequestId String 5541CDA6-F674-435C-81BD-40C2FB926CE3

The ID of the request.

Success Boolean true

Indicates whether the request was successful.

ErrorMessage String UnknownError

Error message

ErrorCode String UnknownError

Error code

TotalCount Long 1

The total number of databases in the instance.

DatabaseList Array

The detailed information of a database.

InstanceId String 1

The ID of the instance to which the database belongs.

DatabaseId String 1

The ID of the database.

EnvType String dev

The type of the environment to which the database belongs.

SchemaName String test

The name of the database.

CatalogName String 1

The catalog name of the database.

Encoding String UTF-8

The encoding format of the database.

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

The query name of the database.

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.
DbType String mysql

The type of the database instance.

Host String xxx.xxx.xxx.xxx

The endpoint of the instance to which the database belongs.

Port Integer 3306

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

Sid String test

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

DbaName String dba_user

The nickname of the DBA.

DbaId String 1

The ID of the database administrator (DBA).

OwnerIdList List 1

The ID of a database owner.

OwnerNameList List owner_name

The nicknames of database owners.

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