Purchases an elastic capacity reservation service. You can use this operation to purchase an elastic capacity reservation service that is prepared and in an inactive state.
Operation description
Make sure that you fully understand the billing methods and pricing of elastic capacity reservation before you use this operation.
Before you purchase an elastic capacity reservation service, you can call DescribeElasticityAssurances to query available elastic capacity reservation services.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:PurchaseElasticityAssurance |
update |
*ElasticityAssurance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the elastic capacity reservation service. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| Period |
integer |
No |
The purchase duration. The unit of the duration is determined by the PeriodUnit parameter. Valid values:
Default value: 1. |
1 |
| PeriodUnit |
string |
No |
The unit of the purchase duration. Valid values:
Default value: Year. |
Month |
| PrivatePoolOptions.Id |
string |
Yes |
The ID of the elastic capacity reservation service. |
eap-bp67acfmxazb4**** |
| ClientToken |
string |
No |
Ensures the idempotence of the request. The value is generated from your client and must be unique among different requests. The |
123e4567-e89b-12d3-a456-426655440000 |
| PrivatePoolOptions.MatchCriteria |
string |
No |
The matching mode of the elastic capacity reservation service. Valid values:
Default value: Open. |
Open |
| StartTime |
string |
No |
The effective period of the elastic capacity reservation service. By default, the service takes effect when the operation is invoked. Specify the time in the ISO 8601 standard in the |
2024-06-18T00:00:00Z |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidStartTime.MalFormed | The specified StartTime is out of the permitted range. | The specified StartTime value exceeds the maximum allowed value. |
| 400 | Invalid.PrivatePoolOptions.Id | The PrivatePool does not exist. | The private pool does not exist. |
| 400 | InvalidParameter.PeriodUnit | The specified PeriodUnit is not supported. | The specified PeriodUnit parameter is invalid. |
| 401 | InvalidUser.Unauthorized | The user is not authorized. | The account you are currently using does not have permission. |
| 500 | InternalError | Internal error. | An error occurred while sending the request. Try again later. |
| 403 | IncorrectPrivatePoolStatus | The current status of the private pool does not support this operation. | The specified private pool state does not support the operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.