[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a

Garrett Holmstrom gholms at fedoraproject.org
Sun Jun 16 02:30:55 UTC 2013


The following commit has been merged in the master branch:
commit 3b41dbec16239bca8a37b33604e641d7194412cb
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Sun Mar 31 19:17:13 2013 -0700

    Implement ConfigureHealthCheck
    
    Fixes TOOLS-252

diff --git a/bin/euelb-configure-healthcheck b/bin/euelb-configure-healthcheck
new file mode 100755
index 0000000..43b4a83
--- /dev/null
+++ b/bin/euelb-configure-healthcheck
@@ -0,0 +1,6 @@
+#!/usr/bin/python -tt
+
+import euca2ools.commands.elasticloadbalancing.configurehealthcheck
+
+if __name__ == '__main__':
+    euca2ools.commands.elasticloadbalancing.configurehealthcheck.ConfigureHealthCheck.run()
diff --git a/euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py b/euca2ools/commands/elasticloadbalancing/configurehealthcheck.py
similarity index 52%
copy from euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py
copy to euca2ools/commands/elasticloadbalancing/configurehealthcheck.py
index 039a846..032e454 100644
--- a/euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py
+++ b/euca2ools/commands/elasticloadbalancing/configurehealthcheck.py
@@ -34,21 +34,32 @@ from requestbuilder import Arg
 from requestbuilder.mixins import TabifyingCommand
 
 
-def instance(inst_as_str):
-    return {'InstanceId': inst_as_str}
-
-
-class RegisterInstancesWithLoadBalancer(ELBRequest, TabifyingCommand):
-    DESCRIPTION = 'Add one or more instances to a load balancer'
+class ConfigureHealthCheck(ELBRequest, TabifyingCommand):
+    DESCRIPTION = ('Configure health checking for instance registerd with a '
+                   'load balancer')
     ARGS = [Arg('LoadBalancerName', metavar='ELB',
                 help='name of the load balancer to modify (required)'),
-            Arg('--instances', dest='Instances.member', required=True,
-                metavar='INSTANCE1,INSTANCE2,...',
-                type=delimited_list(',', item_type=instance),
-                help='''IDs of the instances to register with the load
-                balancer (required)''')]
-    LIST_TAGS = ['Instances']
+            Arg('--healthy-threshold', dest='HealthCheck.HealthyThreshold',
+                metavar='COUNT', type=int, required=True,
+                help='''number of consecutive successful health checks that
+                will mark instances as Healthy (required)'''),
+            Arg('--interval', dest='HealthCheck.Interval', metavar='SECONDS',
+                type=int, required=True,
+                help='approximate interval between health checks (required)'),
+            Arg('-t', '--target', dest='HealthCheck.Target',
+                metavar='PROTOCOL:PORT[/PATH]', required=True,
+                help='connection target for health checks (required)'),
+            Arg('--timeout', dest='HealthCheck.Timeout', metavar='SECONDS',
+                type=int, required=True,
+                help='maximum health check duration (required)'),
+            Arg('--unhealthy-threshold', dest='HealthCheck.UnhealthyThreshold',
+                metavar='COUNT', type=int, required=True,
+                help='''number of consecutive failed health checks that will
+                mark instances as Unhealthy (required)''')]
 
     def print_result(self, result):
-        for instance in result.get('Instances', []):
-            print self.tabify(('INSTANCE', instance.get('InstanceId')))
+        check = result.get('HealthCheck', {})
+        print self.tabify(('HEALTH_CHECK', check.get('Target'),
+                           check.get('Interval'), check.get('Timeout'),
+                           check.get('HealthyThreshold'),
+                           check.get('UnhealthyThreshold')))

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list