Skip to content

get_reserved_instances_exchange_quote async

get_reserved_instances_exchange_quote(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    reserved_instance_ids: Optional[ReservedInstanceIdSet] = None,
    target_configurations: Optional[TargetConfigurationRequestSet] = None,
) -> GetReservedInstancesExchangeQuoteResult

Returns a quote and exchange information for exchanging one or more specified Convertible Reserved Instances for a new Convertible Reserved Instance. If the exchange cannot be performed, the reason is returned in the response. Use AcceptReservedInstancesExchangeQuote to perform the exchange.

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.

  • 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/async_ec2.py
async def get_reserved_instances_exchange_quote(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = 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.get_reserved_instances_exchange_quote_result.GetReservedInstancesExchangeQuoteResult":
    """<p>Returns a quote and exchange information for exchanging one or more specified Convertible Reserved Instances for a new Convertible Reserved Instance. If the exchange cannot be performed, the reason is returned in the response. Use <a>AcceptReservedInstancesExchangeQuote</a> to perform the exchange.</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.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.get_reserved_instances_exchange_quote_request.GetReservedInstancesExchangeQuoteRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.get_reserved_instances_exchange_quote_result.GetReservedInstancesExchangeQuoteResult"
    ]:
        import capo_ec2._operations.amazon_ec2.get_reserved_instances_exchange_quote

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.get_reserved_instances_exchange_quote.async_get_reserved_instances_exchange_quote(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetReservedInstancesExchangeQuote")
    )
    input_: capo_ec2.types.get_reserved_instances_exchange_quote_request.GetReservedInstancesExchangeQuoteRequest = {}
    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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output