All Products
Search
Document Center

ApsaraDB for MongoDB:ModifyDBInstanceSpec

Last Updated:Jan 17, 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 (aliyun.com).

Operation Description

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.
Operate access level Resource type conditional keyword Association operation
dds:ModifyDBInstanceSpec WRITE
  • MongoDB
    acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
    without
without

Request parameters

Parameter Type Required Description Example
DBInstanceId string Yes

The ID of the instance.

dds-bp1ea17b41ab****
DBInstanceClass string No

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.
dds.sn4.xlarge.1
DBInstanceStorage string No

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.
  • 50
    OrderType string No

    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.
    UPGRADE
    AutoPay boolean No

    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.
    true
    BusinessInfo string No

    The business information.

    {“ActivityId":"000000000"}
    ReplicationFactor string No

    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).
    3
    ReadonlyReplicas string No

    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.
    1
    CouponNo string No

    The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

    youhuiquan_promotion_option_id_for_blank
    EffectiveTime string No

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

    Response parameters

    Parameter Type Description Example
    object
    RequestId string

    The ID of the request.

    1E9F1104-19E7-59F0-AB7F-F4EBFDEA****
    OrderId string

    The ID of the order.

    21012408824****

    Example

    Normal return example

    JSONFormat

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

    Error codes

    Http code Error code Error message
    400 MissingParameter The input parameters DBInstanceClass and DBInstanceStorage all blank or no change.
    400 InvalidDBInstanceClass.ValueNotSupported The specified parameter DBInstanceClass is not valid.
    400 InvalidDBInstanceStorage.ValueNotSupported The specified parameter DBInstanceStorage is not valid.
    400 LX_REQUEST_TOKEN_CONFLICT The request token is conflict.
    400 TradeConfirmPayError BIZ_ERROR - degrade refund error
    400 PRICE.ORIGIN_PRICE_ERROR Origin lingxiao price request error.
    403 OperationDenied The resource is out of usage.
    403 InvaildDBInstanceClassInRegion.NotAvailable The DBInstanceClass in the Region is not available.
    404 InvalidDBInstanceId.NotFound The DBInstanceId provided does not exist in our records.

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