Sha256: b7f1bcc7d676292aceba411f0745573639aac036804f9bedab85d7ff7d9f9985

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents


module Rudy
  module CLI
    class Info < Rudy::CLI::CommandBase

      def info
        process_region @@global.region
        oregions = Rudy::AWS::VALID_REGIONS - [@@global.region.to_sym]
        if @option.all
          oregions.each do |region| 
            Rudy::AWS::EC2.connect @@global.accesskey, @@global.secretkey, region
            process_region region
          end
        else
          puts $/, "Other regions: " << oregions.join(', ')
        end
      end
      
      
      private 
      def process_region(region)
        puts " Region: %s %30s".att(:reverse) % [region, '']
        puts "  Machines".bright
        
        (get_machines(:region => region) rescue []).collect do |m| 
          m.refresh!
          puts "    " << m.to_s.noatt
        end
        
        puts "  Disks".bright
        (get_disks(:region => region) || []).collect do |d|
          d.refresh!
          puts "    " << d.to_s.noatt
        end
                
        puts "  Backups".bright
        (get_backups(:region => region) || []).collect do |b|
          b.refresh!
          puts "    " << b.to_s.noatt
        end
        
        puts
      end
      
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
solutious-rudy-0.9.2 lib/rudy/cli/info.rb
solutious-rudy-0.9.3 lib/rudy/cli/info.rb
rudy-0.9.3 lib/rudy/cli/info.rb
rudy-0.9.2 lib/rudy/cli/info.rb