Sha256: 30769e16db5e380e6325ca530046f796e5b248afc650304fb4bc325e4fac40b8

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby

$:.unshift(File.dirname(__FILE__) + "/../../lib")
$:.unshift(File.dirname(__FILE__) + "/../../examples")
require "poolparty"
# require "simple"

$:.unshift("#{File.dirname(__FILE__)}/../../lib/proto/gen-rb")

require "thrift"
require "command_interface"
require "poolparty_constants"
require "poolparty_types"

port = ARGV.pop || 11223

transport = Thrift::BufferedTransport.new(Thrift::Socket.new('localhost', port))
# transport = Thrift::BufferedTransport.new(Thrift::Socket.new('192.168.2.31', port))
# transport = Thrift::BufferedTransport.new(Thrift::Socket.new('vm', port))
protocol = Thrift::BinaryProtocol.new(transport)

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

cld = CloudThrift::CloudQuery.new
cld.name = 'pp2'
# cld.name = 'monitored_app'
# cld.name = 'vmware'

resp = client.run_command(cld, "name", [])
puts resp.response

resp = client.run_command(cld, "maximum_instances", [])
puts resp.response

resp = client.run_command(cld, "run_monitor", ["cpu-idle", "0.91"])
p resp.response

resp = client.run_command(cld, "run_monitor", ["cpu-idle", "0.01"])
p resp.response

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
auser-poolparty-1.3.11 examples/thrift/thrift_example.rb
auser-poolparty-1.3.12 examples/thrift/thrift_example.rb
auser-poolparty-1.3.13 examples/thrift/thrift_example.rb
auser-poolparty-1.3.14 examples/thrift/thrift_example.rb
auser-poolparty-1.3.15 examples/thrift/thrift_example.rb
auser-poolparty-1.3.16 examples/thrift/thrift_example.rb
auser-poolparty-1.3.17 examples/thrift/thrift_example.rb
fairchild-poolparty-1.3.17 examples/thrift/thrift_example.rb
poolparty-1.3.15 examples/thrift/thrift_example.rb
poolparty-1.3.14 examples/thrift/thrift_example.rb
poolparty-1.3.13 examples/thrift/thrift_example.rb