Changes the billing method of an ApsaraDB for Redis instance from subscription to pay-as-you-go or from pay-as-you-go to subscription.
Operation description
Before you call this operation, make sure that you understand relevant precautions and billing rules. For more information, see the following topics:
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- 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 Key: the condition key that is defined by the cloud service.
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
kvstore:TransformInstanceChargeType | update |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the instance. You can call the DescribeInstances operation to query the ID of the instance. | r-bp1zxszhcgatnx**** |
Period | long | No | The subscription duration. Unit: months. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36. Note
This parameter is valid and required only if you set the ChargeType parameter to PrePaid.
| 1 |
AutoPay | boolean | No | Specifies whether to enable automatic payment. Default value: true. Valid values:
| true |
ChargeType | string | Yes | The new billing method. Valid values:
| PrePaid |
AutoRenew | string | No | Specifies whether to enable auto-renewal for the instance. Valid values:
| false |
AutoRenewPeriod | long | No | The subscription duration that is supported by auto-renewal. Unit: month. Valid values: 1, 2, 3, 6, and 12. Note
This parameter is required if the AutoRenew parameter is set to true.
| 1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"EndTime": "2021-05-13T00:00:00Z",
"RequestId": "82C791FB-8979-489E-853D-706D7743****",
"OrderId": "20881824000****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | MissingParameter | Period is mandatory for this action. | - |
400 | InvalidParam | Period is invalid | The specified subscription duration is invalid. |
400 | ResourceNotAvailable | Resource you requested is not available for finance user. | The requested resource is unavailable to users of Alibaba Finance Cloud. |
400 | InsufficientBalance | Your account does not have enough balance. | Your account balance is insufficient. Add funds to your account and try again. |
400 | Order.LatestOrderIsHanding | Latest order is handing, please retry later. | - |
403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | Your account has not completed real-name verification. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-11-21 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-07-20 | API Description Update. The Error code has changed | View Change Details |