Sha256: 6577b6494c72a7f24120776f7413f871cf606304cc6fb4010e08974a0bf39c1c

Contents?: true

Size: 573 Bytes

Versions: 1

Compression:

Stored size: 573 Bytes

Contents

require 'AWS'

class Ec2Tools::EC2 < AWS::EC2::Base
  def initialize(config)
    @config = config
  end
  
  def servers
    unless @servers
      @servers = {}
      describe_instances.reservationSet.item.each do |reservation|
        reservation.instanceSet.item.each do |instance|
          if instance.instanceState.name == "running"
            key = instnacekeyName.to_sym
            @servers[key] = [] if @servers[key].nil?
            @servers[key] << instance
          end
        end
      end
    end
    @servers
  end
  
  def inspect
    "#<EC2>"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ec2_tools-0.3.0 lib/ec2_tools/ec2.rb