Sha256: a677ad1a20ff70d0611ede556321918138559dfde089748388dc3e1a08ed7f15
Contents?: true
Size: 1.12 KB
Versions: 27
Compression:
Stored size: 1.12 KB
Contents
#!/usr/bin/env ruby $:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require "poolparty" require "poolpartycl" o = PoolParty::Optioner.new(ARGV) do |opts, optioner| opts.on('-f [remote|local]', '--from [remote|local]', 'Remote or local (default: local)') { |o| optioner.location o } opts.on('-r', '--remote', 'Remote listing') { optioner.location "remote" } opts.on('-l', '--local', 'Local listing') { optioner.location "local" } opts.on('-n name', '--name name', 'Listing for cloud name') { |c| optioner.cloudname c } end load_pool(o.spec || Binary.get_existing_spec_location) @location = o.location ? o.location : "remote" include Remote @clouds = o.cloudname ? [cloud(o.cloudname.downcase.to_sym)] : clouds @clouds.each do |name, cloud| with_cloud(cloud, {:location => @location}) do puts header("Listing cloud #{name}") puts subheader("Active instances") puts list_of_running_instances.map{|a| a.to_s}.join("\n") puts "" if list_of_pending_instances.size > 0 puts subheader("Pending instances") puts list_of_pending_instances.map{|a| a.to_s}.join("\n") end end end
Version data entries
27 entries across 27 versions & 2 rubygems