Struct aws_sdk_scheduler::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon EventBridge Scheduler
Client for invoking operations on Amazon EventBridge Scheduler. Each operation on Amazon EventBridge Scheduler is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_scheduler::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::retry::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_scheduler::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_scheduler::Client::from_conf(config);
Implementations§
source§impl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
source§impl Client
impl Client
sourcepub fn create_schedule(&self) -> CreateSchedule
pub fn create_schedule(&self) -> CreateSchedule
Constructs a fluent builder for the CreateSchedule
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the schedule that you are creating.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:The name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used.
schedule_expression(impl Into<String>)
/set_schedule_expression(Option<String>)
:The expression that defines when the schedule runs. The following formats are supported.
-
at
expression -at(yyyy-mm-ddThh:mm:ss)
-
rate
expression -rate(unit value)
-
cron
expression -cron(fields)
You can use
at
expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can userate
andcron
expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.A
cron
expression consists of six fields separated by white spaces:(minutes hours day_of_month month day_of_week year)
.A
rate
expression consists of a value as a positive integer, and a unit with the following options:minute
|minutes
|hour
|hours
|day
|days
For more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.
-
start_date(DateTime)
/set_start_date(Option<DateTime>)
:The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule’s recurrence expression, invocations might occur on, or after, the
StartDate
you specify. EventBridge Scheduler ignoresStartDate
for one-time schedules.end_date(DateTime)
/set_end_date(Option<DateTime>)
:The date, in UTC, before which the schedule can invoke its target. Depending on the schedule’s recurrence expression, invocations might stop on, or before, the
EndDate
you specify. EventBridge Scheduler ignoresEndDate
for one-time schedules.description(impl Into<String>)
/set_description(Option<String>)
:The description you specify for the schedule.
schedule_expression_timezone(impl Into<String>)
/set_schedule_expression_timezone(Option<String>)
:The timezone in which the scheduling expression is evaluated.
state(ScheduleState)
/set_state(Option<ScheduleState>)
:Specifies whether the schedule is enabled or disabled.
kms_key_arn(impl Into<String>)
/set_kms_key_arn(Option<String>)
:The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.
target(Target)
/set_target(Option<Target>)
:The schedule’s target.
flexible_time_window(FlexibleTimeWindow)
/set_flexible_time_window(Option<FlexibleTimeWindow>)
:Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
- On success, responds with
CreateScheduleOutput
with field(s):schedule_arn(Option<String>)
:The Amazon Resource Name (ARN) of the schedule.
- On failure, responds with
SdkError<CreateScheduleError>
sourcepub fn create_schedule_group(&self) -> CreateScheduleGroup
pub fn create_schedule_group(&self) -> CreateScheduleGroup
Constructs a fluent builder for the CreateScheduleGroup
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the schedule group that you are creating.
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:The list of tags to associate with the schedule group.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
- On success, responds with
CreateScheduleGroupOutput
with field(s):schedule_group_arn(Option<String>)
:The Amazon Resource Name (ARN) of the schedule group.
- On failure, responds with
SdkError<CreateScheduleGroupError>
sourcepub fn delete_schedule(&self) -> DeleteSchedule
pub fn delete_schedule(&self) -> DeleteSchedule
Constructs a fluent builder for the DeleteSchedule
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the schedule to delete.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:The name of the schedule group associated with this schedule. If you omit this, the default schedule group is used.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
- On success, responds with
DeleteScheduleOutput
- On failure, responds with
SdkError<DeleteScheduleError>
sourcepub fn delete_schedule_group(&self) -> DeleteScheduleGroup
pub fn delete_schedule_group(&self) -> DeleteScheduleGroup
Constructs a fluent builder for the DeleteScheduleGroup
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the schedule group to delete.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
- On success, responds with
DeleteScheduleGroupOutput
- On failure, responds with
SdkError<DeleteScheduleGroupError>
sourcepub fn get_schedule(&self) -> GetSchedule
pub fn get_schedule(&self) -> GetSchedule
Constructs a fluent builder for the GetSchedule
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the schedule to retrieve.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:The name of the schedule group associated with this schedule. If you omit this, EventBridge Scheduler assumes that the schedule is associated with the default group.
- On success, responds with
GetScheduleOutput
with field(s):arn(Option<String>)
:The Amazon Resource Name (ARN) of the schedule.
group_name(Option<String>)
:The name of the schedule group associated with this schedule.
name(Option<String>)
:The name of the schedule.
schedule_expression(Option<String>)
:The expression that defines when the schedule runs. The following formats are supported.
-
at
expression -at(yyyy-mm-ddThh:mm:ss)
-
rate
expression -rate(unit value)
-
cron
expression -cron(fields)
You can use
at
expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can userate
andcron
expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.A
cron
expression consists of six fields separated by white spaces:(minutes hours day_of_month month day_of_week year)
.A
rate
expression consists of a value as a positive integer, and a unit with the following options:minute
|minutes
|hour
|hours
|day
|days
For more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.
-
start_date(Option<DateTime>)
:The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule’s recurrence expression, invocations might occur on, or after, the
StartDate
you specify. EventBridge Scheduler ignoresStartDate
for one-time schedules.end_date(Option<DateTime>)
:The date, in UTC, before which the schedule can invoke its target. Depending on the schedule’s recurrence expression, invocations might stop on, or before, the
EndDate
you specify. EventBridge Scheduler ignoresEndDate
for one-time schedules.description(Option<String>)
:The description of the schedule.
schedule_expression_timezone(Option<String>)
:The timezone in which the scheduling expression is evaluated.
state(Option<ScheduleState>)
:Specifies whether the schedule is enabled or disabled.
creation_date(Option<DateTime>)
:The time at which the schedule was created.
last_modification_date(Option<DateTime>)
:The time at which the schedule was last modified.
kms_key_arn(Option<String>)
:The ARN for a customer managed KMS Key that is be used to encrypt and decrypt your data.
target(Option<Target>)
:The schedule target.
flexible_time_window(Option<FlexibleTimeWindow>)
:Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.
- On failure, responds with
SdkError<GetScheduleError>
sourcepub fn get_schedule_group(&self) -> GetScheduleGroup
pub fn get_schedule_group(&self) -> GetScheduleGroup
Constructs a fluent builder for the GetScheduleGroup
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the schedule group to retrieve.
- On success, responds with
GetScheduleGroupOutput
with field(s):arn(Option<String>)
:The Amazon Resource Name (ARN) of the schedule group.
name(Option<String>)
:The name of the schedule group.
state(Option<ScheduleGroupState>)
:Specifies the state of the schedule group.
creation_date(Option<DateTime>)
:The time at which the schedule group was created.
last_modification_date(Option<DateTime>)
:The time at which the schedule group was last modified.
- On failure, responds with
SdkError<GetScheduleGroupError>
sourcepub fn list_schedule_groups(&self) -> ListScheduleGroups
pub fn list_schedule_groups(&self) -> ListScheduleGroups
Constructs a fluent builder for the ListScheduleGroups
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
name_prefix(impl Into<String>)
/set_name_prefix(Option<String>)
:The name prefix that you can use to return a filtered list of your schedule groups.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token returned by a previous call to retrieve the next set of results.
max_results(i32)
/set_max_results(Option<i32>)
:If specified, limits the number of results returned by this operation. The operation also returns a
NextToken
which you can use in a subsequent operation to retrieve the next set of results.
- On success, responds with
ListScheduleGroupsOutput
with field(s):next_token(Option<String>)
:Indicates whether there are additional results to retrieve. If the value is null, there are no more results.
schedule_groups(Option<Vec<ScheduleGroupSummary>>)
:The schedule groups that match the specified criteria.
- On failure, responds with
SdkError<ListScheduleGroupsError>
sourcepub fn list_schedules(&self) -> ListSchedules
pub fn list_schedules(&self) -> ListSchedules
Constructs a fluent builder for the ListSchedules
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
group_name(impl Into<String>)
/set_group_name(Option<String>)
:If specified, only lists the schedules whose associated schedule group matches the given filter.
name_prefix(impl Into<String>)
/set_name_prefix(Option<String>)
:Schedule name prefix to return the filtered list of resources.
state(ScheduleState)
/set_state(Option<ScheduleState>)
:If specified, only lists the schedules whose current state matches the given filter.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token returned by a previous call to retrieve the next set of results.
max_results(i32)
/set_max_results(Option<i32>)
:If specified, limits the number of results returned by this operation. The operation also returns a
NextToken
which you can use in a subsequent operation to retrieve the next set of results.
- On success, responds with
ListSchedulesOutput
with field(s):next_token(Option<String>)
:Indicates whether there are additional results to retrieve. If the value is null, there are no more results.
schedules(Option<Vec<ScheduleSummary>>)
:The schedules that match the specified criteria.
- On failure, responds with
SdkError<ListSchedulesError>
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The ARN of the EventBridge Scheduler resource for which you want to view tags.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec<Tag>>)
:The list of tags associated with the specified resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
sourcepub fn tag_resource(&self) -> TagResource
pub fn tag_resource(&self) -> TagResource
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the schedule group that you are adding tags to.
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:The list of tags to associate with the schedule group.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
sourcepub fn untag_resource(&self) -> UntagResource
pub fn untag_resource(&self) -> UntagResource
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the schedule group from which you are removing tags.
tag_keys(Vec<String>)
/set_tag_keys(Option<Vec<String>>)
:The list of tag keys to remove from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
sourcepub fn update_schedule(&self) -> UpdateSchedule
pub fn update_schedule(&self) -> UpdateSchedule
Constructs a fluent builder for the UpdateSchedule
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the schedule that you are updating.
group_name(impl Into<String>)
/set_group_name(Option<String>)
:The name of the schedule group with which the schedule is associated. You must provide this value in order for EventBridge Scheduler to find the schedule you want to update. If you omit this value, EventBridge Scheduler assumes the group is associated to the default group.
schedule_expression(impl Into<String>)
/set_schedule_expression(Option<String>)
:The expression that defines when the schedule runs. The following formats are supported.
-
at
expression -at(yyyy-mm-ddThh:mm:ss)
-
rate
expression -rate(unit value)
-
cron
expression -cron(fields)
You can use
at
expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can userate
andcron
expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month.A
cron
expression consists of six fields separated by white spaces:(minutes hours day_of_month month day_of_week year)
.A
rate
expression consists of a value as a positive integer, and a unit with the following options:minute
|minutes
|hour
|hours
|day
|days
For more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.
-
start_date(DateTime)
/set_start_date(Option<DateTime>)
:The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule’s recurrence expression, invocations might occur on, or after, the
StartDate
you specify. EventBridge Scheduler ignoresStartDate
for one-time schedules.end_date(DateTime)
/set_end_date(Option<DateTime>)
:The date, in UTC, before which the schedule can invoke its target. Depending on the schedule’s recurrence expression, invocations might stop on, or before, the
EndDate
you specify. EventBridge Scheduler ignoresEndDate
for one-time schedules.description(impl Into<String>)
/set_description(Option<String>)
:The description you specify for the schedule.
schedule_expression_timezone(impl Into<String>)
/set_schedule_expression_timezone(Option<String>)
:The timezone in which the scheduling expression is evaluated.
state(ScheduleState)
/set_state(Option<ScheduleState>)
:Specifies whether the schedule is enabled or disabled.
kms_key_arn(impl Into<String>)
/set_kms_key_arn(Option<String>)
:The ARN for the customer managed KMS key that that you want EventBridge Scheduler to use to encrypt and decrypt your data.
target(Target)
/set_target(Option<Target>)
:The schedule target. You can use this operation to change the target that your schedule invokes.
flexible_time_window(FlexibleTimeWindow)
/set_flexible_time_window(Option<FlexibleTimeWindow>)
:Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.
client_token(impl Into<String>)
/set_client_token(Option<String>)
:Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
- On success, responds with
UpdateScheduleOutput
with field(s):schedule_arn(Option<String>)
:The Amazon Resource Name (ARN) of the schedule that you updated.
- On failure, responds with
SdkError<UpdateScheduleError>
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it.
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
Panics
- This method will panic if the
conf
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
conf
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it.