Sha256: da320fb978adab674fdc5be84df0f4343215e5aff6f1df49fd6c18400aa593bb

Contents?: true

Size: 783 Bytes

Versions: 5

Compression:

Stored size: 783 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 ssh to, starts at 0.", :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 || nodes[n].public_ip ) if @cloud
    else
      puts "No running instances can be found"
    end
    
  end    
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
auser-poolparty-1.2.10 bin/cloud-ssh
auser-poolparty-1.2.11 bin/cloud-ssh
auser-poolparty-1.2.12 bin/cloud-ssh
auser-poolparty-1.2.9 bin/cloud-ssh
fairchild-poolparty-1.2.12 bin/cloud-ssh