Class: ElbDescribe

Inherits:
ElbCommand
  • Object
show all
Defined in:
lib/maws/commands/elb-describe.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



6
7
8
# File 'lib/maws/commands/elb-describe.rb', line 6

def description
  "elb-describe - prints detailed information about all specified ELBs"
end

#run!Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/maws/commands/elb-describe.rb', line 10

def run!
  elbs = instances.specified.with_service(:elb)

  elbs.each do |elb|
    title = elb.name.to_s.upcase
    instances = elb.attached_instances
    text =  "ENABLED ZONES: #{elb.enabled_availability_zones.join(', ')}\n" +
    "ATTACHED INSTANCES:\n\n" +
    instances.collect {|i| "#{i.name} (#{i.aws_id})"}.join("\n")

    InstanceDisplay.pretty_describe(title, text)
  end
end