Skip to content

describe_reserved_instances_listings async

describe_reserved_instances_listings(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    reserved_instances_id: Optional[ReservationId] = None,
    reserved_instances_listing_id: Optional[ReservedInstancesListingId] = None,
    filters: Optional[FilterList] = None,
) -> DescribeReservedInstancesListingsResult

Describes your account's Reserved Instance listings in the Reserved Instance Marketplace.

The Reserved Instance Marketplace matches sellers who want to resell Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.

As a seller, you choose to list some or all of your Reserved Instances, and you specify the upfront price to receive for them. Your Reserved Instances are then listed in the Reserved Instance Marketplace and are available for purchase.

As a buyer, you specify the configuration of the Reserved Instance to purchase, and the Marketplace matches what you're searching for with what's available. The Marketplace first sells the lowest priced Reserved Instances to you, and continues to sell available Reserved Instance listings to you until your demand is met. You are charged based on the total price of all of the listings that you purchase.

For more information, see Sell in the Reserved Instance Marketplace in the Amazon EC2 User Guide.

The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

Parameters:

  • reserved_instances_id (Optional[ReservationId], default: None ) –

    One or more Reserved Instance IDs.

  • reserved_instances_listing_id (Optional[ReservedInstancesListingId], default: None ) –

    One or more Reserved Instance listing IDs.

  • filters (Optional[FilterList], default: None ) –

    One or more filters.

    • reserved-instances-id - The ID of the Reserved Instances.

    • reserved-instances-listing-id - The ID of the Reserved Instances listing.

    • status - The status of the Reserved Instance listing (pending | active | cancelled | closed).

    • status-message - The reason for the status.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_reserved_instances_listings(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    reserved_instances_id: Optional[
        "capo_ec2.types.reservation_id.ReservationId"
    ] = None,
    reserved_instances_listing_id: Optional[
        "capo_ec2.types.reserved_instances_listing_id.ReservedInstancesListingId"
    ] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
) -> "capo_ec2.types.describe_reserved_instances_listings_result.DescribeReservedInstancesListingsResult":
    """<p>Describes your account's Reserved Instance listings in the Reserved Instance Marketplace.</p> <p>The Reserved Instance Marketplace matches sellers who want to resell Reserved Instance capacity that they no longer need with buyers who want to purchase additional capacity. Reserved Instances bought and sold through the Reserved Instance Marketplace work like any other Reserved Instances.</p> <p>As a seller, you choose to list some or all of your Reserved Instances, and you specify the upfront price to receive for them. Your Reserved Instances are then listed in the Reserved Instance Marketplace and are available for purchase.</p> <p>As a buyer, you specify the configuration of the Reserved Instance to purchase, and the Marketplace matches what you're searching for with what's available. The Marketplace first sells the lowest priced Reserved Instances to you, and continues to sell available Reserved Instance listings to you until your demand is met. You are charged based on the total price of all of the listings that you purchase.</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> <note> <p>The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.</p> </note>

    Args:
        reserved_instances_id: <p>One or more Reserved Instance IDs.</p>
        reserved_instances_listing_id: <p>One or more Reserved Instance listing IDs.</p>
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>reserved-instances-id</code> - The ID of the Reserved Instances.</p> </li> <li> <p> <code>reserved-instances-listing-id</code> - The ID of the Reserved Instances listing.</p> </li> <li> <p> <code>status</code> - The status of the Reserved Instance listing (<code>pending</code> | <code>active</code> | <code>cancelled</code> | <code>closed</code>).</p> </li> <li> <p> <code>status-message</code> - The reason for the status.</p> </li> </ul>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.describe_reserved_instances_listings_request.DescribeReservedInstancesListingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_reserved_instances_listings_result.DescribeReservedInstancesListingsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_reserved_instances_listings

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeReservedInstancesListings")
    )
    input_: capo_ec2.types.describe_reserved_instances_listings_request.DescribeReservedInstancesListingsRequest = {}
    if reserved_instances_id is not None:
        input_["reserved_instances_id"] = reserved_instances_id
    if reserved_instances_listing_id is not None:
        input_["reserved_instances_listing_id"] = reserved_instances_listing_id
    if filters is not None:
        input_["filters"] = filters

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output