Skip to content

describe_snapshots async

describe_snapshots(
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    replication_group_id: Optional[String] = None,
    cache_cluster_id: Optional[String] = None,
    snapshot_name: Optional[String] = None,
    snapshot_source: Optional[String] = None,
    marker: Optional[String] = None,
    max_records: Optional[IntegerOptional] = None,
    show_node_group_config: Optional[BooleanOptional] = None,
) -> DescribeSnapshotsListMessage

Returns information about cluster or replication group snapshots. By default, DescribeSnapshots lists all of your snapshots; it can optionally describe a single snapshot, or just the snapshots associated with a particular cache cluster.

This operation is valid for Valkey or Redis OSS only.

Parameters:

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

    A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.

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

    A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.

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

    A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.

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

    If set to system, the output shows snapshots that were automatically created by ElastiCache. If set to user the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.

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

    An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

  • max_records (Optional[IntegerOptional], default: None ) –

    The maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved.

    Default: 50

    Constraints: minimum 20; maximum 50.

  • show_node_group_config (Optional[BooleanOptional], default: None ) –

    A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.

Raises:

Examples:

DescribeSnapshots Returns information about the snapshot mysnapshot. By default.

>>> await client.describe_snapshots(snapshot_name='snapshot-20161212')
Source code in docs_src/capo_elasticache/_services/async_elasti_cache.py
async def describe_snapshots(
    self,
    *,
    config_overrides: Optional[AsyncElastiCacheClientConfig] = None,
    replication_group_id: Optional["capo_elasticache.types.string.String"] = None,
    cache_cluster_id: Optional["capo_elasticache.types.string.String"] = None,
    snapshot_name: Optional["capo_elasticache.types.string.String"] = None,
    snapshot_source: Optional["capo_elasticache.types.string.String"] = None,
    marker: Optional["capo_elasticache.types.string.String"] = None,
    max_records: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    show_node_group_config: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
) -> "capo_elasticache.types.describe_snapshots_list_message.DescribeSnapshotsListMessage":
    """<p>Returns information about cluster or replication group snapshots. By default, <code>DescribeSnapshots</code> lists all of your snapshots; it can optionally describe a single snapshot, or just the snapshots associated with a particular cache cluster.</p> <note> <p>This operation is valid for Valkey or Redis OSS only.</p> </note>

    Args:
        replication_group_id: <p>A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that specific replication group are described.</p>
        cache_cluster_id: <p>A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific cluster are described.</p>
        snapshot_name: <p>A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.</p>
        snapshot_source: <p>If set to <code>system</code>, the output shows snapshots that were automatically created by ElastiCache. If set to <code>user</code> the output shows snapshots that were manually created. If omitted, the output shows both automatically and manually created snapshots.</p>
        marker: <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
        max_records: <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p> <p>Default: 50</p> <p>Constraints: minimum 20; maximum 50.</p>
        show_node_group_config: <p>A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.</p>

    Raises:
        capo_elasticache.errors.cache_cluster_not_found_fault.CacheClusterNotFoundFault: <p>The requested cluster ID does not refer to an existing cluster.</p>
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.snapshot_not_found_fault.SnapshotNotFoundFault: <p>The requested snapshot name does not refer to an existing snapshot.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        DescribeSnapshots
        Returns information about the snapshot mysnapshot. By default.

        >>> await client.describe_snapshots(snapshot_name='snapshot-20161212')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elasticache.types.describe_snapshots_message.DescribeSnapshotsMessage]",
    ) -> AsyncOperationResponse[
        "capo_elasticache.types.describe_snapshots_list_message.DescribeSnapshotsListMessage"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.describe_snapshots

        (
            output,
            http_response,
        ) = await capo_elasticache._operations.amazon_elasti_cache_v9.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_elasticache.types.describe_snapshots_message.DescribeSnapshotsMessage = {}
    if replication_group_id is not None:
        input_["replication_group_id"] = replication_group_id
    if cache_cluster_id is not None:
        input_["cache_cluster_id"] = cache_cluster_id
    if snapshot_name is not None:
        input_["snapshot_name"] = snapshot_name
    if snapshot_source is not None:
        input_["snapshot_source"] = snapshot_source
    if marker is not None:
        input_["marker"] = marker
    if max_records is not None:
        input_["max_records"] = max_records
    if show_node_group_config is not None:
        input_["show_node_group_config"] = show_node_group_config

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