create_schedule
¶
create_schedule(
name: Name,
schedule_expression: ScheduleExpression,
target: Target,
flexible_time_window: FlexibleTimeWindow,
*,
config_overrides: Optional[SchedulerClientConfig] = None,
group_name: Optional[ScheduleGroupName] = None,
start_date: Optional[StartDate] = None,
end_date: Optional[EndDate] = None,
description: Optional[Description] = None,
schedule_expression_timezone: Optional[ScheduleExpressionTimezone] = None,
state: Optional[ScheduleState] = None,
kms_key_arn: Optional[KmsKeyArn] = None,
client_token: Optional[ClientToken] = None,
action_after_completion: Optional[ActionAfterCompletion] = None,
) -> CreateScheduleOutput
Creates the specified schedule.
Parameters:
-
name(Name) –The name of the schedule that you are creating.
-
group_name(Optional[ScheduleGroupName], default:None) –The name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used.
-
schedule_expression(ScheduleExpression) –The expression that defines when the schedule runs. The following formats are supported.
-
atexpression -at(yyyy-mm-ddThh:mm:ss) -
rateexpression -rate(value unit) -
cronexpression -cron(fields)
You can use
atexpressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can userateandcronexpressions 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
cronexpression consists of six fields separated by white spaces:(minutes hours day_of_month month day_of_week year).A
rateexpression consists of a value as a positive integer, and a unit with the following options:minute|minutes|hour|hours|day|daysFor more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.
-
-
start_date(Optional[StartDate], default:None) –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
StartDateyou specify. EventBridge Scheduler ignoresStartDatefor one-time schedules. -
end_date(Optional[EndDate], default:None) –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
EndDateyou specify. EventBridge Scheduler ignoresEndDatefor one-time schedules. -
description(Optional[Description], default:None) –The description you specify for the schedule.
-
schedule_expression_timezone(Optional[ScheduleExpressionTimezone], default:None) –The timezone in which the scheduling expression is evaluated.
-
state(Optional[ScheduleState], default:None) –Specifies whether the schedule is enabled or disabled.
-
kms_key_arn(Optional[KmsKeyArn], default:None) –The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt your data.
-
target(Target) –The schedule's target.
-
flexible_time_window(FlexibleTimeWindow) –Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.
-
client_token(Optional[ClientToken], default:None) –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.
-
action_after_completion(Optional[ActionAfterCompletion], default:None) –Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.
Raises:
-
ConflictException–Updating or deleting the resource can cause an inconsistent state.
-
InternalServerException–Unexpected error encountered while processing the request.
-
ResourceNotFoundException–The request references a resource which does not exist.
-
ServiceQuotaExceededException–The request exceeds a service quota.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_scheduler/_services/scheduler.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |