You can call this operation to change the type of an ApsaraDB for Redis instance.

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 No ModifyInstanceSpec

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

InstanceId String Yes r-j6cxxxxxxxxxxxxx

The ID of the instance.

RegionId String No cn-hangzhou

The ID of the region.

InstanceClass String No redis.master.small.default

The target instance type. For more information about the values of the InstanceClass parameter for different instance types, see Instance types.

Note To downgrade a subscription instance, you must set the OrderType parameter to DOWNGRADE.
BusinessInfo String No 000000000

The ID of the promotion or the business information.

CouponNo String No youhuiquan_promotion_option_id_for_blank

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

ForceUpgrade Boolean No true

Specifies whether to forcibly change the type. Valid values:

  • false
  • true
Note Default value: true.
EffectiveTime String No Immediately

Specifies when the type is changed. Valid values:

  • Immediately: immediately changes the type.
  • MaintainTime: changes the type within the maintenance window.

Default value: Immediately.

AutoPay Boolean No true

Specifies whether to enable auto-renewal. Valid values:

  • true
  • false

Default value: false.

Note If you set this parameter to false, manually renew the instance before the instance expires.
OrderType String No DOWNGRADE

Specifies a change type when you change the configuration of a subscription instance. Valid values:

  • UPGRADE: upgrades the configuration of a subscription instance. This is the default value.
  • DOWNGRADE: downgrades the configuration of a subscription instance.
Note
  • If you change the configuration of a pay-as-you-go instance, this parameter is not required.
  • To downgrade a subscription instance, you must set this parameter to DOWNGRADE.
  • If the price increases after specifications are changed, it is an upgrade configuration. If the price decreases, it is a downgrade configuration. For example, the price of an 8 GB read/write splitting instance with five read replicas is higher than that of a 16 GB cluster instance. If you want to switch a 16 GB cluster instance to an 8 GB read/write splitting instance with five read replicas, you must upgrade the instance.

Response parameters

Parameter Type Example Description
RequestId String 0DA1D7EF-C80D-432C-8758-7D225182626B

The ID of the request.

OrderId String 111111111111111

The ID of the order.

Examples

Sample requests

https://r-kvstore.aliyuncs.com/
?Action=ModifyInstanceSpec
&InstanceId=r-j6cxxxxxxxxxx3d4
&InstanceClass=redis.master.small.default
&<Common request parameters>

Sample success responses

XML format

<ModifyInstanceSpecResponse>
      <OrderId>111111111111111</OrderId>
      <RequestId>0DA1D7EF-C80D-432C-8758-7D225182626B</RequestId>
</ModifyInstanceSpecResponse>

JSON format

{
    "OrderId": "111111111111111",
    "RequestId": "0DA1D7EF-C80D-432C-8758-7D225182626B"
}

Error codes

HttpCode Error code Error message Description
400 PaymentMethodNotFound No payment method has been registered on the account. The error message returned because no payment method has been registered for your account.
400 HasRenewChangeOrder This instance has a renewChange order. The error message returned because an order of renewal with configuration change already exists.

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