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 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 Amazon 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 Amazon Glacier
Amazon Glacier is supported by the following AWS SDKs:
The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services, including Amazon Glacier. For information about downloading the AWS CLI, see AWS Command Line Interface. For a list of the Amazon 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 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.
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 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.
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.