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

Version Path
auser-poolparty-0.2.15 bin/cloud-list
auser-poolparty-0.2.16 bin/cloud-list
auser-poolparty-0.2.2 bin/cloud-list
auser-poolparty-0.2.20 bin/cloud-list
auser-poolparty-0.2.21 bin/cloud-list
auser-poolparty-0.2.22 bin/cloud-list
auser-poolparty-0.2.23 bin/cloud-list
auser-poolparty-0.2.24 bin/cloud-list
auser-poolparty-0.2.25 bin/cloud-list
auser-poolparty-0.2.26 bin/cloud-list
auser-poolparty-0.2.3 bin/cloud-list
auser-poolparty-0.2.35 bin/cloud-list
auser-poolparty-0.2.36 bin/cloud-list
auser-poolparty-0.2.37 bin/cloud-list
auser-poolparty-0.2.38 bin/cloud-list
auser-poolparty-0.2.39 bin/cloud-list
auser-poolparty-0.2.4 bin/cloud-list
auser-poolparty-0.2.40 bin/cloud-list
auser-poolparty-0.2.41 bin/cloud-list
auser-poolparty-0.2.42 bin/cloud-list