Queries the list of ApsaraDB for MongoDB instances.
The list of replica set and standalone instances is displayed when the DBInstanceType parameter uses the default value replicate. To query the list of sharded cluster instances, you must set the DBInstanceType parameter to sharding.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | DescribeDBInstances |
The operation that you want to perform. Set the value to DescribeDBInstances. |
| RegionId | String | No | cn-hangzhou |
The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list. |
| PageNumber | Integer | No | 1 |
The number of the page to return. The value of this parameter must be an integer that is greater than 0. Default value: 1. |
| PageSize | Integer | No | 30 |
The number of entries to return on each page. Default value: 30. Valid values:
|
| DBInstanceId | String | No | dds-bp199659b178**** |
The ID of the instance. |
| ReplicationFactor | String | No | 3 |
The number of nodes in the replica set instance. Valid values:
|
| DBInstanceDescription | String | No | testdatabase |
The name of the instance. Valid values:
|
| ExpireTime | String | No | 2019-12-26T16:00Z |
The time when the instance expires. |
| DBInstanceStatus | String | No | Running |
The state of the instance. For more information about valid values, see Instance states. |
| DBInstanceType | String | No | sharding |
The architecture of the instance. Default value: replicate. Valid values:
|
| DBInstanceClass | String | No | dds.mongo.mid |
The instance type. For more information about valid values, see Instance types. |
| Engine | String | No | MongoDB |
The database engine of the instance. Set the value to MongoDB. |
| EngineVersion | String | No | 4.0 |
The database engine version of the instance. Valid values:
|
| NetworkType | String | No | VPC |
The network type of the instance. Valid values:
|
| VpcId | String | No | vpc-bp1n3i15v90el48nx**** |
The ID of the VPC. |
| VSwitchId | String | No | vsw-bp1vj604nj5a9zz74**** |
The ID of the vSwitch. |
| ChargeType | String | No | PrePaid |
The billing method of the instance. Valid values:
|
| ZoneId | String | No | cn-hangzhou-b |
The zone ID of the instance. You can call the DescribeRegions operation to query the most recent zone list. |
| Expired | String | No | true |
Specifies whether the instance has expired. Valid values:
|
| ConnectionDomain | String | No | dds-bp1ea17b41abecf43****.mongodb.rds.aliyuncs.com |
The endpoint of the node. You can call the DescribeDBInstanceAttribute operation to query the endpoint of the node. |
| ResourceGroupId | String | No | rg-acfmyiu4ekp**** |
The ID of the resource group. |
| Tag.N.Key | String | No | testdatabase |
The key of tag N of the instance. Valid values of N: 1 to 20.
|
| Tag.N.Value | String | No | apitest |
The value of tag N of the instance. Valid values of N: 1 to 20.
|
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| TotalCount | Integer | 5 |
The number of instances in the query results. |
| RequestId | String | 0E4FE33F-5510-5758-8FA7-A6672CDE**** |
The ID of the request. |
| PageSize | Integer | 30 |
The number of entries to return on each page. |
| PageNumber | Integer | 1 |
The number of the returned page. |
| DBInstances | Array of DBInstance |
Details of the instances. |
|
| DBInstance | |||
| CreationTime | String | 2021-03-25T02:18:00Z |
The time when the instance was created. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. |
| ChargeType | String | PrePaid |
The billing method of the instance. Valid values:
|
| Tags | Array of Tag |
Details of the resource tags. |
|
| Tag | |||
| Key | String | test |
The tag key of the resource. |
| Value | String | api |
The tag value of the resource. |
| VpcAuthMode | String | Close |
Indicates whether password-free access within a VPC is enabled. Valid values:
|
| NetworkType | String | Classic |
The network type of the instance. Valid values:
|
| LockMode | String | Unlock |
The lock state of the instance. Valid values:
|
| EngineVersion | String | 4.2 |
The database engine version of the instance. Valid values:
|
| MongosList | Array of MongosAttribute |
Details of the mongos nodes. Note This parameter is returned if the instance is a sharded cluster instance.
|
|
| MongosAttribute | |||
| NodeClass | String | dds.mongos.standard |
The type of the mongos node. |
| NodeDescription | String | testmongosnode |
The description of the mongos node. |
| NodeId | String | s-bp10e3b0d02f**** |
The ID of the mongos node. |
| DBInstanceDescription | String | testdatabase |
The description of the instance. |
| ExpireTime | String | 2021-11-25T16:00Z |
The time when the instance expires. The time is in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC. |
| DBInstanceType | String | sharding |
The architecture of the instance.
|
| LastDowngradeTime | String | 2021-05-08 |
The date when the last downgrade operation was performed. |
| ShardList | Array of ShardAttribute |
Details of the shard nodes. Note This parameter is returned if the instance is a sharded cluster instance.
|
|
| ShardAttribute | |||
| NodeClass | String | dds.shard.mid |
The type of the shard node. |
| NodeDescription | String | testshardnode |
The description of the shard node. |
| NodeStorage | Integer | 10 |
The storage capacity of the shard node. Unit: GB. |
| NodeId | String | d-bp1cac6f2083**** |
The ID of the shard node. |
| ReadonlyReplicas | Integer | 2 |
The number of read-only nodes in the shard node. Valid values: 0 to 5. |
| DestroyTime | String | 2021-12-10T16:00:00Z |
The time when the instance data was destroyed. The time is in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC. Note
|
| DBInstanceStatus | String | Running |
The state of the instance. For more information, see Instance states. |
| RegionId | String | cn-hangzhou |
The region ID of the instance. |
| DBInstanceStorage | Integer | 20 |
The storage capacity of the instance. |
| ResourceGroupId | String | rg-acfmyiu4ekp**** |
The ID of the resource group. |
| ZoneId | String | cn-hangzhou-g |
The zone ID of the instance. |
| DBInstanceId | String | dds-bp18b0934e70**** |
The ID of the instance. |
| DBInstanceClass | String | dds.mongo.mid |
The instance type. |
| Engine | String | MongoDB |
The database engine of the instance. |
| ReplicationFactor | String | 3 |
The number of nodes in the instance. Note This parameter is returned if the instance is a replica set instance.
|
| KindCode | String | 1 |
The kind code of the instance. Valid values:
|
| CapacityUnit | String | 100 |
The I/O throughput consumed by the instance. Note This parameter is returned when the instance is a serverless instance.
|
| StorageType | String | local_ssd |
The storage type of the instance. Valid values:
|
| SecondaryZoneId | String | cn-hangzhou-i |
The ID of the secondary zone 1 of the instance. Valid values:
Note
|
| HiddenZoneId | String | cn-hangzhou-h |
The ID of the secondary zone 2 of the instance. Valid values:
Note
|
Examples
Sample requests
http(s)://mongodb.aliyuncs.com/?Action=DescribeDBInstances
&DBInstanceType=sharding
&NetworkType=classic
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeDBInstancesResponse>
<TotalCount>5</TotalCount>
<RequestId>0E4FE33F-5510-5758-8FA7-A6672CDE****</RequestId>
<PageSize>30</PageSize>
<PageNumber>1</PageNumber>
<DBInstances>
<CreationTime>2021-03-25T02:18:00Z</CreationTime>
<ChargeType>PrePaid</ChargeType>
<Tags>
<Key>test</Key>
<Value>api</Value>
</Tags>
<VpcAuthMode>Close</VpcAuthMode>
<NetworkType>Classic</NetworkType>
<LockMode>Unlock</LockMode>
<EngineVersion>4.2</EngineVersion>
<MongosList>
<NodeClass>dds.mongos.standard</NodeClass>
<NodeDescription>testmongosnode</NodeDescription>
<NodeId>s-bp10e3b0d02f****</NodeId>
</MongosList>
<DBInstanceDescription>testdatabase</DBInstanceDescription>
<ExpireTime>2021-11-25T16:00Z</ExpireTime>
<DBInstanceType>sharding</DBInstanceType>
<LastDowngradeTime>2021-05-08</LastDowngradeTime>
<ShardList>
<NodeClass>dds.shard.mid</NodeClass>
<NodeDescription>testshardnode</NodeDescription>
<NodeStorage>10</NodeStorage>
<NodeId>d-bp1cac6f2083****</NodeId>
<ReadonlyReplicas>2</ReadonlyReplicas>
</ShardList>
<DestroyTime>2021-12-10T16:00:00Z</DestroyTime>
<DBInstanceStatus>Running</DBInstanceStatus>
<RegionId>cn-hangzhou</RegionId>
<DBInstanceStorage>20</DBInstanceStorage>
<ResourceGroupId>rg-acfmyiu4ekp****</ResourceGroupId>
<ZoneId>cn-hangzhou-g</ZoneId>
<DBInstanceId>dds-bp18b0934e70****</DBInstanceId>
<DBInstanceClass>dds.mongo.mid</DBInstanceClass>
<Engine>MongoDB</Engine>
<ReplicationFactor>3</ReplicationFactor>
<KindCode>1</KindCode>
<CapacityUnit>100</CapacityUnit>
<StorageType>local_ssd</StorageType>
</DBInstances>
</DescribeDBInstancesResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : 5,
"RequestId" : "0E4FE33F-5510-5758-8FA7-A6672CDE****",
"PageSize" : 30,
"PageNumber" : 1,
"DBInstances" : {
"CreationTime" : "2021-03-25T02:18:00Z",
"ChargeType" : "PrePaid",
"Tags" : {
"Key" : "test",
"Value" : "api"
},
"VpcAuthMode" : "Close",
"NetworkType" : "Classic",
"LockMode" : "Unlock",
"EngineVersion" : 4.2,
"MongosList" : {
"NodeClass" : "dds.mongos.standard",
"NodeDescription": "testmongosnode"
"NodeId" : "s-bp10e3b0d02f****"
},
"DBInstanceDescription": "testdatabase",
"ExpireTime" : "2021-11-25T16:00Z",
"DBInstanceType" : "sharding",
"LastDowngradeTime" : "2021-05-08",
"ShardList" : {
"NodeClass" : "dds.shard.mid",
"NodeDescription": "testshardnode"
"NodeStorage" : 10,
"NodeId" : "d-bp1cac6f2083****",
"ReadonlyReplicas" : 2
},
"DestroyTime" : "2021-12-10T16:00:00Z",
"DBInstanceStatus" : "Running",
"RegionId" : "cn-hangzhou",
"DBInstanceStorage" : 20,
"ResourceGroupId" : "rg-acfmyiu4ekp****",
"ZoneId" : "cn-hangzhou-g",
"DBInstanceId" : "dds-bp18b0934e70****",
"DBInstanceClass" : "dds.mongo.mid",
"Engine" : "MongoDB",
"ReplicationFactor" : 3,
"KindCode" : 1,
"CapacityUnit" : 100,
"StorageType" : "local_ssd"
}
}
Error codes
For a list of error codes, visit the API Error Center.