Class: AWSCDK::Synthetics::Test

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

Overview

Specify a test that the canary should run.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Test

Returns a new instance of Test.

Raises:

  • (NoMethodError)


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

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

Class Method Details

.custom(options) ⇒ AWSCDK::Synthetics::Test

Specify a custom test with your own code.

Parameters:

Returns:

  • (AWSCDK::Synthetics::Test)

    Test associated with the specified Code object



23
24
25
26
27
# File 'synthetics/test.rb', line 23

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

.jsii_overridable_methodsObject



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

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

Instance Method Details

#codeAWSCDK::Synthetics::Code

The code that the canary should run.



32
33
34
# File 'synthetics/test.rb', line 32

def code()
  jsii_get_property("code")
end

#handlerString

The handler of the canary.

Returns:

  • (String)


39
40
41
# File 'synthetics/test.rb', line 39

def handler()
  jsii_get_property("handler")
end