Skip to content

describe_db_cluster_snapshots

describe_db_cluster_snapshots(
    *,
    config_overrides: Optional[DocDBClientConfig] = None,
    db_cluster_identifier: Optional[String] = None,
    db_cluster_snapshot_identifier: Optional[String] = None,
    snapshot_type: Optional[String] = None,
    filters: Optional[FilterList] = None,
    max_records: Optional[IntegerOptional] = None,
    marker: Optional[String] = None,
    include_shared: Optional[Boolean] = None,
    include_public: Optional[Boolean] = None,
) -> DBClusterSnapshotMessage

Returns information about cluster snapshots. This API operation supports pagination.

Parameters:

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

    The ID of the cluster to retrieve the list of cluster snapshots for. This parameter can't be used with the DBClusterSnapshotIdentifier parameter. This parameter is not case sensitive.

    Constraints:

    • If provided, must match the identifier of an existing DBCluster.

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

    A specific cluster snapshot identifier to describe. This parameter can't be used with the DBClusterIdentifier parameter. This value is stored as a lowercase string.

    Constraints:

    • If provided, must match the identifier of an existing DBClusterSnapshot.

    • If this identifier is for an automated snapshot, the SnapshotType parameter must also be specified.

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

    The type of cluster snapshots to be returned. You can specify one of the following values:

    • automated - Return all cluster snapshots that Amazon DocumentDB has automatically created for your Amazon Web Services account.

    • manual - Return all cluster snapshots that you have manually created for your Amazon Web Services account.

    • shared - Return all manual cluster snapshots that have been shared to your Amazon Web Services account.

    • public - Return all cluster snapshots that have been marked as public.

    If you don't specify a SnapshotType value, then both automated and manual cluster snapshots are returned. You can include shared cluster snapshots with these results by setting the IncludeShared parameter to true. You can include public cluster snapshots with these results by setting theIncludePublic parameter to true.

    The IncludeShared and IncludePublic parameters don't apply for SnapshotType values of manual or automated. The IncludePublic parameter doesn't apply when SnapshotType is set to shared. The IncludeShared parameter doesn't apply when SnapshotType is set to public.

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

    This parameter is not currently supported.

  • 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 pagination token (marker) is included in the response so that the remaining results can be retrieved.

    Default: 100

    Constraints: Minimum 20, maximum 100.

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

    An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.

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

    Set to true to include shared manual cluster snapshots from other Amazon Web Services accounts that this Amazon Web Services account has been given permission to copy or restore, and otherwise false. The default is false.

  • include_public (Optional[Boolean], default: None ) –

    Set to true to include manual cluster snapshots that are public and can be copied or restored by any Amazon Web Services account, and otherwise false. The default is false.

Raises:

