cloudfoundry/bosh — pull request #216 by drnic (2013-05-28 17:18:10+00:00)
Title: simple agent_client cli

Supports ping/state requests

Examples running on a bosh_agent VM:

$ agent_client -m https://vcap:vcap@localhost:6969 ping
pong
$ agent_client ping
pong
$ agent_client state
{"deployment"=>"", "job"=>"", "index"=>"", "networks"=>{}, "resource_pool"=>{}, "packages"=>{}, "persistent_disk"=>{}, "configuration_hash"=>{}, "properties"=>{}, "agent_id"=>"micro", "vm"=>nil, "job_state"=>"running", "bosh_protocol"=>"1", "ntp"=>{"message"=>"file missing"}}

And for incorrect https agent URI:

agent_client -m https://vcap:vcap@localhost:9999 ping
/mnt/hgfs/!%bosh/agent_client/lib/agent_client/http_client.rb:46:in `rescue in request': Request details: (Bosh::Agent::Error)
uri: https://localhost:9999/agent
payload: {"method":"ping","arguments":[],"reply_to":"Bosh::Agent::HTTPClient"}
user: vcap
password: vcap
Errno::ECONNREFUSED: Connection refused - connect(2) (https://localhost:9999)