diff options
author | Thomas Parslow <tom@almostobsolete.net> | 2012-09-12 04:07:12 -0700 |
---|---|---|
committer | Thomas Parslow <tom@almostobsolete.net> | 2012-09-12 04:07:12 -0700 |
commit | 63040e64deee53a024a76c1c4eb14ef709de60b0 (patch) | |
tree | ff2004533399d8024223fd667551ec27225967d3 | |
parent | acf17b8f391dc4803487146517e80af246da8174 (diff) | |
parent | 75c474aacc0fba1a35c2a7696aa6d45f6d424dfb (diff) | |
download | boto-63040e64deee53a024a76c1c4eb14ef709de60b0.tar.gz |
Merge pull request #1 from yamatt/glacier
Added retreive-inventory function
-rw-r--r-- | boto/glacier/vault.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/boto/glacier/vault.py b/boto/glacier/vault.py index a10ac241..037379e7 100644 --- a/boto/glacier/vault.py +++ b/boto/glacier/vault.py @@ -172,6 +172,34 @@ class Vault(object): response = self.layer1.initiate_job(self.name, job_data) return response['JobId'] + + def retrieve_inventory(self, sns_topic=None, + description=None): + """ + Initiate a inventory retrieval job to list the items in the + vault. You will need to wait for the notification from + Amazon (via SNS) before you can actually download the data, + this takes around 4 hours. + + :type description: str + :param description: An optional description for the job. + + :type sns_topic: str + :param sns_topic: The Amazon SNS topic ARN where Amazon Glacier + sends notification when the job is completed and the output + is ready for you to download. + + :rtype: :class:`boto.glacier.job.Job` + :return: A Job object representing the retrieval job. + """ + job_data = {'Type': 'inventory-retrieval'} + if sns_topic is not None: + job_data['SNSTopic'] = sns_topic + if description is not None: + job_data['Description'] = description + + response = self.layer1.initiate_job(self.name, job_data) + return response['JobId'] def delete_archive(self, archive_id): """ |