Source code in docs_src/capo_docdb/_services/doc_db.py
def describe_db_cluster_snapshots(
    self,
    *,
    config_overrides: Optional[DocDBClientConfig] = None,
    db_cluster_identifier: Optional["capo_docdb.types.string.String"] = None,
    db_cluster_snapshot_identifier: Optional[
        "capo_docdb.types.string.String"
    ] = None,
    snapshot_type: Optional["capo_docdb.types.string.String"] = None,
    filters: Optional["capo_docdb.types.filter_list.FilterList"] = None,
    max_records: Optional[
        "capo_docdb.types.integer_optional.IntegerOptional"
    ] = None,
    marker: Optional["capo_docdb.types.string.String"] = None,
    include_shared: Optional["capo_docdb.types.boolean.Boolean"] = None,
    include_public: Optional["capo_docdb.types.boolean.Boolean"] = None,
) -> "capo_docdb.types.db_cluster_snapshot_message.DBClusterSnapshotMessage":
    """<p>Returns information about cluster snapshots. This API operation supports pagination.</p>

    Args:
        db_cluster_identifier: <p>The ID of the cluster to retrieve the list of cluster snapshots for. This parameter can't be used with the <code>DBClusterSnapshotIdentifier</code> parameter. This parameter is not case sensitive. </p> <p>Constraints:</p> <ul> <li> <p>If provided, must match the identifier of an existing <code>DBCluster</code>.</p> </li> </ul>
        db_cluster_snapshot_identifier: <p>A specific cluster snapshot identifier to describe. This parameter can't be used with the <code>DBClusterIdentifier</code> parameter. This value is stored as a lowercase string. </p> <p>Constraints:</p> <ul> <li> <p>If provided, must match the identifier of an existing <code>DBClusterSnapshot</code>.</p> </li> <li> <p>If this identifier is for an automated snapshot, the <code>SnapshotType</code> parameter must also be specified.</p> </li> </ul>
        snapshot_type: <p>The type of cluster snapshots to be returned. You can specify one of the following values:</p> <ul> <li> <p> <code>automated</code> - Return all cluster snapshots that Amazon DocumentDB has automatically created for your Amazon Web Services account.</p> </li> <li> <p> <code>manual</code> - Return all cluster snapshots that you have manually created for your Amazon Web Services account.</p> </li> <li> <p> <code>shared</code> - Return all manual cluster snapshots that have been shared to your Amazon Web Services account.</p> </li> <li> <p> <code>public</code> - Return all cluster snapshots that have been marked as public.</p> </li> </ul> <p>If you don't specify a <code>SnapshotType</code> value, then both automated and manual cluster snapshots are returned. You can include shared cluster snapshots with these results by setting the <code>IncludeShared</code> parameter to <code>true</code>. You can include public cluster snapshots with these results by setting the<code>IncludePublic</code> parameter to <code>true</code>.</p> <p>The <code>IncludeShared</code> and <code>IncludePublic</code> parameters don't apply for <code>SnapshotType</code> values of <code>manual</code> or <code>automated</code>. The <code>IncludePublic</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>shared</code>. The <code>IncludeShared</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>public</code>.</p>
        filters: <p>This parameter is not currently supported.</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 pagination token (marker) is included in the response so that the remaining results can be retrieved.</p> <p>Default: 100</p> <p>Constraints: Minimum 20, maximum 100.</p>
        marker: <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
        include_shared: <p>Set to <code>true</code> to include shared manual cluster snapshots from other Amazon Web Services accounts that this Amazon Web Services account has been given permission to copy or restore, and otherwise <code>false</code>. The default is <code>false</code>.</p>
        include_public: <p>Set to <code>true</code> to include manual cluster snapshots that are public and can be copied or restored by any Amazon Web Services account, and otherwise <code>false</code>. The default is <code>false</code>.</p>

    Raises:
        capo_docdb.errors.db_cluster_snapshot_not_found_fault.DBClusterSnapshotNotFoundFault: <p> <code>DBClusterSnapshotIdentifier</code> doesn't refer to an existing cluster snapshot. </p>
        capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_docdb.types.describe_db_cluster_snapshots_message.DescribeDBClusterSnapshotsMessage]",
    ) -> OperationResponse[
        "capo_docdb.types.db_cluster_snapshot_message.DBClusterSnapshotMessage"
    ]:
        import capo_docdb._operations.amazon_rd_sv19.describe_db_cluster_snapshots

        output, http_response = (
            capo_docdb._operations.amazon_rd_sv19.describe_db_cluster_snapshots.describe_db_cluster_snapshots(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeDBClusterSnapshots")
    )
    input_: capo_docdb.types.describe_db_cluster_snapshots_message.DescribeDBClusterSnapshotsMessage = {}
    if db_cluster_identifier is not None:
        input_["db_cluster_identifier"] = db_cluster_identifier
    if db_cluster_snapshot_identifier is not None:
        input_["db_cluster_snapshot_identifier"] = db_cluster_snapshot_identifier
    if snapshot_type is not None:
        input_["snapshot_type"] = snapshot_type
    if filters is not None:
        input_["filters"] = filters
    if max_records is not None:
        input_["max_records"] = max_records
    if marker is not None:
        input_["marker"] = marker
    if include_shared is not None:
        input_["include_shared"] = include_shared
    if include_public is not None:
        input_["include_public"] = include_public

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output