1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[rackspace|lb] Added list parameter for nodeddress

This commit is contained in:
Brian Hartsock 2011-12-16 13:07:43 -05:00
parent eb046bf24d
commit 93df5bfb2f
2 changed files with 11 additions and 2 deletions

View file

@ -2,11 +2,17 @@ module Fog
module Rackspace
class LoadBalancers
class Real
def list_load_balancers
def list_load_balancers(options = {})
if options.has_key? :node_address
query_string = "?nodeaddress=#{options[:node_address]}"
else
query_string = ''
end
request(
:expects => 200,
:method => 'GET',
:path => 'loadbalancers.json'
:path => "loadbalancers.json?#{query_string}"
)
end
end

View file

@ -30,6 +30,9 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | load_balancer_tests', ['rackspace'
sleep 10
end
tests("#list_load_balancers({:node_address => '10.0.0.1'})").formats(LOAD_BALANCERS_FORMAT) do
@service.list_load_balancers({:node_address => '10.0.0.1'}).body
end
tests("#update_load_balancer(#{@lb_id}, { :port => 80 })").succeeds do
@service.update_load_balancer(@lb_id, { :port => 80 }).body