Amazon S3 Glacier
Developer Guide (API Version 2012-06-01)

Using the AWS SDKs with Amazon S3 Glacier

Amazon Web Services provides SDKs for you to develop applications for Amazon S3 Glacier (Glacier). The SDK libraries wrap the underlying Glacier API, simplifying your programming tasks. For example, for each request sent to Glacier, you must include a signature to authenticate your requests. When you use the SDK libraries, you need to provide only your AWS security credentials in your code and the libraries compute the necessary signature and include it in the request sent to Glacier. The AWS SDKs provide libraries that map to the underlying REST API and provide objects that you can use to easily construct requests and process responses.

AWS SDKs that Support Glacier

Glacier is supported by the following AWS SDKs:

You can find examples of working with Glacier using the Java and .NET SDKs throughout this developer guide. For libraries and sample code in all languages, see Sample Code & Libraries.

The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services, including Glacier. For information about downloading the AWS CLI, see AWS Command Line Interface. For a list of the Glacier CLI commands, see AWS CLI Command Reference.

AWS SDK Libraries for Java and .NET

The AWS SDKs for Java and .NET offer high-level and low-level wrapper libraries.

What Is the Low-Level API?

The low-level wrapper libraries map closely the underlying REST API (API Reference for Glacier) supported by Glacier. For each Glacier REST operations, the low-level API provides a corresponding method, a request object for you to provide request information and a response object for you to process Glacier response. The low-level wrapper libraries are the most complete implementation of the underlying Glacier operations.

For information about these SDK libraries, see Using the AWS SDK for Java with Amazon S3 Glacier and Using the AWS SDK for .NET with Amazon S3 Glacier.

What Is the High-Level API?

To further simplify application development, these libraries offer a higher-level abstraction for some of the operations. For example,

  • Uploading an archive—To upload an archive using the low-level API in addition to the file name and the vault name where you want to save the archive, You need to provide a checksum (SHA-256 tree hash) of the payload. However, the high-level API computes the checksum for you.

  • Downloading an archive or vault inventory—To download an archive using the low-level API you first initiate a job, wait for the job to complete, and then get the job output. You need to write additional code to set up an Amazon Simple Notification Service (Amazon SNS) topic for Glacier to notify you when the job is complete. You also need some polling mechanism to check if a job completion message was posted to the topic. The high-level API provides a method to download an archive that takes care of all these steps. You only specify an archive ID and a folder path where you want to save the downloaded data.

For information about these SDK libraries, see Using the AWS SDK for Java with Amazon S3 Glacier and Using the AWS SDK for .NET with Amazon S3 Glacier.

When to Use the High-Level and Low-Level API

In general, if the high-level API provides methods you need to perform an operation, you should use the high-level API because of the simplicity it provides. However, if the high-level API does not offer the functionality, you can use the low-level API. Additionally, the low-level API allows granular control of the operation such as retry logic in the event of a failure. For example, when uploading an archive the high-level API uses the file size to determine whether to upload the archive in a single operation or use the multipart upload API. The API also has built-in retry logic in case an upload fails. However, your application might need granular control over these decisions, in which case you can use the low-level API.