Amazon Glacier
Developer Guide (API Version 2012-06-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Using the AWS SDKs with Amazon Glacier

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

Note

Amazon Glacier is supported by the AWS SDKs for Java, .NET, PHP, and Python (Boto). Examples of working with Amazon Glacier using the Java and .NET SDKs are provided throughout this developer guide. For more information on the AWS SDKs, see Sample Code & Libraries.

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 Amazon Glacier) supported by Amazon Glacier. For each Amazon 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 Amazon Glacier response. The low-level wrapper libraries are the most complete implementation of the underlying Amazon Glacier operations.

For information about these SDK libraries, see Using the AWS SDK for Java with Amazon Glacier and Using the AWS SDK for .NET with Amazon 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 you will 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 will need to write additional code to set up an Amazon Simple Notification Service (Amazon SNS) topic for Amazon 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 Glacier and Using the AWS SDK for .NET with Amazon Glacier.

When to Use 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.