describe images

20 views
Skip to first unread message

project2501

unread,
Jun 11, 2011, 1:10:50 PM6/11/11
to typica
Hi,
I want to describe the images owned by me. How is this possible? I
couldn't see how.
The API allows to set the owner, but my Jec2() instance already is
made from my keys,
so how can I get only my private AMI's?

thanks,
Darren

PS. Also, there is a bug when listing server instances belonging to
new instance types. NPE.

David Kavanagh

unread,
Jun 11, 2011, 5:21:00 PM6/11/11
to typ...@googlegroups.com
Darren,
You can call "describeImagesByOwner". Something like this;

List<String> params = new ArrayList<String>();
params.add("365812321051");
List<ImageDescription> images = ec2.describeImagesByOwner(params);
logger.info("Available Images");
for (ImageDescription img : images) {
if (img.getImageState().equals("available")) {
logger.info(img.getImageId()+"\t"+img.getImageLocation()+"\t"+img.getImageOwnerId());
}
}

David


--
You received this message because you are subscribed to the Google Groups "typica" group.
To post to this group, send email to typ...@googlegroups.com.
To unsubscribe from this group, send email to typica+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/typica?hl=en.


project2501

unread,
Jun 12, 2011, 1:11:50 PM6/12/11
to typica
Hi David,
Thanks for the reply. How can I get the current owner though?
I run my application from a AMI itself and input the keys at runtime.
So the code needs to know how to get the owner of the keys.

I couldn't see how to do that.

Thanks for a great API!

Darren
Reply all
Reply to author
Forward
0 new messages