cancel_capacity_reservation¶
Operation¶
cancel_capacity_reservation
¶
cancel_capacity_reservation(request: CancelCapacityReservationInput | CancelCapacityReservationInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CancelCapacityReservationInputDict]) -> CancelCapacityReservationOutput
Cancels the specified Capacity Reservation, releases the reserved
capacity, and changes the Capacity Reservation's state to cancelled.
You can cancel a Capacity Reservation that is in the following states:
-
assessing -
scheduled--- requires a cancellation quote. UseCreateCapacityReservationCancellationQuoteto generate a quote, then pass the quote ID withApplyCancellationChargesset tocommitment-wind-down. The cancellation charge depends on how close the reservation is to its start date. -
activeand there is no commitment duration or the commitment duration has elapsed. -
activeduring the commitment duration --- requires a cancellation quote. UseCreateCapacityReservationCancellationQuoteto generate a quote, then pass the quote ID withApplyCancellationChargesset tocommitment-wind-down. The Capacity Reservation transitions tocancellingwhile charges are applied. -
delayed--- the commitment duration is waived, so no cancellation charge applies.
Note
You can't modify or cancel a Capacity Block. For more information, see Capacity Blocks for ML.
Instances running in the reserved capacity continue running until you stop them. Stopped instances that target the Capacity Reservation can no longer launch. Modify these instances to either target a different Capacity Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation that has matching attributes and sufficient capacity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
CancelCapacityReservationInput | CancelCapacityReservationInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[CancelCapacityReservationInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CancelCapacityReservationOutput
|
An instance of |
cancel_capacity_reservation
async
¶
cancel_capacity_reservation(request: CancelCapacityReservationInput | CancelCapacityReservationInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CancelCapacityReservationInputDict]) -> CancelCapacityReservationOutput
Cancels the specified Capacity Reservation, releases the reserved
capacity, and changes the Capacity Reservation's state to cancelled.
You can cancel a Capacity Reservation that is in the following states:
-
assessing -
scheduled--- requires a cancellation quote. UseCreateCapacityReservationCancellationQuoteto generate a quote, then pass the quote ID withApplyCancellationChargesset tocommitment-wind-down. The cancellation charge depends on how close the reservation is to its start date. -
activeand there is no commitment duration or the commitment duration has elapsed. -
activeduring the commitment duration --- requires a cancellation quote. UseCreateCapacityReservationCancellationQuoteto generate a quote, then pass the quote ID withApplyCancellationChargesset tocommitment-wind-down. The Capacity Reservation transitions tocancellingwhile charges are applied. -
delayed--- the commitment duration is waived, so no cancellation charge applies.
Note
You can't modify or cancel a Capacity Block. For more information, see Capacity Blocks for ML.
Instances running in the reserved capacity continue running until you stop them. Stopped instances that target the Capacity Reservation can no longer launch. Modify these instances to either target a different Capacity Reservation, launch On-Demand Instance capacity, or run in any open Capacity Reservation that has matching attributes and sufficient capacity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
CancelCapacityReservationInput | CancelCapacityReservationInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[CancelCapacityReservationInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CancelCapacityReservationOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
CancelCapacityReservationInputDict
¶
Bases: TypedDict
Dictionary form of CancelCapacityReservationInput.
Attributes¶
apply_cancellation_charges
instance-attribute
¶
apply_cancellation_charges: str | None
Specifies the cancellation charge type to apply when cancelling a
future-dated Capacity Reservation during its commitment duration.
Possible values include commitment-wind-down, which continues billing
for the remaining commitment duration without delivering capacity.
capacity_reservation_id
instance-attribute
¶
The ID of the Capacity Reservation to be cancelled.
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.
CancelCapacityReservationInput
dataclass
¶
Bases: _SerdeShape
Dataclass for CancelCapacityReservationInput structure.
Attributes¶
apply_cancellation_charges
class-attribute
instance-attribute
¶
apply_cancellation_charges: str | None = ...
Specifies the cancellation charge type to apply when cancelling a
future-dated Capacity Reservation during its commitment duration.
Possible values include commitment-wind-down, which continues billing
for the remaining commitment duration without delivering capacity.
capacity_reservation_id
class-attribute
instance-attribute
¶
capacity_reservation_id: str | None = ...
The ID of the Capacity Reservation to be cancelled.
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.
Output¶
CancelCapacityReservationOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for CancelCapacityReservationOutput structure.