class AWS::AutoScaling::ScheduledActionCollection

def [] name

Returns:
  • (ScheduledAction) -

Parameters:
  • name (String) -- The name of the scheduled action.
def [] name
  if group_name = @filters[:auto_scaling_group_name]
    group = Group.new(group_name, :config => config)
    ScheduledAction.new(group, name)
  else
    msg = 'uou must filter this collection by a group to get a ' +
      'scheduled action by name'
    raise msg
  end
end

def _each_item next_token, limit, options = {}, &block

def _each_item next_token, limit, options = {}, &block
  options[:next_token] = next_token if next_token
  options[:max_records] = limit if limit
  resp = client.describe_scheduled_actions(options.merge(@filters))
  resp.scheduled_update_group_actions.each do |details|
    group = Group.new(details[:auto_scaling_group_name], :config => config)
    scheduled_action = ScheduledAction.new_from(
      :describe_scheduled_actions,
      details,
      group,
      details.scheduled_action_name,
      :config => config)
    yield(scheduled_action)
  end
  resp.data[:next_token]
end

def auto_scaling_group(options)

def auto_scaling_group(options)
  group = options.delete(:group)
  group ||= @filters[:auto_scaling_group_name]
  group = Group.new(group, :config => config) if group.is_a?(String)
  unless group
    raise ArgumentError, 'missing required option :group'
  end
  group
end

def create name, options = {}

Returns:
  • (ScheduledAction) -

Options Hash: (**options)
  • :end_time (Time) --
  • :start_time (Time) --
  • :recurrence (String) --
  • :min_size (Integer) --
  • :max_size (Integer) --
  • :desired_capacity (Integer) --
  • :group (Group, String) --

Parameters:
  • options (Hash) --
  • name (String) --
def create name, options = {}
  group = auto_scaling_group(options)
  scheduled_action = ScheduledAction.new(group, name,
    :auto_scaling_group_name => group.name,
    :config => config)
  scheduled_action.update(options)
  scheduled_action
end

def filter filters = {}

Returns:
  • (ScheduledActionCollection) - Returns a scheduled action

Options Hash: (**filters)
  • :end_time (Time, String) --
  • :start_time (Time, String) -- The earliest scheduled
  • :scheduled_actions (Array) --
  • :group (Group, String) --

Parameters:
  • filters (Hash) --
def filter filters = {}
  init_opts = {}
  init_opts[:config] = config
  init_opts[:filters] = @filters
  init_opts[:filters].merge!(filter_opts(filters))
  ScheduledActionCollection.new(init_opts)
end

def filter_opts options

def filter_opts options
  opts = {}
  if g = options[:group]
    opts[:auto_scaling_group_name] = g.is_a?(Group) ? g.name : g
  end
  if actions = options[:scheduled_actions]
    opts[:scheduled_action_names] = actions
  end
  [:end_time, :start_time].each do |opt|
    if options[opt].is_a?(Time)
      opts[opt] = options[opt].iso8601
    end
  end
  opts
end

def initialize options = {}

Other tags:
    Api: - private
def initialize options = {}
  @filters = options[:filters] || {}
  super
end