completeΒΆ

complete(**kwargs)

Completes a multipart upload by assembling previously uploaded parts.

You first initiate the multipart upload and then upload all parts using the UploadPart operation. After successfully uploading all relevant parts of an upload, you call this action to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts in ascending order by part number to create a new object. In the Complete Multipart Upload request, you must provide the parts list. You must ensure that the parts list is complete. This action concatenates the parts that you provide in the list. For each part in the list, you must provide the part number and the ETag value, returned after that part was uploaded.

Processing of a Complete Multipart Upload request could take several minutes to complete. After Amazon S3 begins processing the request, it sends an HTTP response header that specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white space characters to keep the connection from timing out. Because a request could fail after the initial 200 OK response has been sent, it is important that you check the response body to determine whether the request succeeded.

Note that if CompleteMultipartUpload fails, applications should be prepared to retry the failed requests. For more information, see Amazon S3 Error Best Practices.

Warning

You cannot use Content-Type: application/x-www-form-urlencoded with Complete Multipart Upload requests. Also, if you do not provide a Content-Type header, CompleteMultipartUpload returns a 200 OK response.

For more information about multipart uploads, see Uploading Objects Using Multipart Upload.

For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions.

CompleteMultipartUpload has the following special errors:
  • Error code: EntityTooSmall
    • Description: Your proposed upload is smaller than the minimum allowed object size. Each part must be at least 5 MB in size, except the last part.
    • 400 Bad Request
  • Error code: InvalidPart
    • Description: One or more of the specified parts could not be found. The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag.
    • 400 Bad Request
  • Error code: InvalidPartOrder
    • Description: The list of parts was not in ascending order. The parts list must be specified in order by part number.
    • 400 Bad Request
  • Error code: NoSuchUpload
    • Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.
    • 404 Not Found

The following operations are related to CompleteMultipartUpload :

See also: AWS API Documentation

Request Syntax

object = multipart_upload.complete(
    MultipartUpload={
        'Parts': [
            {
                'ETag': 'string',
                'ChecksumCRC32': 'string',
                'ChecksumCRC32C': 'string',
                'ChecksumSHA1': 'string',
                'ChecksumSHA256': 'string',
                'PartNumber': 123
            },
        ]
    },
    ChecksumCRC32='string',
    ChecksumCRC32C='string',
    ChecksumSHA1='string',
    ChecksumSHA256='string',
    RequestPayer='requester',
    ExpectedBucketOwner='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey='string',

)
Parameters
  • MultipartUpload (dict) --

    The container for the multipart upload request information.

    • Parts (list) --

      Array of CompletedPart data types.

      If you do not supply a valid Part with your request, the service sends back an HTTP 400 response.

      • (dict) --

        Details of the parts that were uploaded.

        • ETag (string) --

          Entity tag returned when the part was uploaded.

        • ChecksumCRC32 (string) --

          The base64-encoded, 32-bit CRC32 checksum of the object. This will only be present if it was uploaded with the object. With multipart uploads, this may not be a checksum value of the object. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide .

        • ChecksumCRC32C (string) --

          The base64-encoded, 32-bit CRC32C checksum of the object. This will only be present if it was uploaded with the object. With multipart uploads, this may not be a checksum value of the object. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide .

        • ChecksumSHA1 (string) --

          The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. With multipart uploads, this may not be a checksum value of the object. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide .

        • ChecksumSHA256 (string) --

          The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the object. With multipart uploads, this may not be a checksum value of the object. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide .

        • PartNumber (integer) --

          Part number that identifies the part. This is a positive integer between 1 and 10,000.

  • ChecksumCRC32 (string) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32 checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide .
  • ChecksumCRC32C (string) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 32-bit CRC32C checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide .
  • ChecksumSHA1 (string) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide .
  • ChecksumSHA256 (string) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide .
  • RequestPayer (string) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide .
  • ExpectedBucketOwner (string) -- The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).
  • SSECustomerAlgorithm (string) -- The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide .
  • SSECustomerKey (string) -- The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide .
  • SSECustomerKeyMD5 (string) --

    The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide .

    Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required
Return type

s3.Object

Returns

Object resource