Skip to content

modify_cluster_maintenance

modify_cluster_maintenance(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional[String] = None,
    defer_maintenance: Optional[BooleanOptional] = None,
    defer_maintenance_identifier: Optional[String] = None,
    defer_maintenance_start_time: Optional[TStamp] = None,
    defer_maintenance_end_time: Optional[TStamp] = None,
    defer_maintenance_duration: Optional[IntegerOptional] = None,
) -> ModifyClusterMaintenanceResult

Modifies the maintenance settings of a cluster.

Parameters:

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

    A unique identifier for the cluster.

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

    A boolean indicating whether to enable the deferred maintenance window.

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

    A unique identifier for the deferred maintenance window.

  • defer_maintenance_start_time (Optional[TStamp], default: None ) –

    A timestamp indicating the start time for the deferred maintenance window.

  • defer_maintenance_end_time (Optional[TStamp], default: None ) –

    A timestamp indicating end time for the deferred maintenance window. If you specify an end time, you can't specify a duration.

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

    An integer indicating the duration of the maintenance window in days. If you specify a duration, you can't specify an end time. The duration must be 60 days or less.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def modify_cluster_maintenance(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional["capo_redshift.types.string.String"] = None,
    defer_maintenance: Optional[
        "capo_redshift.types.boolean_optional.BooleanOptional"
    ] = None,
    defer_maintenance_identifier: Optional[
        "capo_redshift.types.string.String"
    ] = None,
    defer_maintenance_start_time: Optional[
        "capo_redshift.types.t_stamp.TStamp"
    ] = None,
    defer_maintenance_end_time: Optional[
        "capo_redshift.types.t_stamp.TStamp"
    ] = None,
    defer_maintenance_duration: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
) -> "capo_redshift.types.modify_cluster_maintenance_result.ModifyClusterMaintenanceResult":
    """<p>Modifies the maintenance settings of a cluster.</p>

    Args:
        cluster_identifier: <p>A unique identifier for the cluster.</p>
        defer_maintenance: <p>A boolean indicating whether to enable the deferred maintenance window. </p>
        defer_maintenance_identifier: <p>A unique identifier for the deferred maintenance window.</p>
        defer_maintenance_start_time: <p>A timestamp indicating the start time for the deferred maintenance window.</p>
        defer_maintenance_end_time: <p>A timestamp indicating end time for the deferred maintenance window. If you specify an end time, you can't specify a duration.</p>
        defer_maintenance_duration: <p>An integer indicating the duration of the maintenance window in days. If you specify a duration, you can't specify an end time. The duration must be 60 days or less.</p>

    Raises:
        capo_redshift.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster. </p>
        capo_redshift.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The specified cluster is not in the <code>available</code> state. </p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.modify_cluster_maintenance_message.ModifyClusterMaintenanceMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.modify_cluster_maintenance_result.ModifyClusterMaintenanceResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.modify_cluster_maintenance

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

    def _redact_output(
        output: "capo_redshift.types.modify_cluster_maintenance_result.ModifyClusterMaintenanceResult",
    ) -> dict[str, Any]:
        import capo_redshift.types.modify_cluster_maintenance_result

        return (
            capo_redshift.types.modify_cluster_maintenance_result.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ModifyClusterMaintenance", redact_output=_redact_output),
    )
    input_: capo_redshift.types.modify_cluster_maintenance_message.ModifyClusterMaintenanceMessage = {}
    if cluster_identifier is not None:
        input_["cluster_identifier"] = cluster_identifier
    if defer_maintenance is not None:
        input_["defer_maintenance"] = defer_maintenance
    if defer_maintenance_identifier is not None:
        input_["defer_maintenance_identifier"] = defer_maintenance_identifier
    if defer_maintenance_start_time is not None:
        input_["defer_maintenance_start_time"] = defer_maintenance_start_time
    if defer_maintenance_end_time is not None:
        input_["defer_maintenance_end_time"] = defer_maintenance_end_time
    if defer_maintenance_duration is not None:
        input_["defer_maintenance_duration"] = defer_maintenance_duration

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