Sha256: b37980dbdd4965bfc16b8fcf87e42e54a0317f62f89a8264ded48cdacf97465f

Contents?: true

Size: 757 Bytes

Versions: 3

Compression:

Stored size: 757 Bytes

Contents

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__) + "/../lib")
require "poolparty"
# require "poolpartycl"
require 'git-style-binary/command'

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

  ssh into an instance of the cloud
EOS

  short_desc "ssh into an instance of the cloud"
  opt :inst_num, "The number of the instance to run bootstrap on", :type => :int
  
  run do |command|    
    @cloud = @loaded_clouds.first
    nodes = @cloud.nodes(:status => "running")
    
    if !nodes.empty?
      n = command[:inst_num] ? command[:inst_num].to_i : 0
      @cloud.ssh_into( nodes[n].ip ) if @cloud
    else
      puts "No running instances can be found"
    end
    
  end    
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
auser-poolparty-1.2.3 bin/cloud-ssh
auser-poolparty-1.2.4 bin/cloud-ssh
auser-poolparty-1.2.7 bin/cloud-ssh