简体   繁体   中英

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM