All Products
Search
Document Center

Elastic Compute Service:PurchaseElasticityAssurance

Last Updated:Nov 14, 2024

Purchases an elasticity assurance that is not in the Active state and for which resources are prepared.

Operation description

Before you call this operation, familiarize yourself with the billing rules and pricing of elasticity assurances.

Before you purchase an elasticity assurance, you can call the DescribeElasticityAssurances operation to query the elasticity assurances that you can purchase.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:PurchaseElasticityAssuranceupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the elasticity assurance. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
PeriodintegerNo

The term of the elasticity assurance. The unit of the term is determined by the PeriodUnit value. Valid values:

  • When the PeriodUnit parameter is set to Month, valid values are 1, 2, 3, 4, 5, 6, 7, 8, and 9.
  • When the PeriodUnit parameter is set to Year, valid values are 1, 2, 3, 4, and 5.

Default value: 1.

1
PeriodUnitstringNo

The unit of the term of the elasticity assurance. Valid values:

  • Month
  • Year

Default value: Year.

Month
PrivatePoolOptions.IdstringYes

The ID of the elasticity assurance.

eap-bp67acfmxazb4****
ClientTokenstringNo

The client token that is used 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 token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-426655440000
PrivatePoolOptions.MatchCriteriastringNo

The type of the private pool that is associated with the elasticity assurance. Valid values:

  • Open: open private pool. If you use the elasticity assurance to create ECS instances, the open private pool that is associated with the elasticity assurance is automatically matched. If no capacity is available in the open private pool, resources in the public pool are automatically used to create the ECS instances.
  • Target: targeted private pool. If you use the elasticity assurance to create ECS instances, the targeted private pool that is associated with the elasticity assurance is automatically matched. If no capacity is available in the private pool, the ECS instances fail to be created.

Default value: Open.

Open
StartTimestringNo

The time when the elasticity assurance takes effect. The default value is the time when the elasticity assurance is created. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For more information, see ISO 8601.

2024-06-18T00:00Z

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidStartTime.MalFormedThe specified StartTime is out of the permitted range.The specified StartTime value exceeds the maximum allowed value.
400Invalid.PrivatePoolOptions.IdThe PrivatePool does not exist.The private pool does not exist.
400InvalidParameter.PeriodUnitThe specified PeriodUnit is not supported.The specified PeriodUnit parameter is invalid.
401InvalidUser.UnauthorizedThe user is not authorized.The account you are currently using does not have permission.
403IncorrectPrivatePoolStatusThe current status of the private pool does not support this operation.The specified private pool state does not support the operation.
500InternalErrorInternal error.-
500InternalError%sAn internal error has occurred.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history