Changes the billing method of an instance from pay-as-you-go to subscription.
Operation Description
This operation is used to change only the billing method of an instance from pay-as-you-go to subscription.
The following requirements must be met:
The instance belongs to the current account.
The instance uses one of the most recent instance types. For more information, see Instance types.
**
NoteYou cannot change the billing method of an instance that uses a phased-out instance type from pay-as-you-go to subscription. If you want to change the billing method of an instance that uses a phased-out instance type from pay-as-you-go to subscription, you must change the instance type of the instance to one of the most recent instance types. Then, you can change the billing method of the instance from pay-as-you-go to subscription. To change the instance type of an instance, you can change the instance specifications of the instance. For more information, see Change the specifications of an ApsaraDB RDS instance.
The instance uses the pay-as-you-go billing method and is in the Running state.
Your Alibaba Cloud account has no unpaid orders for the instance for which you want to change the billing method.
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 |
---|---|---|---|---|
rds:ModifyDBInstancePayType | WRITE |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The ID of the instance. | rm-bp1842vmucoa5w874 |
UsedTime | integer | No | Valid values when Period is set to Year: 1 to 9. Valid values when Period is set to Month: 1, 2, and 3. | 2 |
PayType | string | Yes | The billing method of the instance. Valid values:
| Prepaid |
Period | string | Yes | The subscription method of the instance. This parameter must be specified when PayType is set to Prepaid.
| Year |
Response parameters
Examples
Sample success responses
JSON
format
{
"OrderId": 100789370230206
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | IncompleteAccountInfo | Your information is incomplete. Complete your information before the operation. | The operation failed. Items that are marked with an asterisk (*) in the account information must be specified. Make sure that you specify these items on the Basic Information page in Account Center. |
400 | IncompleteTaxInfo | Your tax information is incomplete. Complete your information before the operation. | - |
400 | InvalidPaymentMethod.Incomplete | No payment method is specified for your account. We recommend that you add a payment method. | - |
400 | InvalidPaymentMethod.Missing | Your payment method is incomplete. We recommend that you add a payment method. | - |
400 | InsuffcientBalanceOrBankAccount | Add a payment method or add funds to the prepayment balance. Get started by creating an instance. | No valid payment method is specified within your Alibaba Cloud account. Add a valid payment method or add funds to your Alibaba Cloud account. |
400 | InvalidPaymentMethod.NoAccess | No payment method is specified for your account. Please contact your Customer Manager or open a ticket. | - |
400 | InvalidPaymentMethod.Missing | No payment method is specified for your account. We recommend that you add a payment method. | No valid payment method is specified for your Alibaba Cloud account. Add a valid payment method. |
400 | InvalidPaymentMethod.InsufficientBalance | No payment method is specified for your account. We recommend that you add a payment method or add funds to the prepayment balance. | - |
400 | OrderTaskAlreadyExists | Order task already exists. | The specified order task already exists. |
400 | ReadOnlyInstanceNotSupport | Specified ReadOnly Instance not support this operation. | Read-only instances do not support the operation. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||
---|---|---|---|---|---|---|---|---|
2022-06-23 | API Description Update,The error codes of the API operation change. | |||||||
|