ModifyDBInstanceSpec

Updated at:

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

Operation description

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

This operation is applicable only to ApsaraDB for MongoDB standalone instances, replica set instances, and serverless instances. To modify the configurations of a sharded cluster instance, call the ModifyNodeSpec, CreateNode, DeleteNode, or ModifyNodeSpecBatch operation based on your business requirements.

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

update

*Instance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

dds-bp1ea17b41ab****

DBInstanceClass

string

No

The instance type.

  • For standalone instances and replica set instances, set this parameter to the instance type. For more information, see Instance types. You can also call the DescribeAvailableResource operation to query the instance types of standalone instances and replica set instances.

  • For serverless instances, set this parameter to the compute specifications of the instance. Valid values: 100 to 8000.

Note

You must specify at least one of this parameter and the DBInstanceStorage parameter.

dds.sn4.xlarge.1

DBInstanceStorage

string

No

The storage capacity of the instance.

  • For standalone instances and replica set instances, valid values are 10 to 3000. Unit: GB. The value must be a multiple of 10. The instance storage capacity is subject to the instance type. For more information, see Instance types.

  • For serverless instances, valid values are 1 to 100. Unit: GB. The value must be a multiple of 1.

Note
  • You must specify at least one of this parameter and the DBInstanceClass parameter.

  • You cannot downgrade the storage capacity.

50

OrderType

string

No

The type of the configuration change. Valid values:

  • UPGRADE: upgrades the configurations. This is the default value.

  • DOWNGRADE: downgrades the configurations.

Note

You can specify this parameter only when the instance uses the subscription billing method.

Valid values:

  • UPGRADE
  • DOWNGRADE

UPGRADE

AutoPay

boolean

No

Specifies whether to enable automatic payment for the instance. Valid values:

  • true: enables automatic payment. This is the default value. Make sure that your account has sufficient balance.

  • false: disables automatic payment. You must manually pay for the order in the console. Log on to the ApsaraDB for MongoDB console. In the upper-right corner of the page, choose Expenses > Expenses and Costs. In the left-side navigation pane, choose Orders > My Orders. On the Orders tab, find the order and complete the payment.

true

BusinessInfo

string

No

The business information.

{“ActivityId":"000000000"}

ReplicationFactor

string

No

The number of nodes in the instance. Default value: 3.

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

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

  • For a replica set instance that uses shared storage (supported only on the China site), the value is fixed to 2.

Note

You do not need to specify this parameter for a serverless instance (supported only on the China site).

Valid values:

  • 1
  • 3
  • 5
  • 7
  • 2

3

ReadonlyReplicas

string

No

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

If the instance is connected to both the classic network and a VPC, you must enable Internet access or release the classic network before you can change the number of read-only nodes.

Note

You can log on to the ApsaraDB for MongoDB console and go to the Database Connections page to view the enabled network types.

1

CouponNo

string

No

Specifies whether to use a coupon. Valid values:

  • default or null: uses a coupon. This is the default value.

  • youhuiquan_promotion_option_id_for_blank: does not use a coupon.

default

EffectiveTime

string

No

The effective period of the configuration change. Valid values:

  • Immediately: takes effect immediately. This is the default value.

  • MaintainTime: takes effect during the maintenance window of the instance.

Valid values:

  • Immediately
  • MaintainTime
  • 0
  • 1

Immediately

ExtraParam

string

No

The additional parameter. Valid values:

  • async: returns the result after the configuration change order is created.

  • sync: returns the result when the configuration change is delivered to the instance after the order is created.

Valid values:

  • async :

    async

  • sync :

    sync

async

TargetZoneId

string

No

The destination zone for the instance migration when you migrate the instance across zones and change its configurations at the same time. The instance will be active in this zone after migration.

Important This parameter is supported only for cloud disk instances.
Important The value of this parameter cannot be the same as the value of the TargetSecondaryZoneId or TargetHiddenZoneId parameter.

Note
  • You must specify this parameter only when you migrate the instance across zones and change its configurations at the same time.

  • The destination zone and the current zone of the instance must be in the same region.

  • You can call the DescribeRegions operation to query zone IDs.

cn-hangzhou-j

TargetSecondaryZoneId

string

No

The destination zone for the secondary node when you cloud disk instance across zones and change its configurations at the same time.

Important This parameter is supported only for instances with cloud disks.
Important The value of this parameter cannot be the same as the value of the TargetZoneId or TargetHiddenZoneId parameter.

Note
  • You must specify this parameter only when you cloud disk instance across zones and change its configurations at the same time.

  • This parameter is available only for multi-zone migration.

  • The destination zone and the current zone of the instance must be in the same region.

  • You can call the DescribeRegions operation to query zone IDs.

cn-hangzhou-h

TargetHiddenZoneId

string

No

The destination zone for the hidden node when you cloud disk instance across zones and change its configurations at the same time.

Important This parameter is supported only for instances with cloud disks.
Important The value of this parameter cannot be the same as the value of the TargetZoneId or TargetSecondaryZoneId parameter.

Note
  • You must specify this parameter only when you cloud disk instance across zones and change its configurations at the same time.

  • This parameter is available only for multi-zone migration.

  • The destination zone and the current zone of the instance must be in the same region.

  • You can call the DescribeRegions operation to query zone IDs.

cn-hangzhou-i

AlignPrimaryZone

boolean

No

Specifies whether to automatically align the primary node to the primary zone after operations such as configuration changes for a multi-zone instance. If you choose not to align the node, one primary/secondary switchover (transient disconnection) is avoided. Default value: true, which indicates that the node is aligned.

TargetVswitchId

string

No

The ID of the destination vSwitch when you cloud disk instance across zones and change its configurations at the same time.

Important This parameter is supported only for instances with cloud disks.

Note
  • You must specify this parameter only when you cloud disk instance across zones and change its configurations at the same time.

vsw-bp1buy0h9myt5i9e7****

SearchNodeClass

string

No

The node specifications of the search node for the configuration change.

mdb.shard.2x.xlarge.d

SearchNodeStorage

integer

No

The storage capacity of the search node for the configuration change.

20

SearchNodeCount

integer

No

The number of search nodes for the configuration change.

2

ClientToken

string

No

The client token that is used to ensure the idempotence of the request and prevent duplicate submissions. You can generate the value of this parameter on the client side. Make sure that the value is unique across different requests. The value can be up to 64 ASCII characters in length and cannot contain non-ASCII characters.

qwertyui1234567

DryRun

boolean

No

Specifies whether to perform a dry run on the request. Valid values:

  • true: performs a dry run without calling the operation. The system checks the request parameters, request format, service limits, and inventory. If the request fails the dry run, the system returns an error. If the request passes the dry run, the system returns the DryRunOperation error code.

  • false: sends the request. This is the default value. If the request passes the dry run, the system directly performs the operation.

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

OrderId

string

The order ID.

21012408824****

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

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.
400 ErrorInsufficientResource There is not enough resource for your operation, requestId: %s. There is not enough resource for your operation, requestId: %s.
403 OperationDenied The resource is out of usage. 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. The instance ID does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.