Skip to content

EC2  >  Operations  >  purchase_capacity_block

purchase_capacity_block

Operation

purchase_capacity_block async

purchase_capacity_block(request: PurchaseCapacityBlockInput | PurchaseCapacityBlockInputDict, /, *, plugins: list[Plugin] | None = None) -> PurchaseCapacityBlockOutput
purchase_capacity_block(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[PurchaseCapacityBlockInputDict]) -> 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
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

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

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.

Dictionaries

PurchaseCapacityBlockInputDict

Bases: TypedDict

Dictionary form of PurchaseCapacityBlockInput.

Attributes
capacity_block_offering_id instance-attribute
capacity_block_offering_id: Required[str]

The ID of the Capacity Block offering.

dry_run 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 instance-attribute
instance_platform: Required[str]

The type of operating system for which to reserve capacity.

tag_specifications instance-attribute
tag_specifications: Sequence[TagSpecification | TagSpecificationDict] | 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.