Add some missing docstrings to classes in the loadbalancer API.

Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e1fc7e9b
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e1fc7e9b
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e1fc7e9b

Branch: refs/heads/trunk
Commit: e1fc7e9b97ce46b797584a6f49384ba901f51273
Parents: b56f901
Author: Tomaz Muraus <[email protected]>
Authored: Sun Nov 17 20:32:09 2013 +0100
Committer: Tomaz Muraus <[email protected]>
Committed: Sun Nov 17 20:32:09 2013 +0100

----------------------------------------------------------------------
 libcloud/loadbalancer/base.py | 51 +++++++++++++++++++++++++++++++++++---
 1 file changed, 48 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e1fc7e9b/libcloud/loadbalancer/base.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/base.py b/libcloud/loadbalancer/base.py
index 9868efb..c017f3b 100644
--- a/libcloud/loadbalancer/base.py
+++ b/libcloud/loadbalancer/base.py
@@ -25,8 +25,27 @@ __all__ = [
 
 
 class Member(object):
+    """
+    Represents a load balancer member.
+    """
 
     def __init__(self, id, ip, port, balancer=None, extra=None):
+        """
+        :param id: Member ID.
+        :type id: ``str``
+
+        :param ip: IP address of this member.
+        :param ip: ``str``
+
+        :param port: Port of this member
+        :param port: ``str``
+
+        :param balancer: Balancer this member is attached to. (optional)
+        :param balancer: :class:`.LoadBalancer`
+
+        :param extra: Provider specific attributes.
+        :type extra: ``dict``
+        """
         self.id = str(id) if id else None
         self.ip = ip
         self.port = port
@@ -39,6 +58,10 @@ class Member(object):
 
 
 class Algorithm(object):
+    """
+    Represents a load balancing algorithm.
+    """
+
     RANDOM = 0
     ROUND_ROBIN = 1
     LEAST_CONNECTIONS = 2
@@ -53,10 +76,29 @@ class LoadBalancer(object):
     Provide a common interface for handling Load Balancers.
     """
 
-    name = None
-    website = None
-
     def __init__(self, id, name, state, ip, port, driver, extra=None):
+        """
+        :param id: Load balancer ID.
+        :type id: ``str``
+
+        :param name: Load balancer name.
+        :type name: ``str``
+
+        :param state: State this loadbalancer is in.
+        :type state: :class:`libcloud.loadbalancer.types.State`
+
+        :param ip: IP address of this loadbalancer.
+        :type ip: ``str``
+
+        :param port: Port of this loadbalancer.
+        :type port: ``int``
+
+        :param driver: Driver this loadbalancer belongs to.
+        :type driver: :class:`.Driver`
+
+        :param extra: Provier specific attributes. (optional)
+        :type extra: ``dict``
+        """
         self.id = str(id) if id else None
         self.name = name
         self.state = state
@@ -95,6 +137,9 @@ class Driver(BaseDriver):
     This class is always subclassed by a specific driver.
     """
 
+    name = None
+    website = None
+
     connectionCls = ConnectionKey
     _ALGORITHM_TO_VALUE_MAP = {}
     _VALUE_TO_ALGORITHM_MAP = {}

Reply via email to