Skip to content

describe_snapshots async

describe_snapshots(
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    snapshot_ids: Optional[SnapshotIds] = None,
    filters: Optional[SnapshotFilters] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    include_shared: Optional[IncludeShared] = None,
) -> DescribeSnapshotsResponse

Returns the description of specific Amazon FSx for OpenZFS snapshots, if a SnapshotIds value is provided. Otherwise, this operation returns all snapshots owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling.

When retrieving all snapshots, you can optionally specify the MaxResults parameter to limit the number of snapshots in a response. If more backups remain, Amazon FSx returns a NextToken value in the response. In this case, send a later request with the NextToken request parameter set to the value of NextToken from the last response.

Use this operation in an iterative process to retrieve a list of your snapshots. DescribeSnapshots is called first without a NextToken value. Then the operation continues to be called with the NextToken parameter set to the value of the last NextToken value until a response has no NextToken value.

When using this operation, keep the following in mind:

  • The operation might return fewer than the MaxResults value of snapshot descriptions while still including a NextToken value.

  • The order of snapshots returned in the response of one DescribeSnapshots call and the order of backups returned across the responses of a multi-call iteration is unspecified.

Parameters:

  • snapshot_ids (Optional[SnapshotIds], default: None ) –

    The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a SnapshotNotFound error occurs.

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

    The filters structure. The supported names are file-system-id or volume-id.

  • include_shared (Optional[IncludeShared], default: None ) –

    Set to false (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to true if you want to see the snapshots in your account and the ones shared with you from another account.

Raises:

  • BadRequest –

    A generic error indicating a failure with a client request.

  • InternalServerError –

    A generic error indicating a server-side failure.

  • SnapshotNotFound –

    No Amazon FSx snapshots were found based on the supplied parameters.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fsx/_services/async_f_sx.py
async def describe_snapshots(
    self,
    *,
    config_overrides: Optional[AsyncFSxClientConfig] = None,
    snapshot_ids: Optional["capo_fsx.types.snapshot_ids.SnapshotIds"] = None,
    filters: Optional["capo_fsx.types.snapshot_filters.SnapshotFilters"] = None,
    max_results: Optional["capo_fsx.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_fsx.types.next_token.NextToken"] = None,
    include_shared: Optional["capo_fsx.types.include_shared.IncludeShared"] = None,
) -> "capo_fsx.types.describe_snapshots_response.DescribeSnapshotsResponse":
    """<p>Returns the description of specific Amazon FSx for OpenZFS snapshots, if a <code>SnapshotIds</code> value is provided. Otherwise, this operation returns all snapshots owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling.</p> <p>When retrieving all snapshots, you can optionally specify the <code>MaxResults</code> parameter to limit the number of snapshots in a response. If more backups remain, Amazon FSx returns a <code>NextToken</code> value in the response. In this case, send a later request with the <code>NextToken</code> request parameter set to the value of <code>NextToken</code> from the last response. </p> <p>Use this operation in an iterative process to retrieve a list of your snapshots. <code>DescribeSnapshots</code> is called first without a <code>NextToken</code> value. Then the operation continues to be called with the <code>NextToken</code> parameter set to the value of the last <code>NextToken</code> value until a response has no <code>NextToken</code> value.</p> <p>When using this operation, keep the following in mind:</p> <ul> <li> <p>The operation might return fewer than the <code>MaxResults</code> value of snapshot descriptions while still including a <code>NextToken</code> value.</p> </li> <li> <p>The order of snapshots returned in the response of one <code>DescribeSnapshots</code> call and the order of backups returned across the responses of a multi-call iteration is unspecified. </p> </li> </ul>

    Args:
        snapshot_ids: <p>The IDs of the snapshots that you want to retrieve. This parameter value overrides any filters. If any IDs aren't found, a <code>SnapshotNotFound</code> error occurs.</p>
        filters: <p>The filters structure. The supported names are <code>file-system-id</code> or <code>volume-id</code>.</p>
        include_shared: <p>Set to <code>false</code> (default) if you want to only see the snapshots owned by your Amazon Web Services account. Set to <code>true</code> if you want to see the snapshots in your account and the ones shared with you from another account.</p>

    Raises:
        capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
        capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
        capo_fsx.errors.snapshot_not_found.SnapshotNotFound: <p>No Amazon FSx snapshots were found based on the supplied parameters.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fsx.types.describe_snapshots_request.DescribeSnapshotsRequest]",
    ) -> AsyncOperationResponse[
        "capo_fsx.types.describe_snapshots_response.DescribeSnapshotsResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.describe_snapshots

        (
            output,
            http_response,
        ) = await capo_fsx._operations.aws_simba_api_service_v20180301.describe_snapshots.async_describe_snapshots(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_fsx.types.describe_snapshots_response.DescribeSnapshotsResponse",
    ) -> dict[str, Any]:
        import capo_fsx.types.describe_snapshots_response

        return capo_fsx.types.describe_snapshots_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeSnapshots", redact_output=_redact_output),
    )
    input_: capo_fsx.types.describe_snapshots_request.DescribeSnapshotsRequest = {}
    if snapshot_ids is not None:
        input_["snapshot_ids"] = snapshot_ids
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if include_shared is not None:
        input_["include_shared"] = include_shared

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