[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:54 UTC 2013
The following commit has been merged in the master branch:
commit 281ab180b7dc1ca593b07aa670398ecfa08c8c58
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Sun Mar 31 18:45:44 2013 -0700
Implement RegisterInstanceWithLoadBalancer
Fixes TOOLS-249
diff --git a/bin/euelb-register-instances-with-lb b/bin/euelb-register-instances-with-lb
new file mode 100755
index 0000000..19aac8e
--- /dev/null
+++ b/bin/euelb-register-instances-with-lb
@@ -0,0 +1,6 @@
+#!/usr/bin/python -tt
+
+import euca2ools.commands.elasticloadbalancing.registerinstanceswithloadbalancer
+
+if __name__ == '__main__':
+ euca2ools.commands.elasticloadbalancing.registerinstanceswithloadbalancer.RegisterInstancesWithLoadBalancer.run()
diff --git a/euca2ools/commands/elasticloadbalancing/attachloadbalancertosubnets.py b/euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py
similarity index 73%
copy from euca2ools/commands/elasticloadbalancing/attachloadbalancertosubnets.py
copy to euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py
index efa8d57..039a846 100644
--- a/euca2ools/commands/elasticloadbalancing/attachloadbalancertosubnets.py
+++ b/euca2ools/commands/elasticloadbalancing/registerinstanceswithloadbalancer.py
@@ -34,15 +34,21 @@ from requestbuilder import Arg
from requestbuilder.mixins import TabifyingCommand
-class AttachLoadBalancerToSubnets(ELBRequest, TabifyingCommand):
- DESCRIPTION = '[VPC only] Add a load balancer to one or more subnets'
+def instance(inst_as_str):
+ return {'InstanceId': inst_as_str}
+
+
+class RegisterInstancesWithLoadBalancer(ELBRequest, TabifyingCommand):
+ DESCRIPTION = 'Add one or more instances to a load balancer'
ARGS = [Arg('LoadBalancerName', metavar='ELB',
help='name of the load balancer to modify (required)'),
- Arg('-s', '--subnets', dest='Subnets.member', required=True,
- metavar='SUBNET1,SUBNET2,...', type=delimited_list(','),
- help='''IDs of the subnets to add the load balancer to
- (required)''')]
- LIST_TAGS = ['Subnets']
+ 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']
def print_result(self, result):
- print self.tabify(('SUBNETS', ','.join(result.get('Subnets', []))))
+ for instance in result.get('Instances', []):
+ print self.tabify(('INSTANCE', instance.get('InstanceId')))
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list