Skip to content

EC2  >  Operations  >  purchase_capacity_block

purchase_capacity_block

Operation

purchase_capacity_block async

purchase_capacity_block(input: PurchaseCapacityBlockInput, plugins: list[Plugin] | None = None) -> PurchaseCapacityBlockOutput

Purchase the Capacity Block for use with your account. With Capacity Blocks you ensure GPU capacity is available for machine learning (ML) workloads. You must specify the ID of the Capacity Block offering you are purchasing.

Parameters:

Name Type Description Default
input PurchaseCapacityBlockInput

An instance of PurchaseCapacityBlockInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
PurchaseCapacityBlockOutput

An instance of PurchaseCapacityBlockOutput.

Input

PurchaseCapacityBlockInput dataclass

Bases: _SerdeShape

Dataclass for PurchaseCapacityBlockInput structure.

Attributes

capacity_block_offering_id class-attribute instance-attribute
capacity_block_offering_id: str | None = ...

The ID of the Capacity Block offering.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

instance_platform class-attribute instance-attribute
instance_platform: str | None = ...

The type of operating system for which to reserve capacity.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to apply to the Capacity Block during launch.

Output

PurchaseCapacityBlockOutput dataclass

Bases: _SerdeShape

Dataclass for PurchaseCapacityBlockOutput structure.

Attributes

capacity_blocks class-attribute instance-attribute
capacity_blocks: list[CapacityBlock] | None = ...

The Capacity Block.

capacity_reservation class-attribute instance-attribute
capacity_reservation: CapacityReservation | None = ...

The Capacity Reservation.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.