Sha256: dfeed36013b866387cf4f4552e9e9bbba03ec9c6e3356dba92d5c5eaf569b6ba

Contents?: true

Size: 717 Bytes

Versions: 7

Compression:

Stored size: 717 Bytes

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('-n name', '--name name', 'Listing for cloud name')    { |c| optioner.cloudname c }
end

o.loaded_clouds.each do |cld|  
  puts header("Contracting cloud #{cld.name}")
  puts "#{cld.nodes(:status => "running").size} running instances (#{cld.minimum_instances} minimum instances)"
  puts testing ? "Not contracting (test mode)" : "Contracting the cloud if possible"

  last_instance_id = cld.nodes(:status => "running").last[:instance_id]
  cld.remote_base.terminate_instance! cld.options.merge(:instance_id => last_instance_id)
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
auser-poolparty-1.1.6 bin/cloud-contract
auser-poolparty-1.1.7 bin/cloud-contract
auser-poolparty-1.2.0 bin/cloud-contract
auser-poolparty-1.2.1 bin/cloud-contract
auser-poolparty-1.2.2 bin/cloud-contract
fairchild-poolparty-1.1.5 bin/cloud-contract
poolparty-1.2.2 bin/cloud-contract