Skip to content

list_volumes_in_recycle_bin async

list_volumes_in_recycle_bin(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    volume_ids: Optional[VolumeIdStringList] = None,
    dry_run: Optional[Boolean] = None,
    max_results: Optional[Integer] = None,
    next_token: Optional[String] = None,
) -> ListVolumesInRecycleBinResult

Lists one or more volumes that are currently in the Recycle Bin.

Parameters:

  • volume_ids (Optional[VolumeIdStringList], default: None ) –

    The IDs of the volumes to list. Omit this parameter to list all of the volumes that are in the Recycle Bin.

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

  • max_results (Optional[Integer], 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.

    Valid range: 5 - 500

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

    The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def list_volumes_in_recycle_bin(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    volume_ids: Optional[
        "capo_ec2.types.volume_id_string_list.VolumeIdStringList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    max_results: Optional["capo_ec2.types.integer.Integer"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.list_volumes_in_recycle_bin_result.ListVolumesInRecycleBinResult":
    """<p>Lists one or more volumes that are currently in the Recycle Bin.</p>

    Args:
        volume_ids: <p>The IDs of the volumes to list. Omit this parameter to list all of the volumes that are in the Recycle Bin.</p>
        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>
        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> <p>Valid range: 5 - 500</p>
        next_token: <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</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.list_volumes_in_recycle_bin_request.ListVolumesInRecycleBinRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.list_volumes_in_recycle_bin_result.ListVolumesInRecycleBinResult"
    ]:
        import capo_ec2._operations.amazon_ec2.list_volumes_in_recycle_bin

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListVolumesInRecycleBin")
    )
    input_: capo_ec2.types.list_volumes_in_recycle_bin_request.ListVolumesInRecycleBinRequest = {}
    if volume_ids is not None:
        input_["volume_ids"] = volume_ids
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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