Class Schedule
Schedule for canary runs.
Inheritance
Namespace: Amazon.CDK.AWS.Synthetics
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Schedule : DeputyBase
Syntax (vb)
Public Class Schedule
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
var canary = new Canary(this, "MyCanary", new CanaryProps {
Schedule = Schedule.Rate(Duration.Minutes(5)),
Test = Test.Custom(new CustomTestOptions {
Code = Code.FromAsset(Join(__dirname, "canary")),
Handler = "index.handler"
}),
Runtime = Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
EnvironmentVariables = new Dictionary<string, string> {
{ "stage", "prod" }
}
});
Synopsis
Constructors
Schedule(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Schedule(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
ExpressionString | The Schedule expression. |
Methods
Cron(ICronOptions) | Create a schedule from a set of cron fields. |
Expression(String) | Construct a schedule from a literal schedule expression. |
Once() | The canary will be executed once. |
Rate(Duration) | Construct a schedule from an interval. |
Constructors
Schedule(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Schedule(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Schedule(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Schedule(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
ExpressionString
The Schedule expression.
public virtual string ExpressionString { get; }
Property Value
System.String
Methods
Cron(ICronOptions)
Create a schedule from a set of cron fields.
public static Schedule Cron(ICronOptions options)
Parameters
- options ICronOptions
Returns
Expression(String)
Construct a schedule from a literal schedule expression.
public static Schedule Expression(string expression)
Parameters
- expression System.String
The expression to use.
Returns
Remarks
The expression must be in a rate(number units)
format.
For example, Schedule.expression('rate(10 minutes)')
Once()
Rate(Duration)
Construct a schedule from an interval.
public static Schedule Rate(Duration interval)
Parameters
- interval Duration
The interval at which to run the canary.
Returns
Remarks
Allowed values: 0 (for a single run) or between 1 and 60 minutes.
To specify a single run, you can use Schedule.once()
.