All Products
Search
Document Center

Tair (Redis® OSS-Compatible):TransformInstanceChargeType

Last Updated:Dec 19, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
kvstore:TransformInstanceChargeTypeupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance. You can call the DescribeInstances operation to query the ID of the instance.

r-bp1zxszhcgatnx****
PeriodlongNo

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
AutoPaybooleanNo

Specifies whether to enable automatic payment. Default value: true. Valid values:

  • true: Automatic payment is enabled.
  • false: Automatic payment is disabled. If automatic payment is disabled, you must perform the following steps to complete the payment: In the top navigation bar of the ApsaraDB for Redis console, choose Expenses > Renewal Management. In the left-side navigation pane of the Billing Management console, click Orders. On the Orders page, find the order and complete the payment.
true
ChargeTypestringYes

The new billing method. Valid values:

  • PrePaid: subscription. If you set this parameter to PrePaid, you must also specify the Period parameter.
  • PostPaid: pay-as-you-go
PrePaid
AutoRenewstringNo

Specifies whether to enable auto-renewal for the instance. Valid values:

  • true: enables auto-renewal.
  • false (default): disables auto-renewal.
false
AutoRenewPeriodlongNo

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

ParameterTypeDescriptionExample
object
EndTimestring

The time when the instance expires.

Note A value is returned for this parameter only if the instance was changed from pay-as-you-go to subscription.
2021-05-13T00:00:00Z
RequestIdstring

The ID of the request.

82C791FB-8979-489E-853D-706D7743****
OrderIdstring

The ID of the order.

20881824000****

Examples

Sample success responses

JSONformat

{
  "EndTime": "2021-05-13T00:00:00Z",
  "RequestId": "82C791FB-8979-489E-853D-706D7743****",
  "OrderId": "20881824000****"
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterPeriod is mandatory for this action.-
400InvalidParamPeriod is invalidThe specified subscription duration is invalid.
400ResourceNotAvailableResource you requested is not available for finance user.The requested resource is unavailable to users of Alibaba Finance Cloud.
400InsufficientBalanceYour account does not have enough balance.Your account balance is insufficient. Add funds to your account and try again.
400Order.LatestOrderIsHandingLatest order is handing, please retry later.-
403RealNameAuthenticationErrorYour 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 timeSummary of changesOperation
2023-11-21The Error code has changed. The request parameters of the API has changedView Change Details
2023-07-20API Description Update. The Error code has changedView Change Details