#!/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