PurchaseElasticityAssurance

更新时间:
复制 MD 格式

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.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:PurchaseElasticityAssurance

update

*ElasticityAssurance

acs:ecs:{#regionId}:{#accountId}:elasticityassurance/{#ElasticityAssuranceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

cn-hangzhou

Period

integer

No

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

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

  • When PeriodUnit is set to Year, valid values are 1, 2, 3, 4, and 5.

Default value: 1.

1

PeriodUnit

string

No

The unit of the validity period of the elasticity assurance. Valid values:

  • Month

  • Year

Default value: Year.

Month

PrivatePoolOptions.Id

string

Yes

The ID of the elasticity assurance.

eap-bp67acfmxazb4****

ClientToken

string

No

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.MatchCriteria

string

No

The type of the private pool with which you want to associate the elasticity assurance. Valid values:

  • Open: open private pool. If you use the elasticity assurance to create Elastic Compute Service (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 specified 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

StartTime

string

No

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: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.
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.