nova/vendor/boto/bin/list_instances
2010-05-27 23:05:26 -07:00

11 lines
336 B
Python
Executable File

#!/usr/bin/env python
import boto
ec2 = boto.connect_ec2()
print "%-15s %-15s %-30s %s" % ("ID", 'Zone', "Groups", "Hostname")
print "-"*105
for r in ec2.get_all_instances():
groups = [g.id for g in r.groups]
for i in r.instances:
print "%-15s %-15s %-30s %s" % (i.id, i.placement, ','.join(groups), i.public_dns_name)