EvaluateResource

Updated at:

Evaluates whether sufficient resources are available before you purchase an instance or change instance specifications.

Operation description

This operation applies to resource evaluation for ApsaraDB for MongoDB replica set and sharded cluster instances. It supports resource evaluation for purchasing replica set and sharded cluster instances, changing instance specifications, and adding nodes to sharded clusters.

Note

You can call this operation up to 200 times per minute. Exceeding this limit results in throttling.

To query the list of available instance types in a specified zone (based on sales constraints rather than real-time inventory), use the DescribeAvailableResource operation.

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 region ID. You can call DescribeRegions to query available regions.

cn-hangzhou

ZoneId

string

Yes

The zone ID. You can call DescribeRegions to query available zones.

cn-hangzhou-h

Engine

string

No

The database engine. Set the value to MongoDB.

Valid values:

  • MongoDB

MongoDB

EngineVersion

string

Yes

The database engine version.

Valid values:

  • 4.0 :

    4.0

  • 5.0 :

    5.0

  • 4.2 :

    4.2

  • 6.0 :

    6.0

  • 3.4 :

    3.4

  • 7.0 :

    7.0

  • 4.4 :

    4.4

  • 8.0 :

    8.0

4.2

DBInstanceClass

string

No

The instance type.

Note

This parameter is required when you evaluate resources for a replica set instance. For more information 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.

When you evaluate resources for a new sharded cluster, you must specify the specifications of each shard in a JSON-formatted character 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"}]
 }

Parameter descriptions in the example:

  • ConfigSvrs: the ConfigServer nodes.

  • Mongos: the mongos nodes.

  • Shards: the shard nodes.

  • Storage: the storage capacity of the target shard.

  • DBInstanceClass: the instance type of the target shard. For more information, see Sharded cluster instance types.

When you evaluate resources for an upgrade or downgrade of a sharded cluster, you only need to specify the node information in a JSON-formatted character string. Example:

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

Parameter descriptions in the example:

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

DBInstanceId

string

No

The instance ID. This parameter is required when you evaluate resources for changing instance specifications.

dds-bp14bf67a76d****

ReplicationFactor

string

No

The number of nodes in the instance.

  • For a standalone instance, the value is fixed to 1.

  • For an instance with shared storage, the value is fixed to 2.

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

Note

This parameter is not required for serverless instances.

Valid values:

  • 1
  • 3
  • 5
  • 7
  • 2

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 or serverless instances.

Valid values:

  • 1
  • 2
  • 3
  • 4
  • 5

1

Storage

string

No

The storage capacity of the replica set instance. Unit: GB.

Note

This parameter is required when 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 available.

  • 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.