You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/05/14 15:21:22 UTC

svn commit: r1103096 - /incubator/libcloud/trunk/libcloud/loadbalancer/base.py

Author: tomaz
Date: Sat May 14 13:21:21 2011
New Revision: 1103096

URL: http://svn.apache.org/viewvc?rev=1103096&view=rev
Log:
Change the create_balancer method signature and add list_protocols method.

Modified:
    incubator/libcloud/trunk/libcloud/loadbalancer/base.py

Modified: incubator/libcloud/trunk/libcloud/loadbalancer/base.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/loadbalancer/base.py?rev=1103096&r1=1103095&r2=1103096&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/loadbalancer/base.py (original)
+++ incubator/libcloud/trunk/libcloud/loadbalancer/base.py Sat May 14 13:21:21 2011
@@ -20,7 +20,8 @@ __all__ = [
         "LBMember",
         "LB",
         "LBDriver",
-        "LBAlgorithm"
+        "LBAlgorithm",
+        "LBProtocol"
         ]
 
 class LBMember(object):
@@ -97,6 +98,14 @@ class LBDriver(object):
         self.connection.driver = self
         self.connection.connect()
 
+    def list_protocols(self):
+        """
+        Return a list of supported protocols.
+        """
+
+        raise NotImplementedError, \
+                'list_protocols not implemented for this driver'
+
     def list_balancers(self):
         """
         List all loadbalancers
@@ -108,18 +117,21 @@ class LBDriver(object):
         raise NotImplementedError, \
                 'list_balancers not implemented for this driver'
 
-    def create_balancer(self, name, port, algorithm, members):
+    def create_balancer(self, name, port, protocol, algorithm, members):
         """
         Create a new load balancer instance
 
         @keyword name: Name of the new load balancer (required)
         @type name: C{str}
-        @keyword port: Port the load balancer should listen on (required)
+        @keyword members: C{list} ofL{LBNode}s to attach to balancer
+        @type: C{list} of L{LBNode}s
+        @keyword protocol: Loadbalancer protocol, defaults to http.
+        @type: C{str}
+        @keyword port: Port the load balancer should listen on, defaults to 80
         @type port: C{str}
-        @keyword algorithm: Load balancing algorithm (defaults to round robin)
+        @keyword algorithm: Load balancing algorithm, defaults to
+                            LBAlgorithm.ROUND_ROBIN
         @type algorithm: C{LBAlgorithm}
-        @keyword members: C{list} of L{LBNode}s to attach to balancer
-        @type: C{list} of L{LBNode}s
 
         """