update_schedule
¶
update_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,
) -> UpdateScheduleOutput
Updates the specified schedule. When you call UpdateSchedule, EventBridge Scheduler uses all values, including empty values, specified in the request and overrides the existing schedule. This is by design. This means that if you do not set an optional field in your request, that field will be set to its system-default value after the update.
Before calling this operation, we recommend that you call the GetSchedule API operation and make a note of all optional parameters for your UpdateSchedule call.
Parameters:
-
name(Name) –The name of the schedule that you are updating.
-
group_name(Optional[ScheduleGroupName], default:None) –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(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 ARN for the customer managed KMS key that that you want EventBridge Scheduler to use to encrypt and decrypt your data.
-
target(Target) –The schedule target. You can use this operation to change the target that your schedule invokes.
-
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.
-
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
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 | |