Skip to content

batch_modify_cluster_snapshots

batch_modify_cluster_snapshots(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    snapshot_identifier_list: Optional[SnapshotIdentifierList] = None,
    manual_snapshot_retention_period: Optional[IntegerOptional] = None,
    force: Optional[Boolean] = None,
) -> BatchModifyClusterSnapshotsOutputMessage

Modifies the settings for a set of cluster snapshots.

Parameters:

  • snapshot_identifier_list (Optional[SnapshotIdentifierList], default: None ) –

    A list of snapshot identifiers you want to modify.

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

    The number of days that a manual snapshot is retained. If you specify the value -1, the manual snapshot is retained indefinitely.

    The number must be either -1 or an integer between 1 and 3,653.

    If you decrease the manual snapshot retention period from its current value, existing manual snapshots that fall outside of the new retention period will return an error. If you want to suppress the errors and delete the snapshots, use the force option.

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

    A boolean value indicating whether to override an exception if the retention period has passed.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def batch_modify_cluster_snapshots(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    snapshot_identifier_list: Optional[
        "capo_redshift.types.snapshot_identifier_list.SnapshotIdentifierList"
    ] = None,
    manual_snapshot_retention_period: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
    force: Optional["capo_redshift.types.boolean.Boolean"] = None,
) -> "capo_redshift.types.batch_modify_cluster_snapshots_output_message.BatchModifyClusterSnapshotsOutputMessage":
    """<p>Modifies the settings for a set of cluster snapshots.</p>

    Args:
        snapshot_identifier_list: <p>A list of snapshot identifiers you want to modify.</p>
        manual_snapshot_retention_period: <p>The number of days that a manual snapshot is retained. If you specify the value -1, the manual snapshot is retained indefinitely.</p> <p>The number must be either -1 or an integer between 1 and 3,653.</p> <p>If you decrease the manual snapshot retention period from its current value, existing manual snapshots that fall outside of the new retention period will return an error. If you want to suppress the errors and delete the snapshots, use the force option. </p>
        force: <p>A boolean value indicating whether to override an exception if the retention period has passed. </p>

    Raises:
        capo_redshift.errors.batch_modify_cluster_snapshots_limit_exceeded_fault.BatchModifyClusterSnapshotsLimitExceededFault: <p>The maximum number for snapshot identifiers has been reached. The limit is 100. </p>
        capo_redshift.errors.invalid_retention_period_fault.InvalidRetentionPeriodFault: <p>The retention period specified is either in the past or is not a valid value.</p> <p>The value must be either -1 or an integer between 1 and 3,653.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.batch_modify_cluster_snapshots_message.BatchModifyClusterSnapshotsMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.batch_modify_cluster_snapshots_output_message.BatchModifyClusterSnapshotsOutputMessage"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.batch_modify_cluster_snapshots

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.batch_modify_cluster_snapshots.batch_modify_cluster_snapshots(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchModifyClusterSnapshots")
    )
    input_: capo_redshift.types.batch_modify_cluster_snapshots_message.BatchModifyClusterSnapshotsMessage = {}
    if snapshot_identifier_list is not None:
        input_["snapshot_identifier_list"] = snapshot_identifier_list
    if manual_snapshot_retention_period is not None:
        input_["manual_snapshot_retention_period"] = (
            manual_snapshot_retention_period
        )
    if force is not None:
        input_["force"] = force

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