All Products
Search
Document Center

ApsaraDB for MongoDB:EvaluateResource

Last Updated:Jan 16, 2024

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

Operation description

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 a replica set or sharded cluster instance, or upgrading a single node of the 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.

Debug

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dds:EvaluateResourceREAD
  • DBInstance
    acs:dds:{#regionId}:{#accountId}:dbinstance/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-hangzhou
ZoneIdstringYes

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

cn-hangzhou-h
EnginestringNo

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

MongoDB
EngineVersionstringYes

The version of the database engine. Valid values:

  • 5.0
  • 4.4
  • 4.2
  • 4.0
  • 3.4
4.0
DBInstanceClassstringNo

The stype of the instance.

Note 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.
dds.mongo.mid
ShardsInfostringNo

The node information about the sharded cluster instance. 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"}]
 }

Parameters in the example:

  • 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 Sharded cluster instance types.

To check whether resources are sufficient for upgrading a single node of a sharded cluster instance, specify only the information about the node to be upgraded. The value must be a JSON string. Example:

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

Parameters in the example:

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

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

dds-bp14bf67a76d****
ReplicationFactorstringNo

The number of nodes in the instance.

  • Set the value to 1 for standalone instances.
  • Valid values for replica set instances: 3, 5, and 7
Note This parameter is not required for serverless instances.
3
ReadonlyReplicasstringNo

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

Note This parameter is not required for standalone or serverless instances.
1
StoragestringNo

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

Note This parameter is required for the instances that use cloud disks.
10

Response parameters

ParameterTypeDescriptionExample
object
DBInstanceAvailablestring

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

  • 1: The resources are sufficient.
  • 0: The resources are insufficient.
1
EngineVersionstring

The version of the database engine.

4.0
RequestIdstring

The ID of the request.

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

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

MongoDB

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-06-27The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.