Permalink
Browse files

autoscale updated to the lateste api version

  • Loading branch information...
rgaiser committed Feb 25, 2011
1 parent 2666023 commit abd84fe6343b7606f7b3f3aaf62db6dff0b27246
Showing with 9 additions and 24 deletions.
  1. +0 −1 boto/ec2/autoscale/__init__.py
  2. +3 −23 boto/ec2/autoscale/group.py
  3. +6 −0 boto/ec2/autoscale/instance.py
@@ -73,7 +73,6 @@ def connect_to_region(region_name, **kw_params):
class AutoScaleConnection(AWSQueryConnection):
APIVersion = boto.config.get('Boto', 'autoscale_version', '2010-08-01')
-# APIVersion = boto.config.get('Boto', 'autoscale_version', '2009-05-15')
Endpoint = boto.config.get('Boto', 'autoscale_endpoint',
'autoscaling.amazonaws.com')
DefaultRegionName = 'us-east-1'
@@ -24,24 +24,7 @@
from boto.resultset import ResultSet
from boto.ec2.autoscale.trigger import Trigger
from boto.ec2.autoscale.request import Request
-
-
-class Instance(object):
- def __init__(self, connection=None):
- self.connection = connection
- self.instance_id = ''
-
- def __repr__(self):
- return 'Instance:%s' % self.instance_id
-
- def startElement(self, name, attrs, connection):
- return None
-
- def endElement(self, name, value, connection):
- if name == 'InstanceId':
- self.instance_id = value
- else:
- setattr(self, name, value)
+from boto.ec2.autoscale.instance import Instance
class AutoScalingGroup(object):
@@ -122,8 +105,6 @@ def __repr__(self):
return 'AutoScalingGroup:%s' % self.name
def startElement(self, name, attrs, connection):
- print '-' *50
- print 'Start %s' % name
if name == 'Instances':
self.instances = ResultSet([('member', Instance)])
return self.instances
@@ -138,7 +119,6 @@ def startElement(self, name, attrs, connection):
return
def endElement(self, name, value, connection):
- print 'End %s %s' % (name,value)
if name == 'MinSize':
self.min_size = value
elif name == 'CreatedTime':
@@ -220,7 +200,7 @@ class AutoScalingGroupMetric(object):
def __init__(self, connection=None):
self.connection = connection
- self.metric = None
+ self.name = None
self.granularity = None
def __repr__(self):
@@ -231,7 +211,7 @@ def startElement(self, name, attrs, connection):
def endElement(self, name, value, connection):
if name == 'Metric':
- self.metric = value
+ self.name = value
elif name == 'Granularity':
self.granularity = value
else:
@@ -25,6 +25,8 @@ def __init__(self, connection=None):
self.connection = connection
self.instance_id = ''
self.lifecycle_state = None
+ self.health_status = None
+ self.launch_config= None
self.availability_zone = ''
def __repr__(self):
@@ -40,6 +42,10 @@ def endElement(self, name, value, connection):
self.lifecycle_state = value
elif name == 'AvailabilityZone':
self.availability_zone = value
+ elif name == 'HealthStatus':
+ self.health_status = value
+ elif name == 'LaunchConfigurationName':
+ self.launch_config = value
else:
setattr(self, name, value)

0 comments on commit abd84fe

Please sign in to comment.