Upload Archive (POST archive)

Description

This operation adds an archive to a vault. For a successful upload, your data is durably
persisted. In response, Amazon Glacier returns the archive ID in the
x-amz-archive-id header of the response. You should save the archive ID
returned so that you can access the archive later.

You must provide a SHA256 tree hash of the data you are uploading. For information
about
computing a SHA256 tree hash, see Computing Checksums.

When uploading an archive, you can optionally specify an archive description of up
to 1,024
printable ASCII characters. Amazon Glacier returns the archive description when
you
either retrieve the archive or get the vault inventory. Amazon Glacier does not
interpret the
description in any way. An archive description does not need to be unique. You
cannot
use the description to retrieve or sort the archive list.

Except for the optional archive description, Amazon Glacier does not support any
additional metadata for the archives. The archive ID is an opaque sequence of characters
from which you cannot infer any meaning about the archive. So you might maintain
metadata about the archives on the client-side. For more information, see
Working with Archives in Amazon Glacier.

Archives are immutable. After you upload an archive, you cannot edit the archive or
its
description.

Requests

To upload an archive, you use the HTTP POST method and scope the request to the
archives subresource of the vault in which you want to save the
archive. The request must include the archive payload size, checksum (SHA256 tree
hash),
and can optionally include a description of the archive.

The AccountId value is the AWS account ID of the account that owns the vault. You can either specify
an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the
credentials used to sign the request. If you use an account ID, do not include any
hyphens ('-') in the ID.

Request Parameters

This implementation of the operation does not use request parameters.

Request Headers

This operation uses the following request headers, in addition to the request headers
that are common to all operations.
For more information about the common request headers, see
Common Request Headers.

The optional description of the archive you are uploading. It can be a plain language
description or some identifier you choose to assign. The
description need not be unique across archives. When you
retrieve a vault inventory (see Initiate Job (POST jobs)), it includes
this description for each of the archives it returns in
response.

Type: String

Default: None

Constraints: The description must be less than or equal to 1,024 characters. The
allowable characters are 7-bit ASCII without control codes,
specifically ASCII values 32—126 decimal or
0x20—0x7E hexadecimal.

No

x-amz-content-sha256

The SHA256 checksum (a linear hash) of the payload. This is not the same value as
you
specify in the x-amz-sha256-tree-hash
header.

Type: String

Default: None

Constraints: None

Yes

x-amz-sha256-tree-hash

The user-computed checksum, SHA256 tree hash, of the payload. For information on
computing the SHA256 tree hash, see Computing Checksums. If Amazon Glacier
computes a different checksum of the payload, it will reject
the request.

Type: String

Default: None

Constraints: None

Yes

Request Body

The request body contains the data to upload.

Responses

In response, Amazon Glacier durably stores the archive and returns a URI path to
the
archive ID.

Syntax

Response Headers

A successful response includes the following response headers, in addition to the
response headers that are common to all operations. For more information about common
response headers, see
Common Response Headers.

Name

Description

Location

The relative URI path of the newly added archive resource.

Type: String

x-amz-archive-id

The ID of the archive. This value is also included as part
of the Location header.

Type: String

x-amz-sha256-tree-hash​

The checksum of the archive computed by Amazon Glacier.

Type: String

Response Body

This operation does not return a response body.

Errors

For information about Amazon Glacier
exceptions and error messages, see Error Responses.