Creates an elasticity assurance in a region. When you call this operation, you can specify parameters, such as ZoneId and InstanceType, in the request.
Operation description
Elasticity Assurance provides a new way to purchase and use resources with flexibility and assurance. It offers assured resource reservations for pay-as-you-go Elastic Compute Service (ECS) instances. For more information, see Overview of Elasticity Assurance.
- Elasticity assurances are not refundable after purchase.
- Elasticity assurances are applicable to only pay-as-you-go ECS instances.
- Elasticity assurances support only the unlimited mode. Therefore, you can set
AssuranceTimes
only toUnlimited
. Elasticity assurances in unlimited mode can be applied an unlimited number of times within their effective period and take effect immediately after they are purchased.
Debugging
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 |
---|---|---|---|---|
ecs:CreateElasticityAssurance | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region in which to create the elasticity assurance. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
ResourceGroupId | string | No | The ID of the resource group to which to assign the elasticity assurance. | rg-bp67acfmxazb4p**** |
Tag | array<object> | No | The tags to add to the elasticity assurance. | |
object | No | The tag to add to the elasticity assurance. | ||
Key | string | No | The key of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain | TestKey |
Value | string | No | The value of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with | TestValue |
Period | integer | No | The term of the elasticity assurance. The unit of the term is determined by the
Default value: 1. | 1 |
PeriodUnit | string | No | The unit of the term of the elasticity assurance. Valid values:
Default value: Year. | Year |
ClientToken | string | No | The client token that you want to use to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The | 0c593ea1-3bea-11e9-b96b-88e9fe637760 |
PrivatePoolOptions.Name | string | No | The name of the elasticity assurance. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with | eapTestName |
Description | string | No | The description of the elasticity assurance. The description must be 2 to 256 characters in length. It cannot start with This parameter is empty by default. | This is description. |
PrivatePoolOptions.MatchCriteria | string | No | The type of the private pool with which you want to associate the elasticity assurance. Valid values:
Default value: Open. | Open |
AssuranceTimes | string | No | The total number of times that the elasticity assurance can be applied. Set the value to Unlimited. This value indicates that the elasticity assurance can be applied an unlimited number of times within its effective duration. Default value: Unlimited. | Unlimited |
InstanceAmount | integer | No | The total number of instances for which to reserve capacity of an instance type. Valid values: 1 to 1000. | 2 |
InstanceCpuCoreCount | integer | No | Note
This parameter is no longer used.
| null |
StartTime | string | No | The time when the elasticity assurance takes effect. The default value is the time when the CreateElasticityAssurance operation is called to create the elasticity assurance. Specify the time in the ISO 8601 standard in the | 2020-10-30T06:32:00Z |
ZoneId | array | Yes | The ID of the zone in which to create the elasticity assurance. An elasticity assurance can be used to reserve resources within a single zone. | |
string | Yes | The ID of the zone in which to create the elasticity assurance. An elasticity assurance can be used to reserve resources within a single zone. | cn-hangzhou-h | |
InstanceType | array | Yes | The instance type. An elasticity assurance can be created to reserve the capacity of a single instance type. | |
string | Yes | The instance type. An elasticity assurance can be created to reserve the capacity of a single instance type. | ecs.c6.xlarge |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PrivatePoolOptionsId": "eap-bp67acfmxazb4****",
"OrderId": "1234567890"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | OperationDenied | The specified InstanceType or Zone is not available or not authorized. | The specified instance type or zone is unavailable or you are not authorized to use the specified instance type or access the specified zone. |
400 | MissingParameter.RegionId | The specified RegionId should not be null. | The RegionId parameter is required. |
400 | InvalidStartTime.NotSupported | The specified StartTime should be within 180 calendar days from the current date, and you must specify a precision to hour. | The specified StartTime value is out of range. |
400 | InvalidStartTime.MalFormed | The specified StartTime is out of the permitted range. | The specified StartTime value exceeds the maximum allowed value. |
400 | Invalid.PrivatePoolOptionsName.MalFormed | The specified PrivatePoolOptions.Name is not valid. | - |
400 | Invalid.ZoneId | The specified ZoneId is not valid. | - |
400 | Invalid.InstanceType | The specified InstanceType is not valid. | - |
400 | DedicatedHostNotSupported | DedicatedHost is not supported for PrivatePool. | The private pool does not support dedicated hosts. |
400 | SpotNotSupported | Spot is not supported for PrivatePool. | The private pool does not support preemptible instances. |
400 | ClassicNetworkNotSupported | Classic network is not supported for PrivatePool. | The private pool does not support instances in the classic network. |
400 | Invalid.InstanceId | Instance does not exist. | The specified instance does not exist. |
400 | Invalid.PrivatePoolOptions.MatchCriteria | Target mode does not support this operation. | The operation is not supported while the PrivatePoolOptions.MatchCriteria parameter is set to Target. |
400 | MissingParameter.PrivatePoolOptions.Id | The specified PrivatePoolOptions.Id should not be null. | The PrivatePoolOptions.Id parameter is required. |
400 | Invalid.PrivatePoolOptions.Id | The PrivatePool does not exist. | The private pool does not exist. |
400 | Invalid.InstanceType | The InstanceType does not match the PrivatePool. | The instance type and the private pool do not match. |
400 | Invalid.InstanceChargeType | The InstanceChargeType does not match the PrivatePool. | The instance billing method and the private pool do not match. |
400 | Invalid.ZoneId | The ZoneId does not match the PrivatePool. | The zone and the private pool do not match. |
400 | Invalid.PrivatePoolOptions.status | The PrivatePool has been used up. | - |
400 | Invalid.PrivatePoolOptions.MatchCriteria | The PrivatePoolOptions.MatchCriteria does not match the PrivatePool. | The specified PrivatePoolOptions.MatchCriteria parameter does not match the private pool. |
400 | InvalidPlatform.ValueNotSupported | The Platform does not match the PrivatePool. | The specified Platform parameter does not match the private pool. |
400 | Invalid.PrivatePoolOptions.status | The PrivatePool is expired or inactive. | - |
400 | Invalid.PrivatePoolOptions.status | The PrivatePool status is not valid. | - |
400 | Invalid.PrivatePoolOptions.status | The Instance should be created within 48 hours once the PrivatePool is started. | - |
400 | InvalidAliUid | The PrivatePool does not belong to the user of the Instance. | The specified private pool does not belong to the user who attempted to create the instance. |
400 | Invalid.InstanceId | The Instance dose not attached to a PrivatePool. | The instance and the private pool do not match. |
400 | MissingParameter.PackageType | The specified parameter "PackageType" can not be empty. | - |
400 | MissingParameter.PrivatePoolOptions.Ids | The specified parameter "PrivatePoolOptions.Ids" can not be empty. | - |
400 | MissingParameter.PrivatePoolOptions.Id | The specified parameter "PrivatePoolOptions.Id" can not be empty. | - |
400 | MissingParameter.InstanceCpuCoreCount | The specified parameter "InstanceCpuCoreCount" can not be empty. | - |
400 | MissingParameter.InstanceAmount | The specified parameter "InstanceAmount" can not be empty. | - |
400 | MissingParameter.InstanceCpuCoreCountOrInstanceAmount | The specified parameter "InstanceCpuCoreCount" and "InstanceAmount" must not be empty at the same time. | - |
400 | Invalid.TooManyPrivatePoolOptions.Ids | Too many PrivatePoolOptions.Ids in this request. | The number of specified private pool IDs exceeds the upper limit. |
400 | Invalid.TooManyZoneIds | Too many ZoneIds in the request. | The number of specified zone IDs exceeds the upper limit. |
400 | Invalid.TooManyInstanceTypes | Too many InstanceTypes in the request. | The number of specified instance types exceeds the upper limit. |
400 | Invalid.TooManyUnpaidPrivatePool | Too many PrivatePools create but still unpaid. | Multiple private pools are created but not paid. |
400 | Invalid.InstanceCpuCoreCountOrInstanceAmount | Both InstanceCpuCoreCount and InstanceAmount are provided. | The InstanceCpuCoreCount and InstanceAmount parameters cannot be both specified. |
400 | Invalid.PrivatePoolOptions.Ids | The specified parameter "PrivatePoolOptions.Ids" exist invalid element Id. | - |
400 | Invalid.PackageType | The specified parameter "PackageType" is invalid. | - |
400 | Invalid.PrivatePool.Purchase | The PrivatePool has already paid. | The private pool is already paid. |
400 | Invalid.AssuranceTimes.NotSupported | The value of AssuranceTimes is not supported. | The specified AssuranceTimes parameter is invalid. |
400 | Invalid.TooManyInstanceTypes | The specified parameter "InstanceType" should only has one item. | - |
400 | Invalid.PrivatePoolOptions.MatchCriteria | The specified parameter "PrivatePoolOptions.MatchCriteria" is invalid. | - |
400 | RepeatStartPrivatePool | PrivatePool has already been started. | The private pool is already started. |
400 | Invalid.PrivatePoolOptions.Id | The specified parameter "PrivatePoolOptions.Id" should be empty. | - |
400 | Invalid.InstanceId | Modify DedicatedHost Instance's attachment attributes is not supported. | - |
400 | Invalid.InstanceId | Modify Spot Instance's attachment attributes is not supported. | - |
400 | Invalid.InstanceId | Modify Classic Network Instance's attachment attributes is not supported. | - |
400 | Invalid.PeriodUnit | Only Month or Year is supported for PeriodUnit. | - |
400 | AccountForbidden.ProductCreationLimited | The commodity must be officially operated by Aliyun and in pay-as-you-go billing method. | - |
400 | RegionUnauthorized | There is no authority to create private pool in the specified region. | - |
400 | PriceNotFound | The price of your queried resource is not available now, please try other resources. | The price of the specified resource does not exist. Modify the parameter value and try again later. |
403 | Zone.NotOpen | The specified zone is not granted to you to buy resources yet. | You are not authorized to purchase resources in the specified zone. |
403 | InvalidResourceType.NotSupported | %s | - |
403 | OperationDenied.NoStock | The resource is out of stock in the specified zone. Please try other types, or choose other regions and zones. | The requested resources are unavailable in the specified zone. Try a different resource type or select a different region or zone. |
403 | InvalidInstanceType.NotSupported | The specified InstanceType is invalid. | - |
403 | Invalid.ZoneIds | At least one of the specified ZoneIds are invalid. | - |
403 | Zone.NotOnSale | The specified zone is not available for purchase. | The requested resources are unavailable in the specified zone. Try a different instance type or select a different region or zone. |
404 | InvalidZoneId.NotFound | The specified zoneId does not exist. | The specified zone ID does not exist. |
404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | The specified resource group does not exist. |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | An internal error has occurred. Try again later. |
For a list of error codes, visit the Service error codes.