Queries the information about database instances.
Debugging
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:
|
| InstanceSource | String | No | RDS |
The source of the database instance. Valid values:
|
| NetType | String | No | VPC |
The network type of the database instance. Valid values:
|
| InstanceState | String | No | NORMAL |
The status of the database instance. Valid values:
|
| 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. |
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 returned if the request failed. |
| ErrorMessage | String | UnknownError |
The error message returned if the request failed. |
| 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:
|
| 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:
|
| Sid | String | test |
The system ID (SID) of the database instance. |
| OwnerIdList | Array of String | 123453 |
The IDs of the owners 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 nicknames of the owners 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:
|
| SellSitd | Boolean | true |
Indicates whether the sensitive data protection feature is enabled for the database instance. Valid values:
|
| Success | Boolean | true |
Indicates whether the request was successful. Valid values:
|
Examples
Sample requests
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>
<SellSitd>true</SellSitd>
</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"
},
"SellSitd" : true
} ],
"Success" : true
}
Error codes
For a list of error codes, see Service error codes.