Add docstring to wait_for_load_balancer() method

The API documentation does not show this method because of the
missing docstring.

Story: 2009809
Task: 44368
Change-Id: Icbbfdd3fa546c6f61331c805640cc3a9c5da1a0b
This commit is contained in:
Tom Weininger 2022-02-07 12:25:52 +01:00
parent 9d3ee1d321
commit c92f260e22
2 changed files with 21 additions and 1 deletions

View File

@ -17,7 +17,7 @@ Load Balancer Operations
:noindex:
:members: create_load_balancer, delete_load_balancer, find_load_balancer,
get_load_balancer, get_load_balancer_statistics, load_balancers,
update_load_balancer, failover_load_balancer
update_load_balancer, failover_load_balancer, wait_for_load_balancer
Listener Operations
^^^^^^^^^^^^^^^^^^^

View File

@ -127,6 +127,26 @@ class Proxy(proxy.Proxy):
def wait_for_load_balancer(self, name_or_id, status='ACTIVE',
failures=['ERROR'], interval=2, wait=300):
"""Wait for load balancer status
:param name_or_id: The name or ID of the load balancer.
:param status: Desired status.
:param failures: Statuses that would be interpreted as failures.
Default to ['ERROR'].
:type failures: :py:class:`list`
:param interval: Number of seconds to wait between consecutive
checks. Defaults to 2.
:param wait: Maximum number of seconds to wait before the status
to be reached. Defaults to 300.
:returns: The load balancer is returned on success.
:raises: :class:`~openstack.exceptions.ResourceTimeout` if transition
to the desired status failed to occur within the specified wait
time.
:raises: :class:`~openstack.exceptions.ResourceFailure` if the resource
has transited to one of the failure statuses.
:raises: :class:`~AttributeError` if the resource does not have a
``status`` attribute.
"""
lb = self._find(_lb.LoadBalancer, name_or_id, ignore_missing=False)
return resource.wait_for_status(self, lb, status, failures, interval,