Queries the information about database instances.

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 ListInstances

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

Tid Long No 3***

The ID of the tenant. You can call the GetUserActiveTenant operation to obtain the tenant ID.

SearchKey String No test

The keyword that is used to search for database instances.

DbType String No MySQL

The type of the database. For more information about the valid values of this parameter, see DbType parameter.

EnvType String No product

The type of the environment to which the database instance belongs. Valid values:

  • product: production environment
  • dev: development environment
  • pre: staging environment
  • test: test environment
  • sit: system integration testing (SIT) environment
  • uat: user acceptance testing (UAT) environment
  • pet: stress testing environment
  • stag: STAG environment
InstanceSource String No RDS

The source of the database instance. Valid values:

  • PUBLIC_OWN: a self-managed database instance that is deployed on the Internet
  • RDS: an ApsaraDB RDS instance
  • ECS_OWN: a self-managed database that is deployed on an Elastic Compute Service (ECS) instance
  • VPC_IDC: a self-managed database instance that is deployed in a data center connected over a virtual private cloud (VPC)
NetType String No VPC

The network type of the database instance. Valid values:

  • CLASSIC: classic network
  • VPC: VPC
InstanceState String No NORMAL

The status of the database instance. Valid values:

  • NORMAL: normal
  • DISABLE: disabled
PageNumber Integer No 1

The number of the page to return.

PageSize Integer No 50

The number of entries to return on each page. The number cannot exceed 100.

RegionId String No cn-hangzhou

The ID of the region in which Data Management (DMS) is activated. For more information about the valid values of this parameter, see RegionID parameter.

Note Set this parameter to the ID of the region that is in proximity to your applications.

Response parameters

Parameter Type Example Description
TotalCount Long 1

The total number of database instances that are returned.

RequestId String B4B07137-F6AE-4756-8474-7F92BB6C4E04

The ID of the request.

ErrorCode String UnknownError

The error code that is returned.

ErrorMessage String UnknownError

The error message that is returned.

InstanceList Array of Instance

The information about the database instances that are returned.

Instance
VpcId String vpc-o6wrloqsdqc9io3mg****

The ID of the VPC to which the database instance belongs.

DatabaseUser String dbUser

The account that is used to log on to the database.

DbaId String 31****

The ID of the database administrator (DBA) for the database instance.

UseDsql Integer 1

Indicates whether the cross-database query feature is enabled for the database instance. Valid values:

  • 0: disabled
  • 1: enabled
Port Integer 3306

The port number that is used to connect to the database instance.

EcsInstanceId String 150****

The ID of the ECS instance on which the database instance is deployed.

EnvType String product

The type of the environment to which the database instance belongs. Valid values:

  • product: production environment
  • dev: development environment
  • pre: staging environment
  • test: test environment
  • sit: SIT environment
  • uat: UAT environment
  • pet: stress testing environment
  • stag: STAG environment
Sid String test

The system ID (SID) of the database instance.

OwnerIdList Array of String 123453

The ID of the owner for the database instance.

SafeRuleId String 1

The ID of the security rule set for the database instance.

OwnerNameList Array of String yuyang_test

The nickname of the owner for the database instance.

DbaNickName String dbaName

The nickname of the DBA for the database instance.

QueryTimeout Integer 60

The timeout period for querying data in the database instance.

InstanceSource String RDS

The source of the database instance.

Host String ****.mysql.rds.aliyuncs.com

The host address that is used to connect to the database instance.

State String NORMAL

The status of the database instance.

DataLinkName String dblink_test

The name of the database link for the database instance.

ExportTimeout Integer 86400

The timeout period for exporting data from the database instance.

InstanceId String 150***

The ID of the database instance.

InstanceType String mysql

The type of the database instance.

DatabasePassword String ******

The password that is used to log on to the database.

InstanceAlias String test

The alias of the database instance.

DdlOnline Integer 1

Indicates whether the lock-free schema change feature is enabled for the database instance.

EcsRegion String cn-hangzhou

The ID of the region in which the database instance resides.

StandardGroup Object

The control mode of the database instance.

GroupName String test

The name of the security rule set corresponding to the control mode.

GroupMode String COMMON

The type of the control mode. Valid values:

  • COMMON: Security Collaboration
  • NONE_CONTROL: Flexible Management
  • STABLE: Stable Change
Success Boolean true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.

Examples

Sample request

http(s)://dms-enterprise.aliyuncs.com/?Action=ListInstances
&Tid=3***
&SearchKey=test
&DbType=MySQL
&EnvType=product
&InstanceSource=RDS
&NetType=VPC
&InstanceState=NORMAL
&PageNumber=1
&PageSize=50
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListInstancesResponse>
    <TotalCount>1</TotalCount>
    <RequestId>B4B07137-F6AE-4756-8474-7F92BB6C4E04</RequestId>
    <InstanceList>
        <VpcId>vpc-o6wrloqsdqc9io3mg****</VpcId>
        <DatabaseUser>dbUser</DatabaseUser>
        <DbaId>31****</DbaId>
        <UseDsql>1</UseDsql>
        <Port>3306</Port>
        <EcsInstanceId>150****</EcsInstanceId>
        <EnvType>product</EnvType>
        <Sid>test</Sid>
        <OwnerIdList>123453</OwnerIdList>
        <SafeRuleId>1</SafeRuleId>
        <OwnerNameList>yuyang_test</OwnerNameList>
        <DbaNickName>dbaName</DbaNickName>
        <QueryTimeout>60</QueryTimeout>
        <InstanceSource>RDS</InstanceSource>
        <Host>****.mysql.rds.aliyuncs.com</Host>
        <State>NORMAL</State>
        <DataLinkName>dblink_test</DataLinkName>
        <ExportTimeout>86400</ExportTimeout>
        <InstanceId>150***</InstanceId>
        <InstanceType>mysql</InstanceType>
        <DatabasePassword>******</DatabasePassword>
        <InstanceAlias>test</InstanceAlias>
        <DdlOnline>1</DdlOnline>
        <EcsRegion>cn-hangzhou</EcsRegion>
        <StandardGroup>
            <GroupName>test</GroupName>
            <GroupMode>COMMON</GroupMode>
        </StandardGroup>
    </InstanceList>
    <Success>true</Success>
</ListInstancesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : 1,
  "RequestId" : "B4B07137-F6AE-4756-8474-7F92BB6C4E04",
  "InstanceList" : [ {
    "VpcId" : "vpc-o6wrloqsdqc9io3mg****",
    "DatabaseUser" : "dbUser",
    "DbaId" : "31****",
    "UseDsql" : 1,
    "Port" : 3306,
    "EcsInstanceId" : "150****",
    "EnvType" : "product",
    "Sid" : "test",
    "OwnerIdList" : [ "123453" ],
    "SafeRuleId" : "1",
    "OwnerNameList" : [ "yuyang_test" ],
    "DbaNickName" : "dbaName",
    "QueryTimeout" : 60,
    "InstanceSource" : "RDS",
    "Host" : "****.mysql.rds.aliyuncs.com",
    "State" : "NORMAL",
    "DataLinkName" : "dblink_test",
    "ExportTimeout" : 86400,
    "InstanceId" : "150***",
    "InstanceType" : "mysql",
    "DatabasePassword" : "******",
    "InstanceAlias" : "test",
    "DdlOnline" : 1,
    "EcsRegion" : "cn-hangzhou",
    "StandardGroup" : {
      "GroupName" : "test",
      "GroupMode" : "COMMON"
    }
  } ],
  "Success" : true
}

Error codes

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