Index: boto/ec2/autoscale/scheduled.py |
diff --git a/boto/ec2/autoscale/instance.py b/boto/ec2/autoscale/scheduled.py |
similarity index 57% |
copy from boto/ec2/autoscale/instance.py |
copy to boto/ec2/autoscale/scheduled.py |
index ffdd5b18e786881dda981a743b1f3de6bfbca5bd..d8f051c19a1cb9cb6110d7a3afd191ba0110beeb 100644 |
--- a/boto/ec2/autoscale/instance.py |
+++ b/boto/ec2/autoscale/scheduled.py |
@@ -1,4 +1,4 @@ |
-# Copyright (c) 2009 Reza Lotun http://reza.lotun.name/ |
+# Copyright (c) 2009-2010 Reza Lotun http://reza.lotun.name/ |
# |
# Permission is hereby granted, free of charge, to any person obtaining a |
# copy of this software and associated documentation files (the |
@@ -20,27 +20,41 @@ |
# IN THE SOFTWARE. |
-class Instance(object): |
+from datetime import datetime |
+ |
+ |
+class ScheduledUpdateGroupAction(object): |
def __init__(self, connection=None): |
self.connection = connection |
- self.instance_id = '' |
- self.lifecycle_state = None |
- self.availability_zone = '' |
+ self.name = None |
+ self.action_arn = None |
+ self.time = None |
+ self.desired_capacity = None |
+ self.max_size = None |
+ self.min_size = None |
def __repr__(self): |
- return 'Instance:%s' % self.instance_id |
+ return 'ScheduledUpdateGroupAction:%s' % self.name |
def startElement(self, name, attrs, connection): |
return None |
def endElement(self, name, value, connection): |
- if name == 'InstanceId': |
- self.instance_id = value |
- elif name == 'LifecycleState': |
- self.lifecycle_state = value |
- elif name == 'AvailabilityZone': |
- self.availability_zone = value |
+ if name == 'DesiredCapacity': |
+ self.desired_capacity = value |
+ elif name == 'ScheduledActionName': |
+ self.name = value |
+ elif name == 'MaxSize': |
+ self.max_size = int(value) |
+ elif name == 'MinSize': |
+ self.min_size = int(value) |
+ elif name == 'ScheduledActionARN': |
+ self.action_arn = value |
+ elif name == 'Time': |
+ try: |
+ self.time = datetime.strptime(value, '%Y-%m-%dT%H:%M:%S.%fZ') |
+ except ValueError: |
+ self.time = datetime.strptime(value, '%Y-%m-%dT%H:%M:%SZ') |
else: |
setattr(self, name, value) |
- |