Sha256: 9f08cb98932dd38352aad18957844ce801b2ffb91c215f68d49b39d170c62aa8

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + "/../lib")
require "poolparty"

require 'git-style-binary/command'

GitStyleBinary.command do
  @theme = :short
  
  version "PoolParty #{$0} command"  
  banner <<-EOS
Usage: #{$0} #{all_options_string}

shows output about the clouds.rb

EOS

  short_desc "shows output about the clouds.rb"
  opt :generate_graph, "Generate the dependency tree graph", :type => :string, :default => nil

  run do |command|

    @loaded_clouds.each do |cld|
        
      msg = [
        "Cloud: #{cld.name}",
        "----------------------------",
        "Instances: #{cld.nodes(:status => "running").size}",
        "Minimum instances: #{cld.minimum_instances}",
        "Maximum instances: #{cld.maximum_instances}",
        "Running on: #{cld.cloud_provider_name}"
      ]
      
      if verbose?
        msg << [
          "Keypair: #{cld.keypair.basename}"
        ]
      end
      
      if command[:generate_graph]
        vputs "Generating dependency graph at: #{command[:generate_graph]}"
        cld.output_resources_graph('png', command[:generate_graph], {"fontsize" => 30})
      end
            
      print_msg(msg.flatten)
      
    end
    
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
auser-poolparty-1.3.17 bin/cloud-show
fairchild-poolparty-1.3.17 bin/cloud-show