Sha256: ca1919f037243d56ebc889539423895dc13874bafd0ea41f617a59c2b496d49e

Contents?: true

Size: 798 Bytes

Versions: 20

Compression:

Stored size: 798 Bytes

Contents

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

require 'git-style-binary/command'

GitStyleBinary.command do  
  banner <<-EOS
Usage: #{$0} #{all_options_string}

  contracts the cloud by a single instance
EOS

  short_desc "contracts the cloud by a single instance"

  run do |command|    
    @loaded_clouds.each do |cld|
      
      node_to_terminate = cld.nodes.last
      node_to_terminate.cloud = cld
      
      msg = [
        "Contracting cloud #{cld.name} (#{cld.keypair}) by 1",
        " node: #{node_to_terminate.public_ip}"
      ]
      
      print_msg(msg)
      
      node_to_terminate.terminate!
      
      msg = [
        "#{node_to_terminate.public_ip} has been terminated"
      ]
      
      print_msg(msg)
    end    
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
auser-poolparty-1.3.10 bin/cloud-contract
auser-poolparty-1.3.11 bin/cloud-contract
auser-poolparty-1.3.12 bin/cloud-contract
auser-poolparty-1.3.13 bin/cloud-contract
auser-poolparty-1.3.14 bin/cloud-contract
auser-poolparty-1.3.15 bin/cloud-contract
auser-poolparty-1.3.16 bin/cloud-contract
auser-poolparty-1.3.17 bin/cloud-contract
auser-poolparty-1.3.5 bin/cloud-contract
auser-poolparty-1.3.6 bin/cloud-contract
auser-poolparty-1.3.7 bin/cloud-contract
auser-poolparty-1.3.8 bin/cloud-contract
fairchild-poolparty-1.3.17 bin/cloud-contract
fairchild-poolparty-1.3.5 bin/cloud-contract
poolparty-1.3.15 bin/cloud-contract
poolparty-1.3.14 bin/cloud-contract
poolparty-1.3.13 bin/cloud-contract
poolparty-1.3.8 bin/cloud-contract
poolparty-1.3.7 bin/cloud-contract
poolparty-1.3.6 bin/cloud-contract