Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add archive retrival type #195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions glacier/GlacierWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ def upload(self, vault_name, file_name, description, region,
@glacier_connect
@log_class_call("Processing archive retrieval job.",
"Archive retrieval job response received.")
def getarchive(self, vault_name, archive_id):
def getarchive(self, vault_name, archive_id, type):
"""
Requests Amazon Glacier to make archive available for download.

Expand Down Expand Up @@ -1290,7 +1290,8 @@ def getarchive(self, vault_name, archive_id):

# No job found related to this archive, start a new job.
job_data = {'ArchiveId': archive_id,
'Type': 'archive-retrieval'}
'Type': 'archive-retrieval',
'Tier': type}
try:
response = self.glacierconn.initiate_job(vault_name, job_data)
except boto.glacier.exceptions.UnexpectedHTTPResponseError as e:
Expand Down
4 changes: 3 additions & 1 deletion glacier/glacier.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def getarchive(args):
Initiate an archive retrieval job.
"""
glacier = default_glacier_wrapper(args)
status, job, jobid = glacier.getarchive(args.vault, args.archive)
status, job, jobid = glacier.getarchive(args.vault, args.archive, args.type)
output_headers(job, args.output)

@handle_errors
Expand Down Expand Up @@ -774,6 +774,8 @@ def main():
help='The vault the archive is stored in.')
parser_getarchive.add_argument('archive',
help='The archive id.')
parser_getarchive.add_argument('type', default="Standard",
help='The archive retrieval type.')
parser_getarchive.set_defaults(func=getarchive)

# glacier-cmd download <vault> <archive> [--outfile <file name>]
Expand Down