Skip to content

modify_scheduled_action

modify_scheduled_action(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    scheduled_action_name: Optional[String] = None,
    target_action: Optional[ScheduledActionType] = None,
    schedule: Optional[String] = None,
    iam_role: Optional[String] = None,
    scheduled_action_description: Optional[String] = None,
    start_time: Optional[TStamp] = None,
    end_time: Optional[TStamp] = None,
    enable: Optional[BooleanOptional] = None,
) -> ScheduledAction

Modifies a scheduled action.

Parameters:

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

    The name of the scheduled action to modify.

  • target_action (Optional[ScheduledActionType], default: None ) –

    A modified JSON format of the scheduled action. For more information about this parameter, see ScheduledAction.

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

    A modified schedule in either at( ) or cron( ) format. For more information about this parameter, see ScheduledAction.

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

    A different IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction.

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

    A modified description of the scheduled action.

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

    A modified start time of the scheduled action. For more information about this parameter, see ScheduledAction.

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

    A modified end time of the scheduled action. For more information about this parameter, see ScheduledAction.

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

    A modified enable flag of the scheduled action. If true, the scheduled action is active. If false, the scheduled action is disabled.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def modify_scheduled_action(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    scheduled_action_name: Optional["capo_redshift.types.string.String"] = None,
    target_action: Optional[
        "capo_redshift.types.scheduled_action_type.ScheduledActionType"
    ] = None,
    schedule: Optional["capo_redshift.types.string.String"] = None,
    iam_role: Optional["capo_redshift.types.string.String"] = None,
    scheduled_action_description: Optional[
        "capo_redshift.types.string.String"
    ] = None,
    start_time: Optional["capo_redshift.types.t_stamp.TStamp"] = None,
    end_time: Optional["capo_redshift.types.t_stamp.TStamp"] = None,
    enable: Optional["capo_redshift.types.boolean_optional.BooleanOptional"] = None,
) -> "capo_redshift.types.scheduled_action.ScheduledAction":
    """<p>Modifies a scheduled action. </p>

    Args:
        scheduled_action_name: <p>The name of the scheduled action to modify. </p>
        target_action: <p>A modified JSON format of the scheduled action. For more information about this parameter, see <a>ScheduledAction</a>. </p>
        schedule: <p>A modified schedule in either <code>at( )</code> or <code>cron( )</code> format. For more information about this parameter, see <a>ScheduledAction</a>.</p>
        iam_role: <p>A different IAM role to assume to run the target action. For more information about this parameter, see <a>ScheduledAction</a>.</p>
        scheduled_action_description: <p>A modified description of the scheduled action. </p>
        start_time: <p>A modified start time of the scheduled action. For more information about this parameter, see <a>ScheduledAction</a>. </p>
        end_time: <p>A modified end time of the scheduled action. For more information about this parameter, see <a>ScheduledAction</a>. </p>
        enable: <p>A modified enable flag of the scheduled action. If true, the scheduled action is active. If false, the scheduled action is disabled. </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_scheduled_action_fault.InvalidScheduledActionFault: <p>The scheduled action is not valid. </p>
        capo_redshift.errors.invalid_schedule_fault.InvalidScheduleFault: <p>The schedule you submitted isn't valid.</p>
        capo_redshift.errors.scheduled_action_not_found_fault.ScheduledActionNotFoundFault: <p>The scheduled action cannot be found. </p>
        capo_redshift.errors.scheduled_action_type_unsupported_fault.ScheduledActionTypeUnsupportedFault: <p>The action type specified for a scheduled action is not supported. </p>
        capo_redshift.errors.unauthorized_operation.UnauthorizedOperation: <p>Your account is not authorized to perform the requested operation.</p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.modify_scheduled_action_message.ModifyScheduledActionMessage]",
    ) -> OperationResponse["capo_redshift.types.scheduled_action.ScheduledAction"]:
        import capo_redshift._operations.redshift_service_version20121201.modify_scheduled_action

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyScheduledAction")
    )
    input_: capo_redshift.types.modify_scheduled_action_message.ModifyScheduledActionMessage = {}
    if scheduled_action_name is not None:
        input_["scheduled_action_name"] = scheduled_action_name
    if target_action is not None:
        input_["target_action"] = target_action
    if schedule is not None:
        input_["schedule"] = schedule
    if iam_role is not None:
        input_["iam_role"] = iam_role
    if scheduled_action_description is not None:
        input_["scheduled_action_description"] = scheduled_action_description
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if enable is not None:
        input_["enable"] = enable

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