You are using the deregister () API.
There are several ways to get the image ID (i.e. you can list all the images and search for their properties, etc.)
Here is a piece of code that will remove one of your existing AMIs (assuming it is in the EU region).
connection = boto.ec2.connect_to_region('eu-west-1', \ aws_access_key_id='yourkey', \ aws_secret_access_key='yoursecret', \ proxy=yourProxy, \ proxy_port=yourProxyPort)
(edit): and actually looking at the online documentation for 2.0, there is another way.
After defining the image id, you can use the deregister_image (image_id) method for boto.ec2.connection ... which is the same as what I think.
liamf source share