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 !
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With