Cmag
Cmag

Reputation: 15760

aws + boto list of eips

Having a problem using boto to list any Elastic IPs. So far, have been pretty successful in getting back a list of instances, and performing certain operations with them. However, not really sure how to get a list/dictionary back of all eips allocated...

I see the following object: cl = botoEC2.get_all_addresses, which does not seem to return much interesting.

Any help would be greatly appreciated

Thanks!

Upvotes: 1

Views: 1669

Answers (1)

aychedee
aychedee

Reputation: 25579

get_all_addresses works for me. It returns a list of address objects which have various methods and attributes.

addrs = conn.get_all_addresses()
for a in addrs:
    print a.public_ip

Prints out all the eips, associated and not associated, that I have on my account.

When I'm trying to figure out the AWS api I always fire up an IPython shell and put their tab completion to good use. It's great for finding your way around.

Upvotes: 5

Related Questions