Changes the billing method of a PolarDB cluster.
Operation description
PolarDB clusters support two billing methods: subscription and pay-as-you-go. You can change the billing method of a cluster from subscription to pay-as-you-go, or from pay-as-you-go to subscription. For more information, see Change the billing method from subscription to pay-as-you-go and Change the billing method from pay-as-you-go to subscription.
You cannot change the billing method from pay-as-you-go to subscription if your Alibaba Cloud account has an insufficient balance.
When you change the billing method from subscription to pay-as-you-go, the system automatically refunds your remaining prepaid fees.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:TransformDBClusterPayType |
update |
*DBCluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
Yes |
The ID of the PolarDB cluster. |
pc-bp10gr51qasnl**** |
| PayType |
string |
Yes |
The billing method of the instance. Valid values:
|
Prepaid |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| UsedTime |
string |
No |
The subscription duration. Valid values:
Note
This parameter is required when you set PayType to Prepaid. |
1 |
| Period |
string |
No |
The unit of the subscription duration. Valid values:
Note
This parameter is required when you set PayType to Prepaid. |
Month |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-acfm3f4un32**** |
| ClientToken |
string |
No |
A client token to ensure the idempotence of the request. The client generates the token, but you must make sure that the token is unique among different requests. The token is case-sensitive and can be up to 64 ASCII characters in length. |
6000170000591aed949d0f5******************** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
5E71541A-6007-4DCC-A38A-F872C31FEB45 |
| ChargeType |
string |
The billing method of the instance. Valid values:
|
Prepaid |
| DBClusterId |
string |
The ID of the PolarDB cluster. |
pc-bp10gr51qasnl**** |
| ExpiredTime |
string |
The expiration time of the instance. Note
This parameter is returned only when PayType is set to Prepaid. |
2020-04-20T10:00:00Z |
| OrderId |
string |
The order ID. |
20515760028**** |
Examples
Success response
JSON format
{
"RequestId": "5E71541A-6007-4DCC-A38A-F872C31FEB45",
"ChargeType": "Prepaid",
"DBClusterId": "pc-bp10gr51qasnl****",
"ExpiredTime": "2020-04-20T10:00:00Z",
"OrderId": "20515760028****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidOrderCharge.NotSupport | The specified order charge does not support in PolarDB. | |
| 400 | InvalidOrderTask.NotSupport | The Current ClusterId exist Order Task in PolarDB. | |
| 400 | InvalidPaymentMethod.Incomplete | No payment method is specified for your account. We recommend that you add a payment method. | The valid payment method of vouchers is not specified for your account. Add a valid payment method. |
| 400 | InvalidPayType.Malformed | The specified parameter PayType is not valid. | The specified PayType parameter is invalid. |
| 400 | InvalidPeriod.Malformed | The specified parameter Period is not valid. | The specified Period parameter is invalid. |
| 400 | InvalidUsedTime.Malformed | The specified parameter UsedTime is not valid. | The specified UsedTime parameter is invalid. |
| 400 | InvalidPeriodUnit.Malformed | The specified parameter PeriodUnit is not valid. | The specified PeriodUnit parameter is invalid. |
| 403 | OperationDenied.LockMode | The operation is not permitted when the instance is locked. | This operation is not supported while the cluster is in the locked state. |
| 403 | OperationDenied.DBClusterDeletionLock | The operation is not permitted due to the deletion lock of cluster. | This operation is not supported while a deletion lock exists in the cluster. |
| 404 | InvalidDBCluster.NotFound | The specified DBClusterId is not found. | The specified cluster ID does not exist. |
| 404 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | The specified DBClusterId parameter is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.