@attr_reader [Integer] desired_capacity
@attr_reader [String] recurrence
@attr_reader [Time] start_time
@attr_reader [Time] end_time
@attr_reader [Integer] min_size
@attr_reader [Integer] max_size
@attr_reader [String] arn
@return [String]
@api private
# File lib/aws/auto_scaling/scheduled_action.rb, line 36 def initialize group, name, options = {} @group = group @name = name super end
@return [String]
# File lib/aws/auto_scaling/scheduled_action.rb, line 48 def auto_scaling_group_name group.name end
Deletes the current scheduled action. @return [nil]
# File lib/aws/auto_scaling/scheduled_action.rb, line 118 def delete client.delete_scheduled_action(resource_options) nil end
@return [Boolean]
# File lib/aws/auto_scaling/scheduled_action.rb, line 106 def exists? client_opts = {} client_opts[:scheduled_action_names] = [name] client_opts[:auto_scaling_group_name] = auto_scaling_group_name resp = client.describe_scheduled_actions(client_opts) !resp.scheduled_update_group_actions.empty? rescue Errors::ValidationError false end
Updates the scheduled action. If you omit an option, the corresponding value remains unchanged in the Auto Scaling group.
@param [Hash] options
@option options [Integer] :desired_capacity
@option options [String] :recurrence
@option options [Time,String] :start_time
@option options [Time,String] :end_time
@option options [Integer] :min_size
@option options [Integer] :max_size
@return [nil]
# File lib/aws/auto_scaling/scheduled_action.rb, line 92 def update options = {} options.update(resource_options) # convert times to formatted strings [:start_time, :end_time].each do |opt| if options[opt].is_a?(Time) options[opt] = options[opt].iso8601 end end client.put_scheduled_update_group_action(options) nil end
# File lib/aws/auto_scaling/scheduled_action.rb, line 132 def get_resource attr_name = nil client_opts = {} client_opts[:scheduled_action_names] = [name] client_opts[:auto_scaling_group_name] = auto_scaling_group_name client.describe_scheduled_actions(client_opts) end
# File lib/aws/auto_scaling/scheduled_action.rb, line 125 def resource_identifiers [ [:auto_scaling_group_name, auto_scaling_group_name], [:scheduled_action_name, name], ] end