list_parts

Glacier.Client.list_parts(**kwargs)

This operation lists the parts of an archive that have been uploaded in a specific multipart upload. You can make this request at any time during an in-progress multipart upload before you complete the upload (see CompleteMultipartUpload. List Parts returns an error for completed uploads. The list returned in the List Parts response is sorted by part range.

The List Parts operation supports pagination. By default, this operation returns up to 50 uploaded parts in the response. You should always check the response for a marker at which to continue the list; if there are no more items the marker is null . To return a list of parts that begins at a specific part, set the marker request parameter to the value you obtained from a previous List Parts request. You can also limit the number of parts returned in the response by specifying the limit parameter in the request.

An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM).

For conceptual information and the underlying REST API, see Working with Archives in Amazon S3 Glacier and List Parts in the Amazon Glacier Developer Guide .

See also: AWS API Documentation

Request Syntax

response = client.list_parts(
    vaultName='string',
    uploadId='string',
    marker='string',
    limit='string'
)
Parameters
  • accountId (string) --

    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 S3 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.

    Note: this parameter is set to "-" bydefault if no value is not specified.
  • vaultName (string) --

    [REQUIRED]

    The name of the vault.

  • uploadId (string) --

    [REQUIRED]

    The upload ID of the multipart upload.

  • marker (string) -- An opaque string used for pagination. This value specifies the part at which the listing of parts should begin. Get the marker value from the response of a previous List Parts response. You need only include the marker if you are continuing the pagination of results started in a previous List Parts request.
  • limit (string) -- The maximum number of parts to be returned. The default limit is 50. The number of parts returned might be fewer than the specified limit, but the number of returned parts never exceeds the limit.
Return type

dict

Returns

Response Syntax

{
    'MultipartUploadId': 'string',
    'VaultARN': 'string',
    'ArchiveDescription': 'string',
    'PartSizeInBytes': 123,
    'CreationDate': 'string',
    'Parts': [
        {
            'RangeInBytes': 'string',
            'SHA256TreeHash': 'string'
        },
    ],
    'Marker': 'string'
}

Response Structure

  • (dict) --

    Contains the Amazon S3 Glacier response to your request.

    • MultipartUploadId (string) --

      The ID of the upload to which the parts are associated.

    • VaultARN (string) --

      The Amazon Resource Name (ARN) of the vault to which the multipart upload was initiated.

    • ArchiveDescription (string) --

      The description of the archive that was specified in the Initiate Multipart Upload request.

    • PartSizeInBytes (integer) --

      The part size in bytes. This is the same value that you specified in the Initiate Multipart Upload request.

    • CreationDate (string) --

      The UTC time at which the multipart upload was initiated.

    • Parts (list) --

      A list of the part sizes of the multipart upload. Each object in the array contains a RangeBytes and sha256-tree-hash name/value pair.

      • (dict) --

        A list of the part sizes of the multipart upload.

        • RangeInBytes (string) --

          The byte range of a part, inclusive of the upper value of the range.

        • SHA256TreeHash (string) --

          The SHA256 tree hash value that Amazon S3 Glacier calculated for the part. This field is never null .

    • Marker (string) --

      An opaque string that represents where to continue pagination of the results. You use the marker in a new List Parts request to obtain more jobs in the list. If there are no more parts, this value is null .

Exceptions

  • Glacier.Client.exceptions.ResourceNotFoundException
  • Glacier.Client.exceptions.InvalidParameterValueException
  • Glacier.Client.exceptions.MissingParameterValueException
  • Glacier.Client.exceptions.ServiceUnavailableException

Examples

The example lists all the parts of a multipart upload.

response = client.list_parts(
    accountId='-',
    uploadId='OW2fM5iVylEpFEMM9_HpKowRapC3vn5sSL39_396UW9zLFUWVrnRHaPjUJddQ5OxSHVXjYtrN47NBZ-khxOjyEXAMPLE',
    vaultName='examplevault',
)

print(response)

Expected Output:

{
    'ArchiveDescription': 'archive description',
    'CreationDate': '2012-03-20T17:03:43.221Z',
    'Marker': 'null',
    'MultipartUploadId': 'OW2fM5iVylEpFEMM9_HpKowRapC3vn5sSL39_396UW9zLFUWVrnRHaPjUJddQ5OxSHVXjYtrN47NBZ-khxOjyEXAMPLE',
    'PartSizeInBytes': 4194304,
    'Parts': [
        {
            'RangeInBytes': '0-4194303',
            'SHA256TreeHash': '01d34dabf7be316472c93b1ef80721f5d4',
        },
        {
            'RangeInBytes': '4194304-8388607',
            'SHA256TreeHash': '0195875365afda349fc21c84c099987164',
        },
    ],
    'VaultARN': 'arn:aws:glacier:us-west-2:012345678901:vaults/demo1-vault',
    'ResponseMetadata': {
        '...': '...',
    },
}