/AWS1/IF_EC2=>CANCELCAPACITYRESERVATION()¶
About CancelCapacityReservation¶
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.
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.
Method Signature¶
METHODS /AWS1/IF_EC2~CANCELCAPACITYRESERVATION
IMPORTING
!IV_CAPACITYRESERVATIONID TYPE /AWS1/EC2CAPACITYRESERVATIONID OPTIONAL
!IV_DRYRUN TYPE /AWS1/EC2BOOLEAN OPTIONAL
!IV_APPLYCANCELLATIONCHARGES TYPE /AWS1/EC2APPLYCANCLCHARGES OPTIONAL
!IV_QUOTEID TYPE /AWS1/EC2CAPRESVCANCLQUOTEID OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ec2canccapreservati01
RAISING
/AWS1/CX_EC2CLIENTEXC
/AWS1/CX_EC2SERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_capacityreservationid TYPE /AWS1/EC2CAPACITYRESERVATIONID /AWS1/EC2CAPACITYRESERVATIONID¶
The ID of the Capacity Reservation to be cancelled.
Optional arguments:¶
iv_dryrun TYPE /AWS1/EC2BOOLEAN /AWS1/EC2BOOLEAN¶
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 isUnauthorizedOperation.
iv_applycancellationcharges TYPE /AWS1/EC2APPLYCANCLCHARGES /AWS1/EC2APPLYCANCLCHARGES¶
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.
iv_quoteid TYPE /AWS1/EC2CAPRESVCANCLQUOTEID /AWS1/EC2CAPRESVCANCLQUOTEID¶
The ID of the cancellation quote to use for the cancellation. You can generate a cancellation quote by using the
CreateCapacityReservationCancellationQuoteaction. The cancellation quote must be in anactivestate.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ec2canccapreservati01 /AWS1/CL_EC2CANCCAPRESERVATI01¶
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->cancelcapacityreservation(
iv_applycancellationcharges = |string|
iv_capacityreservationid = |string|
iv_dryrun = ABAP_TRUE
iv_quoteid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_boolean = lo_result->get_return( ).
ENDIF.