libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r1103003 - /incubator/libcloud/trunk/libcloud/loadbalancer/base.py
Date Sat, 14 May 2011 10:13:27 GMT
Author: pquerna
Date: Sat May 14 10:13:27 2011
New Revision: 1103003

URL: http://svn.apache.org/viewvc?rev=1103003&view=rev
Log:
Add balancer_attach_compute_node, which takes a normal libcloud compute node object, and attempts
to add it to the load balancer as a member

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=1103003&r1=1103002&r2=1103003&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/loadbalancer/base.py (original)
+++ incubator/libcloud/trunk/libcloud/loadbalancer/base.py Sat May 14 10:13:27 2011
@@ -54,8 +54,8 @@ class LB(object):
         self.port = port
         self.driver = driver
 
-    def attach_member(self, member):
-        return self.driver.balancer_attach_member(self, member)
+    def attach_compute_node(self, node):
+        return self.driver.balacner_attach_compute_node(node)
 
     def detach_member(self, member):
         return self.driver.balancer_detach_member(self, member)
@@ -150,15 +150,24 @@ class LBDriver(object):
         raise NotImplementedError, \
                 'balancer_detail not implemented for this driver'
 
-    def balancer_attach_member(self, balancer, **kwargs):
+    def balancer_attach_node(self, balacner, node):
+      """
+      Attach a compute node as a member to the load balancer.
+
+      @keyword node: Member to join to the balancer
+      @type member: C{libcloud.compute.base.Node}
+      @return {LBMember} Member after joining the balancer.
+      """
+
+      return self.attach_member(LBMember(None, node.public_ip[0], balacner.port))
+    
+    def balancer_attach_member(self, balancer, member):
         """
         Attach a member to balancer
 
-        @keyword ip: IP address of a member
-        @type ip: C{str}
-        @keyword port: port that services we're balancing listens on on the member
-        @keyword port: C{str}
-
+        @keyword member: Member to join to the balancer
+        @type member: C{LBMember}
+        @return {LBMember} Member after joining the balancer.
         """
 
         raise NotImplementedError, \



Mime
View raw message