Skip to content

describe_db_snapshot_attributes

describe_db_snapshot_attributes(
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_snapshot_identifier: Optional[String] = None,
) -> DescribeDBSnapshotAttributesResult

Returns a list of DB snapshot attribute names and values for a manual DB snapshot.

When sharing snapshots with other Amazon Web Services accounts, DescribeDBSnapshotAttributes returns the restore attribute and a list of IDs for the Amazon Web Services accounts that are authorized to copy or restore the manual DB snapshot. If all is included in the list of values for the restore attribute, then the manual DB snapshot is public and can be copied or restored by all Amazon Web Services accounts.

To add or remove access for an Amazon Web Services account to copy or restore a manual DB snapshot, or to make the manual DB snapshot public or private, use the ModifyDBSnapshotAttribute API action.

Parameters:

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

    The identifier for the DB snapshot to describe the attributes for.

Raises:

Examples:

To describe the attribute names and values for a DB snapshot The following example describes the attribute names and values for a DB snapshot.

>>> client.describe_db_snapshot_attributes(db_snapshot_identifier='mydbsnapshot')
Source code in docs_src/capo_rds/_services/rds.py
def describe_db_snapshot_attributes(
    self,
    *,
    config_overrides: Optional[RDSClientConfig] = None,
    db_snapshot_identifier: Optional["capo_rds.types.string.String"] = None,
) -> "capo_rds.types.describe_db_snapshot_attributes_result.DescribeDBSnapshotAttributesResult":
    """<p>Returns a list of DB snapshot attribute names and values for a manual DB snapshot.</p> <p>When sharing snapshots with other Amazon Web Services accounts, <code>DescribeDBSnapshotAttributes</code> returns the <code>restore</code> attribute and a list of IDs for the Amazon Web Services accounts that are authorized to copy or restore the manual DB snapshot. If <code>all</code> is included in the list of values for the <code>restore</code> attribute, then the manual DB snapshot is public and can be copied or restored by all Amazon Web Services accounts.</p> <p>To add or remove access for an Amazon Web Services account to copy or restore a manual DB snapshot, or to make the manual DB snapshot public or private, use the <code>ModifyDBSnapshotAttribute</code> API action.</p>

    Args:
        db_snapshot_identifier: <p>The identifier for the DB snapshot to describe the attributes for.</p>

    Raises:
        capo_rds.errors.db_snapshot_not_found_fault.DBSnapshotNotFoundFault: <p> <code>DBSnapshotIdentifier</code> doesn't refer to an existing DB snapshot.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe the attribute names and values for a DB snapshot
        The following example describes the attribute names and values for a DB snapshot.

        >>> client.describe_db_snapshot_attributes(db_snapshot_identifier='mydbsnapshot')
    """

    def _handler(
        req: "OperationRequest[capo_rds.types.describe_db_snapshot_attributes_message.DescribeDBSnapshotAttributesMessage]",
    ) -> OperationResponse[
        "capo_rds.types.describe_db_snapshot_attributes_result.DescribeDBSnapshotAttributesResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.describe_db_snapshot_attributes

        output, http_response = (
            capo_rds._operations.amazon_rd_sv19.describe_db_snapshot_attributes.describe_db_snapshot_attributes(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeDBSnapshotAttributes")
    )
    input_: capo_rds.types.describe_db_snapshot_attributes_message.DescribeDBSnapshotAttributesMessage = {}
    if db_snapshot_identifier is not None:
        input_["db_snapshot_identifier"] = db_snapshot_identifier

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