If I call describeSnapshots() of AmazonEC2 Java interface I get a big number of snapshots as described in the documentation, because it includes all visible snapshots.
However to get the list of my snapshots, should be easy with the API, but it isn’t obvious to me. I tried to pass a DescribeSnapshotsRequests object to describeSnapshots()
DescribeSnapshotsRequest req = new DescribeSnapShotRequests();
List<String> ownerId = new ArrayList<String>();
ownerId.add("....");
req.setOwnerIds(ownerId);
DescribeSnapshotsResult res = ec2.describeSnapshots(req);
However to get my user id, I printed the user id of all snapshots and manually identified mine, copied that user id, and used in the source code.
I hope there is a better way to list my snapshots, anyone knows?
Try this
Something like this works for me to describe images.