Class ScheduleExpression
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudwatch.ScheduleExpression
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.138.0 (build 0ca7ee8)",
date="2026-08-10T14:50:59.415Z")
@Stability(Stable)
public abstract class ScheduleExpression
extends software.amazon.jsii.JsiiObject
Schedule expression for CloudWatch alarm mute rule.
You can choose from three schedule types when configuring your schedule: cron-based and one-time schedules. Cron-based schedule is recurring schedule.
Example:
Alarm alarm1;
Alarm alarm2;
AlarmMuteRule alarmMuteRule = AlarmMuteRule.Builder.create(this, "AlarmMuteRule")
.alarms(List.of(alarm1))
// Defines the mute period begins at 0:00 everyday in UTC
.schedule(ScheduleExpression.cron(CronOptions.builder().minute("0").hour("0").build()))
// Specifies the mute rule lasts 1 hour.
.duration(Duration.hours(1))
.build();
// The mute target can be added after construction.
alarmMuteRule.addAlarm(alarm2);
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedScheduleExpression(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedScheduleExpression(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduleExpressionat(CalendarDateTime date) Construct a one-time schedule from a date.static ScheduleExpressionat(CalendarDateTime date, TimeZone timeZone) Construct a one-time schedule from a date.static ScheduleExpressioncron(CronOptions options) Create a recurring schedule from a set of cron fields and time zone.static ScheduleExpressionexpression(String expression) Construct a schedule from a literal schedule expression.static ScheduleExpressionexpression(String expression, TimeZone timeZone) Construct a schedule from a literal schedule expression.abstract StringRetrieve the expression for this schedule.abstract TimeZoneRetrieve the expression for this schedule.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ScheduleExpression
protected ScheduleExpression(software.amazon.jsii.JsiiObjectRef objRef) -
ScheduleExpression
protected ScheduleExpression(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ScheduleExpression
@Stability(Stable) protected ScheduleExpression()
-
-
Method Details
-
at
@Stability(Stable) @NotNull public static ScheduleExpression at(@NotNull CalendarDateTime date, @Nullable TimeZone timeZone) Construct a one-time schedule from a date.- Parameters:
date- The date and time to use. This parameter is required.timeZone- The time zone to use for interpreting the date.
-
at
Construct a one-time schedule from a date.- Parameters:
date- The date and time to use. This parameter is required.
-
cron
Create a recurring schedule from a set of cron fields and time zone.- Parameters:
options- This parameter is required.
-
expression
@Stability(Stable) @NotNull public static ScheduleExpression expression(@NotNull String expression, @Nullable TimeZone timeZone) Construct a schedule from a literal schedule expression.- Parameters:
expression- The expression to use. This parameter is required.timeZone- The time zone to use for interpreting the expression.
-
expression
Construct a schedule from a literal schedule expression.- Parameters:
expression- The expression to use. This parameter is required.
-
getExpressionString
Retrieve the expression for this schedule. -
getTimeZone
Retrieve the expression for this schedule.
-