Skip to content

describe_snapshots async

describe_snapshots(
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
    directory_id: Optional[DirectoryId] = None,
    snapshot_ids: Optional[SnapshotIds] = None,
    next_token: Optional[NextToken] = None,
    limit: Optional[Limit] = None,
) -> DescribeSnapshotsResult

Obtains information about the directory snapshots that belong to this account.

This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeSnapshots.NextToken member contains a token that you pass in the next call to DescribeSnapshots to retrieve the next set of items.

You can also specify a maximum number of return results with the Limit parameter.

Parameters:

  • directory_id (Optional[DirectoryId], default: None ) –

    The identifier of the directory for which to retrieve snapshot information.

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

    A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the Limit and NextToken members.

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

    The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. Pass null if this is the first call.

  • limit (Optional[Limit], default: None ) –

    The maximum number of objects to return.

Raises:

Examples:

To describe snapshots The following example obtains information about a specified directory snapshot.

>>> await client.describe_snapshots(directory_id='d-92654abfed', snapshot_ids=['s-9267f6da4e'], limit=0)
Source code in docs_src/capo_directory_service/_services/async_directory_service.py
async def describe_snapshots(
    self,
    *,
    config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
    directory_id: Optional[
        "capo_directory_service.types.directory_id.DirectoryId"
    ] = None,
    snapshot_ids: Optional[
        "capo_directory_service.types.snapshot_ids.SnapshotIds"
    ] = None,
    next_token: Optional[
        "capo_directory_service.types.next_token.NextToken"
    ] = None,
    limit: Optional["capo_directory_service.types.limit.Limit"] = None,
) -> (
    "capo_directory_service.types.describe_snapshots_result.DescribeSnapshotsResult"
):
    """<p>Obtains information about the directory snapshots that belong to this account.</p> <p>This operation supports pagination with the use of the <i>NextToken</i> request and response parameters. If more results are available, the <i>DescribeSnapshots.NextToken</i> member contains a token that you pass in the next call to <a>DescribeSnapshots</a> to retrieve the next set of items.</p> <p>You can also specify a maximum number of return results with the <i>Limit</i> parameter.</p>

    Args:
        directory_id: <p>The identifier of the directory for which to retrieve snapshot information.</p>
        snapshot_ids: <p>A list of identifiers of the snapshots to obtain the information for. If this member is null or empty, all snapshots are returned using the <i>Limit</i> and <i>NextToken</i> members.</p>
        next_token: <p>The <i>DescribeSnapshotsResult.NextToken</i> value from a previous call to <a>DescribeSnapshots</a>. Pass null if this is the first call.</p>
        limit: <p>The maximum number of objects to return.</p>

    Raises:
        capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
        capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
        capo_directory_service.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> value is not valid.</p>
        capo_directory_service.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters are not valid.</p>
        capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
        capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe snapshots
        The following example obtains information about a specified directory snapshot.

        >>> await client.describe_snapshots(directory_id='d-92654abfed', snapshot_ids=['s-9267f6da4e'], limit=0)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_directory_service.types.describe_snapshots_request.DescribeSnapshotsRequest]",
    ) -> AsyncOperationResponse[
        "capo_directory_service.types.describe_snapshots_result.DescribeSnapshotsResult"
    ]:
        import capo_directory_service._operations.directory_service_20150416.describe_snapshots

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSnapshots")
    )
    input_: capo_directory_service.types.describe_snapshots_request.DescribeSnapshotsRequest = {}
    if directory_id is not None:
        input_["directory_id"] = directory_id
    if snapshot_ids is not None:
        input_["snapshot_ids"] = snapshot_ids
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit

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