All Products
Document Center

ApsaraDB for MongoDB:ModifyDBInstanceSpec

Last Updated:Feb 28, 2023

Modifies the specifications or storage space of an ApsaraDB for MongoDB standalone, replica set, or serverless instance. Serverless instances are available only on the China site (


Before you call this operation, make sure that you understand the billing methods and pricing of ApsaraDB for MongoDB.

This operation applies only to standalone and replica set instances. To modify the specifications of sharded cluster instances, you can call the ModifyNodeSpec, CreateNode, DeleteNode, or ModifyNodeSpecBatch operation.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • 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 keyword: refers to the condition keyword defined by the cloud product itself.
  • 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.
OperateAccess levelResource typeCondition keywordAssociation operation
  • MongoDB

Request parameters


The ID of the instance.


The instance type. For more information, see Instance types. You can also call the DescribeAvailableResource operation to view instance types.

NoteYou must specify at least one of the DBInstanceClass and DBInstanceStorage parameters.

The storage capacity of the instance. Valid values: 10 to 3000. The value must be a multiple of 10. Unit: GB. The values that can be specified for this parameter are subject to the instance types. For more information, see Instance types.

  • You must specify at least one of the DBInstanceStorage and DBInstanceClass parameters.

  • Storage capacity can be scaled down only for pay-as-you-go replica set instances. The new storage capacity you specify must be greater than the used storage capacity.


The type of the configuration change. Default value: DOWNGRADE. Valid values:

NoteThis parameter can be configured only when the billing method of the instance is subscription.

Specifies whether to enable automatic payment. Default value: true. Valid values:

  • true: enables automatic payment. Make sure that your Alibaba Cloud account has a sufficient balance.
  • false: disables automatic payment. You can perform the following operations to pay for the instance: Log on to the ApsaraDB for MongoDB console. In the upper-right corner of the page, choose Expenses > User Center. In the left-side navigation pane, choose Order Management > Order. On the Orders for Services tab, find the order and pay for the order.

The business information.


The number of nodes in the instance.

  • Valid values of replica set instances: 3, 5, and 7
  • Valid values of standalone instances: 1
NoteThis parameter is not required for a serverless instance which is only available on the China site (

The number of read-only nodes. Valid values: 0 to 5.

If your instance has only Classic Network and VPC endpoints, you must apply for a public endpoint or release the classic network endpoint for the instance before you can change the Read-only Nodes value.

NoteYou can go to the Database Connections page to view the types of networks that are enabled.

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.


The time when the changed configurations take effect. Default value: Immediately. Valid values:

  • Immediately: The configurations immediately take effect.
  • MaintainTime: The configurations take effect during the maintenance window of the instance.

Additional parameter


Response parameters


The ID of the request.


The ID of the order.



Normal return example


  "RequestId": "1E9F1104-19E7-59F0-AB7F-F4EBFDEA****",
  "OrderId": "21012408824****"

Error codes

HTTP status codeError codeError message
400MissingParameterThe input parameters DBInstanceClass and DBInstanceStorage all blank or no change.
400InvalidDBInstanceClass.ValueNotSupportedThe specified parameter DBInstanceClass is not valid.
400InvalidDBInstanceStorage.ValueNotSupportedThe specified parameter DBInstanceStorage is not valid.
400LX_REQUEST_TOKEN_CONFLICTThe request token is conflict.
400TradeConfirmPayErrorBIZ_ERROR - degrade refund error
400PRICE.ORIGIN_PRICE_ERROROrigin lingxiao price request error.
403OperationDeniedThe resource is out of usage.
403InvaildDBInstanceClassInRegion.NotAvailableThe DBInstanceClass in the Region is not available.
404InvalidDBInstanceId.NotFoundThe DBInstanceId provided does not exist in our records.

For a list of error codes, visit the API error center.