Class: AWSCDK::ApplicationAutoScaling::ScalingSchedule
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ApplicationAutoScaling::ScalingSchedule
- Defined in:
- application_auto_scaling/scaling_schedule.rb
Overview
A scheduled scaling action.
Instance Attribute Summary collapse
-
#end_time ⇒ DateTime?
readonly
When this scheduled action expires.
-
#max_capacity ⇒ Numeric?
readonly
The new maximum capacity.
-
#min_capacity ⇒ Numeric?
readonly
The new minimum capacity.
-
#schedule ⇒ AWSCDK::ApplicationAutoScaling::Schedule
readonly
When to perform this action.
-
#start_time ⇒ DateTime?
readonly
When this scheduled action becomes active.
-
#time_zone ⇒ AWSCDK::TimeZone?
readonly
The time zone used when referring to the date and time of a scheduled action, when the scheduled action uses an at or cron expression.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schedule:, end_time: nil, max_capacity: nil, min_capacity: nil, start_time: nil, time_zone: nil) ⇒ ScalingSchedule
constructor
A new instance of ScalingSchedule.
- #to_jsii ⇒ Object
Constructor Details
#initialize(schedule:, end_time: nil, max_capacity: nil, min_capacity: nil, start_time: nil, time_zone: nil) ⇒ ScalingSchedule
Returns a new instance of ScalingSchedule.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'application_auto_scaling/scaling_schedule.rb', line 13 def initialize(schedule:, end_time: nil, max_capacity: nil, min_capacity: nil, start_time: nil, time_zone: nil) @schedule = schedule Jsii::Type.check_type(@schedule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5TY2hlZHVsZSJ9")), "schedule") @end_time = end_time Jsii::Type.check_type(@end_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJkYXRlIn0=")), "endTime") unless @end_time.nil? @max_capacity = max_capacity Jsii::Type.check_type(@max_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxCapacity") unless @max_capacity.nil? @min_capacity = min_capacity Jsii::Type.check_type(@min_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minCapacity") unless @min_capacity.nil? @start_time = start_time Jsii::Type.check_type(@start_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJkYXRlIn0=")), "startTime") unless @start_time.nil? @time_zone = time_zone Jsii::Type.check_type(@time_zone, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5UaW1lWm9uZSJ9")), "timeZone") unless @time_zone.nil? end |
Instance Attribute Details
#end_time ⇒ DateTime? (readonly)
Default: The rule never expires.
When this scheduled action expires.
36 37 38 |
# File 'application_auto_scaling/scaling_schedule.rb', line 36 def end_time @end_time end |
#max_capacity ⇒ Numeric? (readonly)
Default: No new maximum capacity
The new maximum capacity.
During the scheduled time, the current capacity is above the maximum capacity, Application Auto Scaling scales in to the maximum capacity.
At least one of maxCapacity and minCapacity must be supplied.
46 47 48 |
# File 'application_auto_scaling/scaling_schedule.rb', line 46 def max_capacity @max_capacity end |
#min_capacity ⇒ Numeric? (readonly)
Default: No new minimum capacity
The new minimum capacity.
During the scheduled time, if the current capacity is below the minimum capacity, Application Auto Scaling scales out to the minimum capacity.
At least one of maxCapacity and minCapacity must be supplied.
56 57 58 |
# File 'application_auto_scaling/scaling_schedule.rb', line 56 def min_capacity @min_capacity end |
#schedule ⇒ AWSCDK::ApplicationAutoScaling::Schedule (readonly)
When to perform this action.
31 32 33 |
# File 'application_auto_scaling/scaling_schedule.rb', line 31 def schedule @schedule end |
#start_time ⇒ DateTime? (readonly)
Default: The rule is activate immediately
When this scheduled action becomes active.
61 62 63 |
# File 'application_auto_scaling/scaling_schedule.rb', line 61 def start_time @start_time end |
#time_zone ⇒ AWSCDK::TimeZone? (readonly)
Default: - UTC
The time zone used when referring to the date and time of a scheduled action, when the scheduled action uses an at or cron expression.
66 67 68 |
# File 'application_auto_scaling/scaling_schedule.rb', line 66 def time_zone @time_zone end |
Class Method Details
.jsii_properties ⇒ Object
68 69 70 71 72 73 74 75 76 77 |
# File 'application_auto_scaling/scaling_schedule.rb', line 68 def self.jsii_properties { :schedule => "schedule", :end_time => "endTime", :max_capacity => "maxCapacity", :min_capacity => "minCapacity", :start_time => "startTime", :time_zone => "timeZone", } end |
Instance Method Details
#to_jsii ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'application_auto_scaling/scaling_schedule.rb', line 79 def to_jsii result = {} result.merge!({ "schedule" => @schedule, "endTime" => @end_time, "maxCapacity" => @max_capacity, "minCapacity" => @min_capacity, "startTime" => @start_time, "timeZone" => @time_zone, }) result.compact end |