amazon ec2 - Python Boto EC2 find instance given its IP address -


using boto in python, how can find boto.ec2 instance object given ip address?

digging through boto documentation, found get_only_instances method, use instances. can pass filter dictionary it, filter ip address (i found in ec2 api reference under filter.n title).

so example, instance ip 1.1.1.1, do:

filters = {"ip-address": "1.1.1.1"} result_list = conn.get_only_instances(filters=filters) 

then result_list[0] should instance object instance ip address.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -