Class: SilverSpurs::Client
- Inherits:
-
Object
- Object
- SilverSpurs::Client
- Defined in:
- lib/silver_spurs/client.rb
Instance Method Summary collapse
-
#initialize(host_url, options = {}) ⇒ Client
constructor
A new instance of Client.
- #start_bootstrap(ip, node_name, options = {}) ⇒ Object
Constructor Details
#initialize(host_url, options = {}) ⇒ Client
Returns a new instance of Client.
10 11 12 13 |
# File 'lib/silver_spurs/client.rb', line 10 def initialize(host_url, ={}) @host_url = host_url @timeout = [:timeout] || 2 * 60 end |
Instance Method Details
#start_bootstrap(ip, node_name, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/silver_spurs/client.rb', line 15 def start_bootstrap(ip, node_name, = {}) params = extract_extra_params().merge({:node_name => node_name}) payload = parameterize_hash params headers = {:accept => :json, :content_type=> 'application/x-www-form-urlencoded'} response = spur_host["bootstrap/#{ip}"].put(payload, headers, &method(:dont_redirect_for_303)) throw ClientException.new("unexpected response", response) unless response.code == 303 BootstrapRun.new(response.headers[:location], :timeout => @timeout) end |