Skip to content

describe_capacity_reservation_billing_requests async

describe_capacity_reservation_billing_requests(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    capacity_reservation_ids: Optional[CapacityReservationIdSet] = None,
    role: Optional[CallerRole] = None,
    next_token: Optional[String] = None,
    max_results: Optional[
        DescribeCapacityReservationBillingRequestsRequestMaxResults
    ] = None,
    filters: Optional[FilterList] = None,
    dry_run: Optional[Boolean] = None,
) -> DescribeCapacityReservationBillingRequestsResult

Describes a request to assign the billing of the unused capacity of a Capacity Reservation. For more information, see Billing assignment for shared Amazon EC2 Capacity Reservations.

Parameters:

  • capacity_reservation_ids (Optional[CapacityReservationIdSet], default: None ) –

    The ID of the Capacity Reservation.

  • role (Optional[CallerRole], default: None ) –

    Specify one of the following:

    • odcr-owner - If you are the Capacity Reservation owner, specify this value to view requests that you have initiated. Not supported with the requested-by filter.

    • unused-reservation-billing-owner - If you are the consumer account, specify this value to view requests that have been sent to you. Not supported with the unused-reservation-billing-owner filter.

  • next_token (Optional[String], default: None ) –

    The token to use to retrieve the next page of results.

  • max_results (Optional[DescribeCapacityReservationBillingRequestsRequestMaxResults], default: None ) –

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

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

    One or more filters.

    • status - The state of the request (pending | accepted | rejected | cancelled | revoked | expired).

    • requested-by - The account ID of the Capacity Reservation owner that initiated the request. Not supported if you specify requested-by for Role.

    • unused-reservation-billing-owner - The ID of the consumer account to which the request was sent. Not supported if you specify unused-reservation-billing-owner for Role.

  • 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.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_capacity_reservation_billing_requests(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    capacity_reservation_ids: Optional[
        "capo_ec2.types.capacity_reservation_id_set.CapacityReservationIdSet"
    ] = None,
    role: Optional["capo_ec2.types.caller_role.CallerRole"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_capacity_reservation_billing_requests_request_max_results.DescribeCapacityReservationBillingRequestsRequestMaxResults"
    ] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.describe_capacity_reservation_billing_requests_result.DescribeCapacityReservationBillingRequestsResult":
    """<p>Describes a request to assign the billing of the unused capacity of a Capacity Reservation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/transfer-billing.html"> Billing assignment for shared Amazon EC2 Capacity Reservations</a>.</p>

    Args:
        capacity_reservation_ids: <p>The ID of the Capacity Reservation.</p>
        role: <p>Specify one of the following:</p> <ul> <li> <p> <code>odcr-owner</code> - If you are the Capacity Reservation owner, specify this value to view requests that you have initiated. Not supported with the <code>requested-by</code> filter.</p> </li> <li> <p> <code>unused-reservation-billing-owner</code> - If you are the consumer account, specify this value to view requests that have been sent to you. Not supported with the <code>unused-reservation-billing-owner</code> filter.</p> </li> </ul>
        next_token: <p>The token to use to retrieve the next page of results.</p>
        max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>status</code> - The state of the request (<code>pending</code> | <code>accepted</code> | <code>rejected</code> | <code>cancelled</code> | <code>revoked</code> | <code>expired</code>).</p> </li> <li> <p> <code>requested-by</code> - The account ID of the Capacity Reservation owner that initiated the request. Not supported if you specify <code>requested-by</code> for <b>Role</b>.</p> </li> <li> <p> <code>unused-reservation-billing-owner</code> - The ID of the consumer account to which the request was sent. Not supported if you specify <code>unused-reservation-billing-owner</code> for <b>Role</b>.</p> </li> </ul>
        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>

    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_capacity_reservation_billing_requests_request.DescribeCapacityReservationBillingRequestsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_capacity_reservation_billing_requests_result.DescribeCapacityReservationBillingRequestsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_capacity_reservation_billing_requests

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

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeCapacityReservationBillingRequests"),
    )
    input_: capo_ec2.types.describe_capacity_reservation_billing_requests_request.DescribeCapacityReservationBillingRequestsRequest = {}
    if capacity_reservation_ids is not None:
        input_["capacity_reservation_ids"] = capacity_reservation_ids
    if role is not None:
        input_["role"] = role
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filters is not None:
        input_["filters"] = filters
    if dry_run is not None:
        input_["dry_run"] = dry_run

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