create_scheduled_action
async
¶
create_scheduled_action(
scheduled_action_name: ScheduledActionName,
target_action: TargetAction,
schedule: Schedule,
role_arn: IamRoleArn,
namespace_name: NamespaceName,
*,
config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
enabled: Optional[bool] = None,
scheduled_action_description: Optional[str] = None,
start_time: Optional[datetime] = None,
end_time: Optional[datetime] = None,
) -> CreateScheduledActionResponse
Creates a scheduled action. A scheduled action contains a schedule and an Amazon Redshift API action. For example, you can create a schedule of when to run the CreateSnapshot API operation.
Parameters:
-
scheduled_action_name(ScheduledActionName) –The name of the scheduled action.
-
schedule(Schedule) –The schedule for a one-time (at timestamp format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC.
-
Format of at timestamp is
yyyy-mm-ddThh:mm:ss. For example,2016-03-04T17:27:00. -
Format of cron expression is
(Minutes Hours Day-of-month Month Day-of-week Year). For example,"(0 10 ? * MON *)". For more information, see Cron Expressions in the Amazon CloudWatch Events User Guide.
-
-
role_arn(IamRoleArn) –The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots. (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see Using Identity-Based Policies for Amazon Redshift in the Amazon Redshift Management Guide
-
namespace_name(NamespaceName) –The name of the namespace for which to create a scheduled action.
-
enabled(Optional[bool], default:None) –Indicates whether the schedule is enabled. If false, the scheduled action does not trigger. For more information about
stateof the scheduled action, see ScheduledAction. -
scheduled_action_description(Optional[str], default:None) –The description of the scheduled action.
-
start_time(Optional[datetime], default:None) –The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.
-
end_time(Optional[datetime], default:None) –The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.
Raises:
-
ConflictException–The submitted action has conflicts.
-
InternalServerException–The request processing has failed because of an unknown error, exception or failure.
-
ResourceNotFoundException–The resource could not be found.
-
ValidationException–The input failed to satisfy the constraints specified by an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 | |