2011-07-13 16:27:55 -04:00
|
|
|
module Fog
|
|
|
|
module Rackspace
|
2011-08-04 17:21:22 -04:00
|
|
|
class LoadBalancers
|
2011-07-13 16:27:55 -04:00
|
|
|
class Real
|
|
|
|
def update_node(load_balancer_id, node_id, options = {})
|
|
|
|
data = {
|
|
|
|
'node' => {}
|
|
|
|
}
|
|
|
|
if options.has_key? :weight
|
|
|
|
data['node']['weight'] = options[:weight]
|
|
|
|
end
|
|
|
|
if options.has_key? :condition
|
|
|
|
data['node']['condition'] = options[:condition]
|
|
|
|
end
|
|
|
|
#TODO - Do anything if no valid options are passed in?
|
|
|
|
request(
|
2012-04-25 10:31:28 -04:00
|
|
|
:body => Fog::JSON.encode(data),
|
2011-07-13 16:27:55 -04:00
|
|
|
:expects => [200, 202],
|
|
|
|
:method => 'PUT',
|
|
|
|
:path => "loadbalancers/#{load_balancer_id}/nodes/#{node_id}.json"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|