Class: VolumesCommand

Inherits:
Command show all
Defined in:
lib/maws/volumes_command.rb

Direct Known Subclasses

VolumesCleanup, VolumesStatus

Instance Attribute Summary

Attributes inherited from Command

#connection, #maws

Instance Method Summary collapse

Methods inherited from Command

#add_generic_options, #add_specific_options, #description, #initialize, #instances, #process_options, #verify_configs, #verify_options

Constructor Details

This class inherits a constructor from Command

Instance Method Details

#create_ebs_from_descriptionsObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/maws/volumes_command.rb', line 4

def create_ebs_from_descriptions
  specified_roles = @maws.specified_roles
  specified_zones = @maws.specified_zones

  connection.ebs_descriptions.map { |description|
    instance = description.create_instance(self, @config)
    next unless instance.name
    instances.add(instance)
    instance.groups << "aws"
    if specified_roles.include?(instance.role) && specified_zones.include?(instance.zone)
      instance.groups << "specified"
    end
  }


  info "\n"
  info "EBS:"
  info "TOTAL #{@config.profile.name.upcase} EBS VOLUMES ON AWS: #{instances.aws.ebs.count}  "
  info "TOTAL EBS VOLUMES SELECTED: #{instances.ebs.specified.count}"
  info "TOTAL EBS VOLUMES SELECTED ON AWS: #{instances.ebs.specified.aws.count}"
end

#run!Object



26
27
28
# File 'lib/maws/volumes_command.rb', line 26

def run!
  create_ebs_from_descriptions
end