Class: VolumesStatus
Instance Attribute Summary
Attributes inherited from Command
#connection, #maws
Instance Method Summary
collapse
#create_ebs_from_descriptions
Methods inherited from Command
#add_generic_options, #add_specific_options, #initialize, #instances, #process_options, #verify_configs, #verify_options
Constructor Details
This class inherits a constructor from Command
Instance Method Details
#description ⇒ Object
6
7
8
|
# File 'lib/maws/commands/volumes-status.rb', line 6
def description
"volumes-status - show brief status information for EBS volumes for specified roles"
end
|
#list_ebs_instances(instances) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/maws/commands/volumes-status.rb', line 22
def list_ebs_instances(instances)
if instances.empty?
info "none available"
return
end
= instances.first.display.
table_rows = []
grouped_instances = instances.
group_by{|i| i.name}.
to_a.sort_by {|group| group[0]}
grouped_instances.each_with_index do |(name, instances), i|
instances.each {|instance|
table_rows << instance.display.values
}
end
info table(, *table_rows)
end
|
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/maws/commands/volumes-status.rb', line 10
def run!
super
attached = instances.specified.ebs.matching(:attached? => true)
unattached = instances.specified.ebs.matching(:attached? => false)
info "\n**** " + "ATTACHED EBS VOLUMES" + " *****************"
list_ebs_instances(attached)
info "\n\n**** " + "UNATTACHED EBS VOLUMES" + " *****************"
list_ebs_instances(unattached)
end
|