Class: AWSCDK::Synthetics::CfnCanary::ScheduleProperty

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

Overview

This structure specifies how often a canary is to make runs and the date and time when it should stop making runs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression:, duration_in_seconds: nil, retry_config: nil) ⇒ ScheduleProperty

Returns a new instance of ScheduleProperty.

Parameters:

  • expression (String)

    A rate expression or a cron expression that defines how often the canary is to run.

  • duration_in_seconds (String, nil) (defaults to: nil)

    How long, in seconds, for the canary to continue making regular runs according to the schedule in the Expression value.

  • retry_config (AWSCDK::IResolvable, AWSCDK::Synthetics::CfnCanary::RetryConfigProperty, nil) (defaults to: nil)

    The canary's retry configuration information.



1269
1270
1271
1272
1273
1274
1275
1276
# File 'synthetics/cfn_canary.rb', line 1269

def initialize(expression:, duration_in_seconds: nil, retry_config: nil)
  @expression = expression
  Jsii::Type.check_type(@expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expression")
  @duration_in_seconds = duration_in_seconds
  Jsii::Type.check_type(@duration_in_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "durationInSeconds") unless @duration_in_seconds.nil?
  @retry_config = retry_config.is_a?(Hash) ? ::AWSCDK::Synthetics::CfnCanary::RetryConfigProperty.new(**retry_config.transform_keys(&:to_sym)) : retry_config
  Jsii::Type.check_type(@retry_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zeW50aGV0aWNzLkNmbkNhbmFyeS5SZXRyeUNvbmZpZ1Byb3BlcnR5In1dfX0=")), "retryConfig") unless @retry_config.nil?
end

Instance Attribute Details

#duration_in_secondsString? (readonly)

How long, in seconds, for the canary to continue making regular runs according to the schedule in the Expression value.

If you specify 0, the canary continues making runs until you stop it. If you omit this field, the default of 0 is used.



1297
1298
1299
# File 'synthetics/cfn_canary.rb', line 1297

def duration_in_seconds
  @duration_in_seconds
end

#expressionString (readonly)

A rate expression or a cron expression that defines how often the canary is to run.

For a rate expression, The syntax is rate( *number unit* ) . unit can be minute , minutes , or hour .

For example, rate(1 minute) runs the canary once a minute, rate(10 minutes) runs it once every 10 minutes, and rate(1 hour) runs it once every hour. You can specify a frequency between rate(1 minute) and rate(1 hour) .

Specifying rate(0 minute) or rate(0 hour) is a special value that causes the canary to run only once when it is started.

Use cron( *expression* ) to specify a cron expression. You can't schedule a canary to wait for more than a year before running. For information about the syntax for cron expressions, see Scheduling canary runs using cron .



1290
1291
1292
# File 'synthetics/cfn_canary.rb', line 1290

def expression
  @expression
end

#retry_configAWSCDK::IResolvable, ... (readonly)

The canary's retry configuration information.



1302
1303
1304
# File 'synthetics/cfn_canary.rb', line 1302

def retry_config
  @retry_config
end

Class Method Details

.jsii_propertiesObject



1304
1305
1306
1307
1308
1309
1310
# File 'synthetics/cfn_canary.rb', line 1304

def self.jsii_properties
  {
    :expression => "expression",
    :duration_in_seconds => "durationInSeconds",
    :retry_config => "retryConfig",
  }
end

Instance Method Details

#to_jsiiObject



1312
1313
1314
1315
1316
1317
1318
1319
1320
# File 'synthetics/cfn_canary.rb', line 1312

def to_jsii
  result = {}
  result.merge!({
    "expression" => @expression,
    "durationInSeconds" => @duration_in_seconds,
    "retryConfig" => @retry_config,
  })
  result.compact
end