class AWS::AutoScaling::ScheduledAction

@attr_reader [String] auto_scaling_group_name

@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

Attributes

name[R]

@return [String]

Public Class Methods

new(name, options = {}) click to toggle source

@private

# File lib/aws/auto_scaling/scheduled_action.rb, line 38
def initialize name, options = {}
  @name = name
  super
end

Public Instance Methods

delete() click to toggle source

Deletes the current scheduled action. @return [nil]

# File lib/aws/auto_scaling/scheduled_action.rb, line 123
def delete
  client_opts = {}
  client_opts[:scheduled_action_name] = name
  client_opts[:auto_scaling_group_name] = auto_scaling_group_name
  client.delete_scheduled_action(client_opts)
  nil
end
exists?() click to toggle source

@return [Boolean]

# File lib/aws/auto_scaling/scheduled_action.rb, line 114
def exists?
  client_opts = {}  
  client_opts[:scheduled_action_names] = [name]
  resp = client.describe_scheduled_actions(client_opts)
  !resp.scheduled_update_group_actions.empty?
end
group() click to toggle source

@return [Group]

# File lib/aws/auto_scaling/scheduled_action.rb, line 69
def group
  Group.new(auto_scaling_group_name, :config => config)
end
put(options = {}) click to toggle source
Alias for: update
update(options = {}) click to toggle source

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 93
def update options = {}

  client_opts = options.dup
  client_opts[:scheduled_action_name] = name
  client_opts[:auto_scaling_group_name] = auto_scaling_group_name

  # convert these options to timestamps 
  [:start_time, :end_time].each do |opt|
    if client_opts[opt].is_a?(Time)
      client_opts[opt] = client_opts[opt].iso8601
    end
  end

  client.put_scheduled_update_group_action(client_opts)

  nil

end
Also aliased as: put

Protected Instance Methods

get_resource(attr_name = nil) click to toggle source
# File lib/aws/auto_scaling/scheduled_action.rb, line 137
def get_resource attr_name = nil
  client_opts = {}
  client_opts[:scheduled_action_names] = [name]
  client.describe_scheduled_actions(client_opts)
end
resource_identifiers() click to toggle source
# File lib/aws/auto_scaling/scheduled_action.rb, line 133
def resource_identifiers
  [[:name, name]]
end