Class: AWSCDK::Synthetics::Schedule

Inherits:
Jsii::Object
  • Object
show all
Defined in:
synthetics/schedule.rb

Overview

Schedule for canary runs.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Schedule

Returns a new instance of Schedule.

Raises:

  • (NoMethodError)


8
9
10
# File 'synthetics/schedule.rb', line 8

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_synthetics.Schedule does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.cron(options) ⇒ AWSCDK::Synthetics::Schedule

Create a schedule from a set of cron fields.

Parameters:

Returns:

  • (AWSCDK::Synthetics::Schedule)


22
23
24
25
26
# File 'synthetics/schedule.rb', line 22

def self.cron(options)
  options = options.is_a?(Hash) ? ::AWSCDK::Synthetics::CronOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3ludGhldGljcy5Dcm9uT3B0aW9ucyJ9")), "options")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_synthetics.Schedule", "cron", [options])
end

.expression(expression) ⇒ AWSCDK::Synthetics::Schedule

Construct a schedule from a literal schedule expression.

The expression must be in a rate(number units) format. For example, Schedule.expression('rate(10 minutes)')

Parameters:

  • expression (String)

    The expression to use.

Returns:

  • (AWSCDK::Synthetics::Schedule)


35
36
37
38
# File 'synthetics/schedule.rb', line 35

def self.expression(expression)
  Jsii::Type.check_type(expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_synthetics.Schedule", "expression", [expression])
end

.jsii_overridable_methodsObject



12
13
14
15
16
# File 'synthetics/schedule.rb', line 12

def self.jsii_overridable_methods
  {
    :expression_string => { kind: :property, name: "expressionString", is_optional: false },
  }
end

.onceAWSCDK::Synthetics::Schedule

The canary will be executed once.

Returns:

  • (AWSCDK::Synthetics::Schedule)


43
44
45
# File 'synthetics/schedule.rb', line 43

def self.once()
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_synthetics.Schedule", "once", [])
end

.rate(interval) ⇒ AWSCDK::Synthetics::Schedule

Construct a schedule from an interval.

Allowed values: 0 (for a single run) or between 1 and 60 minutes. To specify a single run, you can use Schedule.once().

Parameters:

Returns:

  • (AWSCDK::Synthetics::Schedule)


54
55
56
57
# File 'synthetics/schedule.rb', line 54

def self.rate(interval)
  Jsii::Type.check_type(interval, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "interval")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_synthetics.Schedule", "rate", [interval])
end

Instance Method Details

#expression_stringString

The Schedule expression.

Returns:

  • (String)


62
63
64
# File 'synthetics/schedule.rb', line 62

def expression_string()
  jsii_get_property("expressionString")
end