samedi 25 juillet 2015

Boto finding out when to use restore() to restore object from Glacier back to S3

I have configured a life cycle policy on a bucket. Some objects are stored in S3, some are in Glacier. I am now trying to restore all objects from that bucket to local disk.

Using bucket.list() I get the list of objects. Objects that are in Glacier have storage class 'GLACIER' so I can call restore() for those. So far so good..

But.. the class is not an indication of whether the object needs to restored! According to http://ift.tt/1OEgvtx objects that are restored back from Glacier to S3 keep the storage class 'GLACIER'. So I can not use that to find out if a restore needs to be done or not. A restored object still has class GLACIER.

My question: how do I find out which objects are in Glacier only, and hence need to be restored() first. Currently in case of storage class 'GLACIER' I try get_contents_to_filename() first, if that fails I call restore().. but that does not feel right.




Aucun commentaire:

Enregistrer un commentaire