Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace.
For more information, see Sell in the Reserved Instance Marketplace in the Amazon EC2 User Guide.
Parameters:
Raises:
Source code in docs_src/capo_ec2/_services/ec2.py
| def cancel_reserved_instances_listing(
self,
*,
config_overrides: Optional[EC2ClientConfig] = None,
reserved_instances_listing_id: Optional[
"capo_ec2.types.reserved_instances_listing_id.ReservedInstancesListingId"
] = None,
) -> "capo_ec2.types.cancel_reserved_instances_listing_result.CancelReservedInstancesListingResult":
"""<p>Cancels the specified Reserved Instance listing in the Reserved Instance Marketplace.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html">Sell in the Reserved Instance Marketplace</a> in the <i>Amazon EC2 User Guide</i>.</p>
Args:
reserved_instances_listing_id: <p>The ID of the Reserved Instance listing.</p>
Raises:
capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ec2.types.cancel_reserved_instances_listing_request.CancelReservedInstancesListingRequest]",
) -> OperationResponse[
"capo_ec2.types.cancel_reserved_instances_listing_result.CancelReservedInstancesListingResult"
]:
import capo_ec2._operations.amazon_ec2.cancel_reserved_instances_listing
output, http_response = (
capo_ec2._operations.amazon_ec2.cancel_reserved_instances_listing.cancel_reserved_instances_listing(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CancelReservedInstancesListing")
)
input_: capo_ec2.types.cancel_reserved_instances_listing_request.CancelReservedInstancesListingRequest = {}
if reserved_instances_listing_id is not None:
input_["reserved_instances_listing_id"] = reserved_instances_listing_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|