Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion libcloud/loadbalancer/drivers/rackspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,42 @@ def ex_list_protocols_with_default_ports(self):
return self._to_protocols_with_default_ports(
self.connection.request('/loadbalancers/protocols').object)

def list_balancers(self, ex_member_address=None):
def list_balancers(self, ex_member_address=None, ex_status=None,
ex_changes_since=None, ex_params={}):
"""
@inherits: :class:`Driver.list_balancers`

:param ex_member_address: Optional IP address of the attachment member.
If provided, only the load balancers which
have this member attached will be returned.
:type ex_member_address: ``str``

:param ex_status: Optional. Filter balancers by status
:type ex_status: ``str``

:param ex_changes_since: Optional. List all load balancers that have
changed since the specified date/time
:type ex_changes_since: ``str``

:param ex_params: Optional. Set parameters to be submitted to the API
in the query string
:type ex_params: ``dict``
"""

params = {}

if ex_member_address:
params['nodeaddress'] = ex_member_address

if ex_status:
params['status'] = ex_status

if ex_changes_since:
params['changes-since'] = ex_changes_since

for key, value in ex_params.items():
params[key] = value

return self._to_balancers(
self.connection.request('/loadbalancers', params=params).object)

Expand Down