Class: AWS::EC2::InstanceCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/rodeo_clown/ext/aws/ec2/instance_collection.rb

Instance Method Summary collapse

Instance Method Details



12
13
14
# File 'lib/rodeo_clown/ext/aws/ec2/instance_collection.rb', line 12

def print_status(ec2)
  puts "#{ec2.id}\t#{ec2.status}"
end

#wait_for_status(status, interval = 1, collection = self) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/rodeo_clown/ext/aws/ec2/instance_collection.rb', line 2

def wait_for_status(status, interval = 1, collection = self)
  until collection.all? { |ec2| ec2.status == status } 
    puts "Waiting for ALL instances to be #{status}..."
    collection.each { |ec2| print_status(ec2) }
    sleep interval
  end

  collection
end