Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
This page is only for existing customers of the Amazon Glacier service using Vaults and the original REST API from 2012.
If you're looking for archival storage solutions, we recommend using the Amazon Glacier storage classes in Amazon S3, S3 Glacier Instant Retrieval, S3 Glacier Flexible Retrieval, and S3 Glacier Deep Archive. To learn more about these storage options, see Amazon Glacier storage classes.
Amazon Glacier (original standalone vault-based service) will no longer accept new customers starting December 15, 2025, with no impact to existing customers. Amazon Glacier is a standalone service with its own APIs that stores data in vaults and is distinct from Amazon S3 and the Amazon S3 Glacier storage classes. Your existing data will remain secure and accessible in Amazon Glacier indefinitely. No migration is required. For low-cost, long-term archival storage, Amazon recommends the Amazon S3 Glacier storage classes, which deliver a superior customer experience with S3 bucket-based APIs, full Amazon Web Services Region availability, lower costs, and Amazon service integration. If you want enhanced capabilities, consider migrating to Amazon S3 Glacier storage classes by using our Amazon Solutions Guidance for transferring data from Amazon Glacier vaults to Amazon S3 Glacier storage classes.
Use DescribeJob
with an Amazon SDK or CLI
The following code examples show how to use DescribeJob
.
- CLI
-
- Amazon CLI
-
The following command retrieves information about an inventory retrieval job on a vault named my-vault
:
aws glacier describe-
job --account-id - --vault-name my-vault
--job-id zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW
Output:
{
"InventoryRetrievalParameters": {
"Format": "JSON"
},
"VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault",
"Completed": false,
"JobId": "zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW",
"Action": "InventoryRetrieval",
"CreationDate": "2015-07-17T20:23:41.616Z",
"StatusCode": "InProgress"
}
The job ID can be found in the output of aws glacier initiate-job
and aws glacier list-jobs
.
Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: Returns details of the specified job. When the job completes successfully the Read-GCJobOutput cmdlet can be used to retrieve the contents of the job (an archive or inventory list) to the local file system.
Get-GLCJob -VaultName myvault -JobId "op1x...JSbthM"
Output:
Action : ArchiveRetrieval
ArchiveId : o9O9j...X-TpIhQJw
ArchiveSHA256TreeHash : 79f3ea754c02f58...dc57bf4395b
ArchiveSizeInBytes : 38034480
Completed : False
CompletionDate : 1/1/0001 12:00:00 AM
CreationDate : 12/13/2018 11:00:14 AM
InventoryRetrievalParameters :
InventorySizeInBytes : 0
JobDescription :
JobId : op1x...JSbthM
JobOutputPath :
OutputLocation :
RetrievalByteRange : 0-38034479
SelectParameters :
SHA256TreeHash : 79f3ea754c02f58...dc57bf4395b
SNSTopic :
StatusCode : InProgress
StatusMessage :
Tier : Standard
VaultARN : arn:aws:glacier:us-west-2:012345678912:vaults/test
- Tools for PowerShell V5
-
Example 1: Returns details of the specified job. When the job completes successfully the Read-GCJobOutput cmdlet can be used to retrieve the contents of the job (an archive or inventory list) to the local file system.
Get-GLCJob -VaultName myvault -JobId "op1x...JSbthM"
Output:
Action : ArchiveRetrieval
ArchiveId : o9O9j...X-TpIhQJw
ArchiveSHA256TreeHash : 79f3ea754c02f58...dc57bf4395b
ArchiveSizeInBytes : 38034480
Completed : False
CompletionDate : 1/1/0001 12:00:00 AM
CreationDate : 12/13/2018 11:00:14 AM
InventoryRetrievalParameters :
InventorySizeInBytes : 0
JobDescription :
JobId : op1x...JSbthM
JobOutputPath :
OutputLocation :
RetrievalByteRange : 0-38034479
SelectParameters :
SHA256TreeHash : 79f3ea754c02f58...dc57bf4395b
SNSTopic :
StatusCode : InProgress
StatusMessage :
Tier : Standard
VaultARN : arn:aws:glacier:us-west-2:012345678912:vaults/test
- Python
-
- SDK for Python (Boto3)
-
class GlacierWrapper:
"""Encapsulates Amazon S3 Glacier API operations."""
def __init__(self, glacier_resource):
"""
:param glacier_resource: A Boto3 Amazon S3 Glacier resource.
"""
self.glacier_resource = glacier_resource
@staticmethod
def get_job_status(job):
"""
Gets the status of a job.
:param job: The job to query.
:return: The current status of the job.
"""
try:
job.load()
logger.info(
"Job %s is performing action %s and has status %s.",
job.id,
job.action,
job.status_code,
)
except ClientError:
logger.exception("Couldn't get status for job %s.", job.id)
raise
else:
return job.status_code
For a complete list of Amazon SDK developer guides and code examples, see
Using Amazon Glacier with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.