UpdateInstanceChargeType
Changes the billing method of an Elasticsearch instance. You can transform a pay-as-you-go instance to a subscription instance, or an upfront instance to pay-as-you-go.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:UpdateInstanceChargeType |
update |
*Instance
|
None | None |
Request syntax
POST /openapi/instances/{InstanceId}/actions/convert-pay-type HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. |
es-cn-0pp1jxvcl000z**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| clientToken |
string |
No |
Ensures the idempotence of the request. The value is generated by the client and must be unique across different requests. The value can be up to 64 ASCII characters in length. |
5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
| body |
object |
No |
The request body for changing the billing method. |
{ "paymentInfo":{ "duration":1, "pricingCycle":"Month" }, "paymentType":"prepaid" } |
| paymentInfo |
object |
No |
The billing information of the instance after the conversion. This parameter is required only when the target billing method is subscription. |
|
| duration |
integer |
No |
The subscription duration. If pricingCycle is set to Year, valid values are 1 to 3. If pricingCycle is set to Month, valid values are 1 to 9. |
1 |
| pricingCycle |
string |
No |
The subscription unit. This parameter is required. Valid values:
|
Month |
| paymentType |
string |
No |
The billing method. Valid values:
|
prepaid |
Request body
The request body must also include the following parameters to specify the billing information of the instance after it is switched to the subscription billing method.
| Name | Type | Required | Example | Description |
| paymentInfo | Array | No | The billing information of the instance after the conversion. This parameter is required only when the target billing method is subscription. | |
| └duration | Integer | Yes | 1 | The subscription duration. If pricingCycle is set to Year, valid values are 1 to 3. If pricingCycle is set to Month, valid values are 1 to 9. |
| └pricingCycle | String | Yes | Year | The subscription cycle. Valid values: Year and Month. |
| paymentType | String | Yes | prepaid | The target billing method of the instance. Valid values: prepaid (subscription) and postpaid (pay-as-you-go). |
└ indicates a child parameter.
The following example shows the request body for switching to the subscription billing method.
{
"paymentInfo":{
"duration":1,
"pricingCycle":"Month"
},
"paymentType":"prepaid"
}
The following example shows the request body for switching to the pay-as-you-go billing method.
{
"paymentType":"postpaid"
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Result |
boolean |
The return result. Valid values:
|
true |
| RequestId |
string |
The request ID. |
5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D**** |
Examples
Success response
JSON format
{
"Result": true,
"RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.