Created
December 7, 2011 16:52
-
-
Save garnaat/1443559 to your computer and use it in GitHub Desktop.
Using get_all_instance_status method in boto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import boto | |
>>> ec2 = boto.connect_ec2() | |
>>> stats = ec2.get_all_instance_status() | |
>>> stats | |
[InstanceStatus:i-67c81e0c] | |
>>> stat = stats[0] | |
>>> stat | |
InstanceStatus:i-67c81e0c | |
>>> stat.id | |
u'i-67c81e0c' | |
>>> stat.zone | |
u'us-east-1b' | |
>>> stat.state_code | |
16 | |
>>> stat.state_name | |
u'running' | |
>>> stat.events | |
[Event:instance-reboot] | |
>>> event = stat.events[0] | |
>>> event.code | |
u'instance-reboot' | |
>>> event.description | |
u'Maintenance software update.' | |
>>> event.not_before | |
u'2011-12-11T04:00:00.000Z' | |
>>> event.not_after | |
u'2011-12-11T10:00:00.000Z' | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment