Queries the list of ApsaraDB for MongoDB instances.

This operation displays the list of replica set and standalone instances 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

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 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 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. Valid values: 30, 50, and 100. Default value: 30.

DBInstanceId String No dds-bp199659b178****

The ID of the instance.

ReplicationFactor String No 3

The number of nodes in a replica set instance. Valid values: 3, 5, and 7.

DBInstanceDescription String No Testdatabase

The description of the instance.

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 category of the instance. Default value: replicate. Valid values:

  • sharding: sharded cluster instance
  • replicate: replica set or standalone instance

Note
  • To query the list of sharded cluster instances, you must set the parameter to sharding.
  • This operation displays the list of replica set and standalone instances when the parameter uses the default value replicate.
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:

  • 5.0
  • 4.4
  • 4.2
  • 4.0
  • 3.4
NetworkType String No VPC

The network type of the instance. Valid values:

  • Classic
  • VPC
VpcId String No vpc-bp1n3i15v90el48nx****

The VPC ID of the instance.

VSwitchId String No vsw-bp1vj604nj5a9zz74****

The vSwitch ID of the instance.

ChargeType String No PrePaid

The billing method of the instance. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go
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 expires. Valid values:

  • true: The instance expires.
  • false: The instance does not expire.
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. Valid values of N: 1 to 20.

  • The key cannot start with aliyun, acs:, http://, or https://.
  • The key can be up to 64 characters in length.
  • The key cannot be an empty string.
Tag.N.Value String No apitest

The value of tag N. Valid values of N: 1 to 20.

  • The value cannot start with aliyun, acs:, http://, or https://.
  • The value can be up to 128 characters in length.
  • The value can be an empty string.

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 returned on each page.

PageNumber Integer 1

The page number of the returned page.

DBInstances Array of DBInstance

Details about 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.

  • PrePaid: subscription
  • PostPaid: pay-as-you-go
Tags Array of Tag

Details about 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 the VPC is enabled. Valid values:

  • Open: Password-free access is enabled.
  • Close: Password-free access is disabled.
NetworkType String Classic

The network type of the instance. Valid values:

  • Classic
  • VPC
LockMode String Unlock

Indicates whether the instance is locked. Valid values:

  • Unlock: The instance is not locked.
  • ManualLock: The cluster is manually locked.
  • LockByExpiration: The instance is automatically locked after it expires.
  • LockByRestoration: The instance is automatically locked before it is rolled back.
  • LockByDiskQuota: The instance is automatically locked after the storage space is exhausted.
  • Released: The instance is released. After an instance is released, the instance cannot be unlocked. You can only restore the backup data of the instance to a new instance. This process requires a long period of time.
EngineVersion String 4.2

The version of the database engine.

MongosList Array of MongosAttribute

Details about the mongos node.

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 Test mongos node

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 category of the instance. Default value: replicate. Valid values:

  • sharding: sharded cluster instance
  • replicate: replica set or standalone instance

LastDowngradeTime String 2021-05-08

The last time when the instance was downgraded.

ShardList Array of ShardAttribute

Details about the shard node.

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 Test shard node

The description of the shard node.

NodeStorage Integer 10

The storage space 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.

