Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boto AWS Glacier - Retrieve archive

I'm actually using python boto to store data on my glacier's vault and launch retrieve jov and inventory job.

This works quite well.

But i didn't find any example about the method to use to download an archive from glacier?

I had launch retrieve jov and inventory job and got request id 4 hours later etc, but howto grab my archive by using boto ?

Thanks for your help !

like image 323
Peter Stew Avatar asked Nov 28 '12 08:11

Peter Stew


People also ask

How do I recover data from S3 Glacier vault?

You can retrieve a vault inventory from S3 Glacier with the following two-step process: Initiate an inventory retrieval job by using the Initiate Job (POST jobs) operation. A data retrieval policy can cause your initiate retrieval job request to fail with a PolicyEnforcedException exception.

How do I find my AWS Glacier archive ID?

Finding an Archive ID in Amazon S3 Glacier You can get the archive ID by downloading the vault inventory for the vault that contains the archive. For more information about downloading the vault inventory, see Downloading a Vault Inventory in Amazon S3 Glacier.

What are the three data retrieval options for Amazon Glacier?

S3 Glacier Flexible Retrieval provides three retrieval options: expedited retrievals that typically complete in 1–5 minutes, standard retrievals that typically complete in 3–5 hours, and free bulk retrievals that return large amounts of data typically in 5–12 hours.


1 Answers

To retrieve your inventory, you could do something like this:

import boto.glacier

c = boto.glacier.connect_to_region('us-east-1')
vault = c.get_vault('myvault')
job = vault.get_job('<your job id>')
response = job.get_output()
print response.read()

It's a bit confusing because the call to get_output() returns a dict-like object but that object has a read method that you can use to retrieve the data associated with the response.

like image 54
garnaat Avatar answered Sep 24 '22 13:09

garnaat