Class: AWS::AutoScaling::ActivityCollection

Inherits:
Object
  • Object
show all
Includes:
Core::Collection::Limitable
Defined in:
lib/aws/auto_scaling/activity_collection.rb

Overview

Allows you to enumerate Auto Scaling activities

Enumerating ALL activities:

auto_scaling = AWS::AutoScaling.new
auto_scaling.activities.each do |activity|
  # ...
end

Enumerating activities for a single Auto Scaling group:

group = auto_scaling.groups['group-name']
group.activities.each do |activity|
  # ...
end

If you know the id of an activity you can get a refernce to it:

activity = auto_scaling.activities['activity-id']

Instance Attribute Summary

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods included from Core::Collection::Limitable

#each_batch

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Methods included from Core::Model

#client, #config_prefix, #inspect

Constructor Details

#initialize(options = {}) ⇒ ActivityCollection

Returns a new instance of ActivityCollection.


42
43
44
45
46
47
48
49
# File 'lib/aws/auto_scaling/activity_collection.rb', line 42

def initialize options = {}
  @group = options[:group]
  if @group
    super(@group, options)
  else
    super
  end
end

Instance Method Details

#[](activity_id) ⇒ Activity

Parameters:

  • activity_id (String)

Returns:


53
54
55
# File 'lib/aws/auto_scaling/activity_collection.rb', line 53

def [] activity_id
  Activity.new(activity_id, :config => config)
end