Note This parameter is supported only for sharded cluster instances whose billing type is subscription.
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
  • Subscription instances are released 15 days after expiration. After an instance is released, its data is deleted and cannot be restored.
  • Pay-as-you-go instances are locked after the payment has been overdue for longer than 24 hours. The instance is released after it has been overdue for longer than 15 days. The data of released instances is deleted and cannot be restored.
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-f

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:

  • 0: physical machine
  • 1: ECS instance
  • 2: Docker cluster
  • 18: Kubernetes cluster

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>1</TotalCount>
    <RequestId>0E4FE33F-5510-5758-8FA7-A6672CDE****</RequestId>
    <PageSize>30</PageSize>
    <PageNumber>1</PageNumber>
    <DBInstances>
        <DBInstance>
            <EngineVersion>4.2</EngineVersion>
            <DBInstanceStatus>Running</DBInstanceStatus>
            <ResourceGroupId>rg-acfmyiu4ekp****</ResourceGroupId>
            <ZoneId>cn-hangzhou-f</ZoneId>
            <CapacityUnit/>
            <DBInstanceClass>dds.mongo.logic</DBInstanceClass>
            <ShardList>
                <ShardAttribute>
                    <NodeClass>dds.shard.mid</NodeClass>
                    <ReadonlyReplicas>0</ReadonlyReplicas>
                    <NodeStorage>10</NodeStorage>
                    <NodeId>d-bp1403708ef6****</NodeId>
                </ShardAttribute>
                <ShardAttribute>
                    <NodeClass>dds.shard.mid</NodeClass>
                    <ReadonlyReplicas>2</ReadonlyReplicas>
                    <NodeStorage>10</NodeStorage>
                    <NodeId>d-bp18f7d6b6a7****</NodeId>
                </ShardAttribute>
                <ShardAttribute>
                    <NodeClass>dds.shard.mid</NodeClass>
                    <NodeDescription>d-bp1cac6f2083****</NodeDescription>
                    <ReadonlyReplicas>2</ReadonlyReplicas>
                    <NodeStorage>10</NodeStorage>
                    <NodeId>d-bp1cac6f2083****</NodeId>
                </ShardAttribute>
            </ShardList>
            <DBInstanceType>sharding</DBInstanceType>
            <LockMode>Unlock</LockMode>
            <DBInstanceId>dds-bp18b0934e70****</DBInstanceId>
            <MongosList>
                <MongosAttribute>
                    <NodeClass>dds.mongos.standard</NodeClass>
                    <NodeId>s-bp10e3b0d02f****</NodeId>
                </MongosAttribute>
                <MongosAttribute>
                    <NodeClass>dds.mongos.mid</NodeClass>
                    <NodeId>s-bp1773180e38****</NodeId>
                </MongosAttribute>
                <MongosAttribute>
                    <NodeClass>dds.mongos.mid</NodeClass>
                    <NodeId>s-bp1c010266f****</NodeId>
                </MongosAttribute>
            </MongosList>
            <ChargeType>PrePaid</ChargeType>
            <NetworkType>Classic</NetworkType>
            <CreationTime>2021-03-25T02:18:00Z</CreationTime>
            <RegionId>cn-hangzhou</RegionId>
            <ExpireTime>2021-11-25T16:00Z</ExpireTime>
            <KindCode>0</KindCode>
            <DBInstanceDescription>Testdatabase</DBInstanceDescription>
            <Engine>MongoDB</Engine>
            <Tags>
            </Tags>
        </DBInstance>
    </DBInstances>
</DescribeDBInstancesResponse>

JSON format

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

{
  "TotalCount" : 1,
  "RequestId" : "0E4FE33F-5510-5758-8FA7-A6672CDE****",
  "PageSize" : 30,
  "PageNumber" : 1,
  "DBInstances" : {
    "DBInstance" : [ {
      "EngineVersion" : "4.2",
      "DBInstanceStatus" : "Running",
      "ResourceGroupId" : "rg-acfmyiu4ekp****",
      "ZoneId" : "cn-hangzhou-f",
      "CapacityUnit" : "",
      "DBInstanceClass" : "dds.mongo.logic",
      "ShardList" : {
        "ShardAttribute" : [ {
          "NodeClass" : "dds.shard.mid",
          "ReadonlyReplicas" : 0,
          "NodeStorage" : 10,
          "NodeId" : "d-bp1403708ef6****"
        }, {
          "NodeClass" : "dds.shard.mid",
          "ReadonlyReplicas" : 2,
          "NodeStorage" : 10,
          "NodeId" : "d-bp18f7d6b6a7****"
        }, {
          "NodeClass" : "dds.shard.mid",
          "NodeDescription" : "d-bp1cac6f2083****",
          "ReadonlyReplicas" : 2,
          "NodeStorage" : 10,
          "NodeId" : "d-bp1cac6f2083****"
        } ]
      },
      "DBInstanceType" : "sharding",
      "LockMode" : "Unlock",
      "DBInstanceId" : "dds-bp18b0934e70****",
      "MongosList" : {
        "MongosAttribute" : [ {
          "NodeClass" : "dds.mongos.standard",
          "NodeId" : "s-bp10e3b0d02f****"
        }, {
          "NodeClass" : "dds.mongos.mid",
          "NodeId" : "s-bp1773180e38****"
        }, {
          "NodeClass" : "dds.mongos.mid",
          "NodeId" : "s-bp1c010266f****"
        } ]
      },
      "ChargeType" : "PrePaid",
      "NetworkType" : "Classic",
      "CreationTime" : "2021-03-25T02:18:00Z",
      "RegionId" : "cn-hangzhou",
      "ExpireTime" : "2021-11-25T16:00Z",
      "KindCode" : 0,
      "DBInstanceDescription": "Testdatabase",
      "Engine" : "MongoDB",
      "Tags" : {
        "Tag" : [ ]
      }
    } ]
  }
}

Error codes

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