All Products
Search
Document Center

ApsaraDB for MongoDB:EvaluateResource

Last Updated:Jan 30, 2026

Evaluates whether sufficient resources are available before you purchase a new instance or upgrade or downgrade an existing instance.

Operation description

This operation evaluates resources for MongoDB replica set and sharded cluster instances. You can evaluate resources for scenarios such as purchasing an instance, upgrading or downgrading an instance, or adding nodes to a sharded cluster.

Note

You can call this operation up to 200 times per minute. Calls that exceed this limit are subject to traffic throttling.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dds:EvaluateResource

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region. For more information, see DescribeRegions.

cn-hangzhou

ZoneId

string

Yes

The ID of the zone. For more information, see DescribeRegions.

cn-hangzhou-h

Engine

string

No

The database engine. Set the value to MongoDB.

MongoDB

EngineVersion

string

Yes

The database engine version.

4.2

DBInstanceClass

string

No

The instance type.

Note

This parameter is required when you evaluate resources for a replica set instance. For details about instance types, see Instance types.

dds.mongo.mid

ShardsInfo

string

No

The shard information of the sharded cluster. This parameter is required when you evaluate resources for a sharded cluster instance.

To evaluate resources for a new sharded cluster instance, specify the instance type for each shard in 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"}]
 }

The parameters in the example are described as follows:

  • ConfigSvrs: The ConfigServer nodes.

  • Mongos: The Mongos nodes.

  • Shards: The shard nodes.

  • Storage: The storage space of the target shard.

  • DBInstanceClass: The instance type of the target shard. For details about instance types, see Sharded cluster instance types.

To evaluate resources for upgrading or downgrading a sharded cluster instance, specify only the node information in a JSON string. Example:

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

The parameters in the example are described as follows:

  • NodeId: The ID of the target node.

  • NodeClass: The instance type of the target node. For details about instance types, see Sharded cluster instance types.

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

DBInstanceId

string

No

The instance ID. This parameter is required when you evaluate resources for an instance upgrade or downgrade.

dds-bp14bf67a76d****

ReplicationFactor

string

No

The number of nodes in the instance.

  • Set the value to 1 for a standalone instance.

  • Set the value to 2 for an instance that uses shared storage.

  • For a replica set instance, valid values are 3, 5, and 7.

3

ReadonlyReplicas

string

No

The number of read-only nodes in the instance. Valid values: 1 to 5.

Note

This parameter is not required for standalone instances.

1

Storage

string

No

The storage space of the replica set. Unit: GB.

Note

This parameter is required if the instance uses cloud disks.

10

Response elements

Element

Type

Description

Example

object

DBInstanceAvailable

string

Indicates whether resources are available in the current region. Valid values:

  • 1: Resources are sufficient.

  • 0: Resources are insufficient.

1

EngineVersion

string

The database engine version.

4.0

RequestId

string

The request ID.

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

Engine

string

The database engine. The value is fixed to MongoDB.

MongoDB

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.