Sha256: 608ca19f3590a568382f1f82dd188d66ec91a53da22776e7b8807ad7c1ea8946
Contents?: true
Size: 1.17 KB
Versions: 28
Compression:
Stored size: 1.17 KB
Contents
#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + "/../lib") require "poolparty" require 'git-style-binary/command' GitStyleBinary.command do banner <<-EOS Usage: #{$0} #{all_options_string} List the clouds and their nodes e.g. show a list of the current instances on the cloud EOS opt :instance_id, "Describe a specific instance", :type => String, :default => nil short_desc "show a list of the current instances on the clouds" run do |command| @loaded_clouds.each do |cld| if command[:instance_id] require 'pp' pp result = cld.nodes(:instance_id=>command[:instance_id]) else line = "-----------------------------" msg = ["Listing cloud #{cld.name}"] hsh = {} cld.describe_instances(:keypair_name => cld.keypair.basename).each do |n| (hsh[n.status] ||= []) << n end hsh.each do |k,v| msg << "#{k.capitalize} nodes" msg << line v.each do |a| msg << " #{a[:instance_id] || a[:id]}\t#{a[:ip] || a[:public_ip] || a[:name]}" end msg << "" end print_msg(msg) end end end end
Version data entries
28 entries across 28 versions & 3 rubygems