Class: AWSCDK::ApplicationAutoScaling::Schedule

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

Overview

Schedule for scheduled scaling actions.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSchedule

Returns a new instance of Schedule.



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

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.at(moment) ⇒ AWSCDK::ApplicationAutoScaling::Schedule

Construct a Schedule from a moment in time.

Parameters:

  • moment (DateTime)

Returns:

  • (AWSCDK::ApplicationAutoScaling::Schedule)


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

def self.at(moment)
  Jsii::Type.check_type(moment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJkYXRlIn0=")), "moment")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_applicationautoscaling.Schedule", "at", [moment])
end

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

Create a schedule from a set of cron fields.

Parameters:

Returns:

  • (AWSCDK::ApplicationAutoScaling::Schedule)


31
32
33
34
35
# File 'application_auto_scaling/schedule.rb', line 31

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

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

Construct a schedule from a literal schedule expression.

Parameters:

  • expression (String)

    The expression to use.

Returns:

  • (AWSCDK::ApplicationAutoScaling::Schedule)


41
42
43
44
# File 'application_auto_scaling/schedule.rb', line 41

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_applicationautoscaling.Schedule", "expression", [expression])
end

.jsii_overridable_methodsObject



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

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

.rate(duration) ⇒ AWSCDK::ApplicationAutoScaling::Schedule

Construct a schedule from an interval and a time unit.

Parameters:

Returns:

  • (AWSCDK::ApplicationAutoScaling::Schedule)


50
51
52
53
# File 'application_auto_scaling/schedule.rb', line 50

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

Instance Method Details

#expression_stringString

Retrieve the expression for this schedule.

Returns:

  • (String)


58
59
60
# File 'application_auto_scaling/schedule.rb', line 58

def expression_string()
  jsii_get_property("expressionString")
end