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 (aliyun.com).

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.

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 Yes ModifyDBInstanceSpec

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

RegionId String No cn-hangzhou

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

DBInstanceId String Yes dds-bp1ea17b41ab****

The ID of the instance.

DBInstanceClass String No dds.sn4.xlarge.1

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

Note You must specify at least one of the DBInstanceClass and DBInstanceStorage parameters.
DBInstanceStorage String No 50

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.

Note
  • 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.
OrderType String No UPGRADE

The type of the modification. Valid values:

  • UPGRADE
  • DOWNGRADE
Note This parameter can be configured only when the billing method of the instance is subscription.
AutoPay Boolean No true

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.
BusinessInfo String No {“ActivityId":"000000000"}

The business information.

ReplicationFactor String No 3

The number of nodes in the instance.

  • Valid values of replica set instances: 3, 5, and 7
  • Valid values of standalone instances: 1
Note This parameter is not required for a serverless instance which is only available on the China site (aliyun.com).
ReadonlyReplicas String No 1

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.

Note You can go to the Database Connections page to view the types of networks that are enabled.
CouponNo String No youhuiquan_promotion_option_id_for_blank

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

EffectiveTime String No Immediately

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.

Response parameters

Parameter Type Example Description
RequestId String 1E9F1104-19E7-59F0-AB7F-F4EBFDEA****

The ID of the request.

OrderId String 21012408824****

The ID of the order.

Examples

Sample requests

http(s)://mongodb.aliyuncs.com/?Action=ModifyDBInstanceSpec
&DBInstanceId=dds-bp1ea17b41ab****
&DBInstanceClass=dds.sn4.xlarge.1
&DBInstanceStorage=50
&OrderType=UPGRADE
&AutoPay=true
&BusinessInfo={“ActivityId":"000000000"}
&ReplicationFactor=3
&ReadonlyReplicas=1
&CouponNo=youhuiquan_promotion_option_id_for_blank
&EffectiveTime=Immediately
&Common request parameters

Sample success responses

XML format

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

<ModifyDBInstanceSpecResponse>
    <RequestId>1E9F1104-19E7-59F0-AB7F-F4EBFDEA****</RequestId>
    <OrderId>21012408824****</OrderId>
</ModifyDBInstanceSpecResponse>

JSON format

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

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

Error codes

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