Sha256: 013d8480ef2a5e2f705a88ee67d7f62634cfaa91b655fcb641530b3f67543be3

Contents?: true

Size: 1.26 KB

Versions: 33

Compression:

Stored size: 1.26 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

o.loaded_clouds.each do |cloud|

  with_cloud(cloud) do
    vputs header("Maintaining cloud #{name}")
    logger.warn "Maintaining cloud"
    logger.warn rules_values
    if !minimum_number_of_instances_are_running?
      vputs "#{list_of_running_instances.size} running instances of between #{minimum_instances} and #{maximum_instances}"
      vputs "Launching new instance"
      launch_minimum_number_of_instances
    elsif maximum_number_of_instances_are_running?
      vputs "#{list_of_running_instances.size} running instances of between #{minimum_instances} and #{maximum_instances}"
      vputs "Shutting down non-master instance"
      contract_cloud_if_necessary( !testing )
    end    
    vputs "Cloud is maintained"
  end  

end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
auser-poolparty-0.2.45 bin/cloud-maintain
auser-poolparty-0.2.46 bin/cloud-maintain
auser-poolparty-0.2.47 bin/cloud-maintain
auser-poolparty-0.2.48 bin/cloud-maintain
auser-poolparty-0.2.49 bin/cloud-maintain
auser-poolparty-0.2.50 bin/cloud-maintain
auser-poolparty-0.2.51 bin/cloud-maintain
auser-poolparty-0.2.52 bin/cloud-maintain
auser-poolparty-0.2.53 bin/cloud-maintain
auser-poolparty-0.2.54 bin/cloud-maintain
auser-poolparty-0.2.55 bin/cloud-maintain
auser-poolparty-0.2.56 bin/cloud-maintain
auser-poolparty-0.2.57 bin/cloud-maintain
auser-poolparty-0.2.58 bin/cloud-maintain
auser-poolparty-0.2.59 bin/cloud-maintain
auser-poolparty-0.2.60 bin/cloud-maintain
auser-poolparty-0.2.61 bin/cloud-maintain
auser-poolparty-0.2.62 bin/cloud-maintain
auser-poolparty-0.2.63 bin/cloud-maintain
auser-poolparty-0.2.64 bin/cloud-maintain