Skip to content

accept_reserved_instances_exchange_quote

accept_reserved_instances_exchange_quote(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    reserved_instance_ids: Optional[ReservedInstanceIdSet] = None,
    target_configurations: Optional[TargetConfigurationRequestSet] = None,
) -> AcceptReservedInstancesExchangeQuoteResult

Accepts the Convertible Reserved Instance exchange quote described in the GetReservedInstancesExchangeQuote call.

Parameters:

  • dry_run (Optional[Boolean], default: 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.

  • reserved_instance_ids (Optional[ReservedInstanceIdSet], default: None ) –

    The IDs of the Convertible Reserved Instances to exchange for another Convertible Reserved Instance of the same or higher value.

  • target_configurations (Optional[TargetConfigurationRequestSet], default: None ) –

    The configuration of the target Convertible Reserved Instance to exchange for your current Convertible Reserved Instances.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def accept_reserved_instances_exchange_quote(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    reserved_instance_ids: Optional[
        "capo_ec2.types.reserved_instance_id_set.ReservedInstanceIdSet"
    ] = None,
    target_configurations: Optional[
        "capo_ec2.types.target_configuration_request_set.TargetConfigurationRequestSet"
    ] = None,
) -> "capo_ec2.types.accept_reserved_instances_exchange_quote_result.AcceptReservedInstancesExchangeQuoteResult":
    """<p>Accepts the Convertible Reserved Instance exchange quote described in the <a>GetReservedInstancesExchangeQuote</a> call.</p>

    Args:
        dry_run: <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        reserved_instance_ids: <p>The IDs of the Convertible Reserved Instances to exchange for another Convertible Reserved Instance of the same or higher value.</p>
        target_configurations: <p>The configuration of the target Convertible Reserved Instance to exchange for your current Convertible Reserved Instances.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.accept_reserved_instances_exchange_quote_request.AcceptReservedInstancesExchangeQuoteRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.accept_reserved_instances_exchange_quote_result.AcceptReservedInstancesExchangeQuoteResult"
    ]:
        import capo_ec2._operations.amazon_ec2.accept_reserved_instances_exchange_quote

        output, http_response = (
            capo_ec2._operations.amazon_ec2.accept_reserved_instances_exchange_quote.accept_reserved_instances_exchange_quote(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AcceptReservedInstancesExchangeQuote")
    )
    input_: capo_ec2.types.accept_reserved_instances_exchange_quote_request.AcceptReservedInstancesExchangeQuoteRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if reserved_instance_ids is not None:
        input_["reserved_instance_ids"] = reserved_instance_ids
    if target_configurations is not None:
        input_["target_configurations"] = target_configurations

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output