Checks whether sufficient resources are available in the region where you want to create or upgrade an ApsaraDB for MongoDB instance.

This operation is applicable to replica set instances and sharded cluster instances. You can call this operation to check whether resources are sufficient for creating an instance, upgrading an instance, or upgrading a single node of a sharded cluster instance.

Note You can call this operation a maximum of 200 times per minute.

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 No EvaluateResource

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

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.

ZoneId String Yes cn-hangzhou-h

The zone ID of the instance. You can call the DescribeRegions operation to query the most recent zone list.

Engine String No MongoDB

The database engine of the instance. Set the value to MongoDB.

EngineVersion String Yes 4.0

The database engine version of the instance. Valid values:

  • 5.0
  • 4.4
  • 4.2
  • 4.0
  • 3.4
DBInstanceClass String No dds.mongo.mid

The instance type.

This parameter is required when you check whether resources are sufficient for creating or upgrading a replica set instance. For more information about instance types, see Instance types.

ShardsInfo String No {"NodeId": "d-bp147c4d9ca7****", "NodeClass": "dds.shard.standard"}

The node information. This parameter is required when you check whether resources are sufficient for creating or upgrading a sharded cluster instance.

To check whether resources are sufficient for creating a sharded cluster instance, specify the specifications of each node in the instance. The value must be a JSON string.

Example:

{
     "ConfigSvrs":
         [{"Storage":20,"DBInstanceClass":"dds.cs.mid"}],
     "Mongos":
         [{"DBInstanceClass":"dds.mongos.standard"},{"DBInstanceClass":"dds.mongos.standard"}],
     "Shards":
         [{"Storage":50,"DBInstanceClass":"dds.shard.standard"},{"Storage":50,"DBInstanceClass":"dds.shard.standard"},   {"Storage":50,"DBInstanceClass":"dds.shard.standard"}]
 }
                                
Note
  • ConfigSvrs: the Configserver node.
  • Mongos: the mongos node.
  • Shards: the shard node.
  • Storage: the storage space of the node.
  • DBInstanceClass: the instance type of the node. For more information, see Instance types.
  • To check whether resources are sufficient for upgrading a node of a sharded cluster instance, specify only the information of the node to be upgraded. The value must be a JSON string.

    Example:
    
    {
         "NodeId": "d-bp147c4d9ca7****", "NodeClass": "dds.shard.standard"
    } 
                                        
DBInstanceId String No dds-bp14bf67a76d****

The ID of the instance. This parameter is required when you check whether resources are sufficient for upgrading an instance.

Response parameters

Parameter Type Example Description
DBInstanceAvailable String 1

Indicates whether the resources are sufficient in the region. Valid values:

  • 1: The resources are sufficient.
  • 0: The resources are insufficient.
EngineVersion String 4.0

The database engine version of the instance.

RequestId String AE2DE465-E45F-481F-ABD8-37D64173****

The ID of the request.

Engine String MongoDB

The database engine of the instance. The returned value is MongoDB.

Examples

Sample requests

http(s)://mongodb.aliyuncs.com/?Action=EvaluateResource
&Engine=MongoDB
&EngineVersion=4.0
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-h
&DBInstanceClass=dds.mongo.mid
&<Common request parameters>

Sample success responses

XML format

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

<EvaluateResourceResponse>
    <DBInstanceAvailable>1</DBInstanceAvailable>
    <EngineVersion>4.0</EngineVersion>
    <RequestId>AE2DE465-E45F-481F-ABD8-37D64173****</RequestId>
    <Engine>MongoDB</Engine>
</EvaluateResourceResponse>

JSON format

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

{
  "DBInstanceAvailable" : 1,
  "EngineVersion" : "4.0",
  "RequestId" : "AE2DE465-E45F-481F-ABD8-37D64173****",
  "Engine" : "MongoDB"
}

Error codes

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