Sha256: 2c2a1e8db6f23231e471dc0c884bc9fd9e722d0af35067d3e93ff9d724b67340

Contents?: true

Size: 596 Bytes

Versions: 12

Compression:

Stored size: 596 Bytes

Contents

class CommandQueryHandler
  def self.run_query(on_cloud, command, args, opts={})
    port = opts[:port] || 11223
    host = opts[:host] || "localhost"

    transport = Thrift::BufferedTransport.new(Thrift::Socket.new(host, port))
    protocol = Thrift::BinaryProtocol.new(transport)

    client = CloudThrift::CommandInterface::Client.new(protocol)
    transport.open()

    cld = CloudThrift::CloudQuery.new
    cld.name = on_cloud.name
    
    ddputs("Running command: #{command} on #{cld.name} at #{host}:#{port}")
    resp = client.run_command(cld, command, args)
    resp.response
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
auser-poolparty-1.3.10 lib/proto/command_query_handler.rb
auser-poolparty-1.3.11 lib/proto/command_query_handler.rb
auser-poolparty-1.3.12 lib/proto/command_query_handler.rb
auser-poolparty-1.3.13 lib/proto/command_query_handler.rb
auser-poolparty-1.3.14 lib/proto/command_query_handler.rb
auser-poolparty-1.3.15 lib/proto/command_query_handler.rb
auser-poolparty-1.3.16 lib/proto/command_query_handler.rb
auser-poolparty-1.3.17 lib/proto/command_query_handler.rb
fairchild-poolparty-1.3.17 lib/proto/command_query_handler.rb
poolparty-1.3.15 lib/proto/command_query_handler.rb
poolparty-1.3.14 lib/proto/command_query_handler.rb
poolparty-1.3.13 lib/proto/command_query_handler.rb