aws_sdk_redshiftserverless/client/
create_scheduled_action.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateScheduledAction`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`scheduled_action_name(impl Into<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::scheduled_action_name) / [`set_scheduled_action_name(Option<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_scheduled_action_name):<br>required: **true**<br><p>The name of the scheduled action.</p><br>
7    ///   - [`target_action(TargetAction)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::target_action) / [`set_target_action(Option<TargetAction>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_target_action):<br>required: **true**<br><p>A JSON format string of the Amazon Redshift Serverless API operation with input parameters. The following is an example of a target action.</p> <p><code>"{"CreateSnapshot": {"NamespaceName": "sampleNamespace","SnapshotName": "sampleSnapshot", "retentionPeriod": "1"}}"</code></p><br>
8    ///   - [`schedule(Schedule)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::schedule) / [`set_schedule(Option<Schedule>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_schedule):<br>required: **true**<br><p>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.</p> <ul>  <li>   <p>Format of at timestamp is <code>yyyy-mm-ddThh:mm:ss</code>. For example, <code>2016-03-04T17:27:00</code>.</p></li>  <li>   <p>Format of cron expression is <code>(Minutes Hours Day-of-month Month Day-of-week Year)</code>. For example, <code>"(0 10 ? * MON *)"</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron Expressions</a> in the <i>Amazon CloudWatch Events User Guide</i>.</p></li> </ul><br>
9    ///   - [`role_arn(impl Into<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::role_arn) / [`set_role_arn(Option<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_role_arn):<br>required: **true**<br><p>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 <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">Using Identity-Based Policies for Amazon Redshift</a> in the Amazon Redshift Management Guide</p><br>
10    ///   - [`namespace_name(impl Into<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::namespace_name) / [`set_namespace_name(Option<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_namespace_name):<br>required: **true**<br><p>The name of the namespace for which to create a scheduled action.</p><br>
11    ///   - [`enabled(bool)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::enabled) / [`set_enabled(Option<bool>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_enabled):<br>required: **false**<br><p>Indicates whether the schedule is enabled. If false, the scheduled action does not trigger. For more information about <code>state</code> of the scheduled action, see <a href="https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_ScheduledAction.html">ScheduledAction</a>.</p><br>
12    ///   - [`scheduled_action_description(impl Into<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::scheduled_action_description) / [`set_scheduled_action_description(Option<String>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_scheduled_action_description):<br>required: **false**<br><p>The description of the scheduled action.</p><br>
13    ///   - [`start_time(DateTime)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::start_time) / [`set_start_time(Option<DateTime>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_start_time):<br>required: **false**<br><p>The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.</p><br>
14    ///   - [`end_time(DateTime)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::end_time) / [`set_end_time(Option<DateTime>)`](crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::set_end_time):<br>required: **false**<br><p>The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.</p><br>
15    /// - On success, responds with [`CreateScheduledActionOutput`](crate::operation::create_scheduled_action::CreateScheduledActionOutput) with field(s):
16    ///   - [`scheduled_action(Option<ScheduledActionResponse>)`](crate::operation::create_scheduled_action::CreateScheduledActionOutput::scheduled_action): <p>The returned <code>ScheduledAction</code> object that describes the properties of a scheduled action.</p>
17    /// - On failure, responds with [`SdkError<CreateScheduledActionError>`](crate::operation::create_scheduled_action::CreateScheduledActionError)
18    pub fn create_scheduled_action(&self) -> crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder {
19        crate::operation::create_scheduled_action::builders::CreateScheduledActionFluentBuilder::new(self.handle.clone())
20    }
21}