Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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.
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
:
Synopsis
- data CompleteMultipartUpload = CompleteMultipartUpload' {}
- newCompleteMultipartUpload :: BucketName -> ObjectKey -> Text -> CompleteMultipartUpload
- completeMultipartUpload_requestPayer :: Lens' CompleteMultipartUpload (Maybe RequestPayer)
- completeMultipartUpload_multipartUpload :: Lens' CompleteMultipartUpload (Maybe CompletedMultipartUpload)
- completeMultipartUpload_expectedBucketOwner :: Lens' CompleteMultipartUpload (Maybe Text)
- completeMultipartUpload_bucket :: Lens' CompleteMultipartUpload BucketName
- completeMultipartUpload_key :: Lens' CompleteMultipartUpload ObjectKey
- completeMultipartUpload_uploadId :: Lens' CompleteMultipartUpload Text
- data CompleteMultipartUploadResponse = CompleteMultipartUploadResponse' {
- requestCharged :: Maybe RequestCharged
- eTag :: Maybe ETag
- versionId :: Maybe ObjectVersionId
- location :: Maybe Text
- expiration :: Maybe Text
- bucket :: Maybe BucketName
- bucketKeyEnabled :: Maybe Bool
- key :: Maybe ObjectKey
- sSEKMSKeyId :: Maybe (Sensitive Text)
- serverSideEncryption :: Maybe ServerSideEncryption
- httpStatus :: Int
- newCompleteMultipartUploadResponse :: Int -> CompleteMultipartUploadResponse
- completeMultipartUploadResponse_requestCharged :: Lens' CompleteMultipartUploadResponse (Maybe RequestCharged)
- completeMultipartUploadResponse_eTag :: Lens' CompleteMultipartUploadResponse (Maybe ETag)
- completeMultipartUploadResponse_versionId :: Lens' CompleteMultipartUploadResponse (Maybe ObjectVersionId)
- completeMultipartUploadResponse_location :: Lens' CompleteMultipartUploadResponse (Maybe Text)
- completeMultipartUploadResponse_expiration :: Lens' CompleteMultipartUploadResponse (Maybe Text)
- completeMultipartUploadResponse_bucket :: Lens' CompleteMultipartUploadResponse (Maybe BucketName)
- completeMultipartUploadResponse_bucketKeyEnabled :: Lens' CompleteMultipartUploadResponse (Maybe Bool)
- completeMultipartUploadResponse_key :: Lens' CompleteMultipartUploadResponse (Maybe ObjectKey)
- completeMultipartUploadResponse_sSEKMSKeyId :: Lens' CompleteMultipartUploadResponse (Maybe Text)
- completeMultipartUploadResponse_serverSideEncryption :: Lens' CompleteMultipartUploadResponse (Maybe ServerSideEncryption)
- completeMultipartUploadResponse_httpStatus :: Lens' CompleteMultipartUploadResponse Int
Creating a Request
data CompleteMultipartUpload Source #
See: newCompleteMultipartUpload
smart constructor.
CompleteMultipartUpload' | |
|
Instances
newCompleteMultipartUpload Source #
:: BucketName | |
-> ObjectKey | |
-> Text | |
-> CompleteMultipartUpload |
Create a value of CompleteMultipartUpload
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:requestPayer:CompleteMultipartUpload'
, completeMultipartUpload_requestPayer
- Undocumented member.
$sel:multipartUpload:CompleteMultipartUpload'
, completeMultipartUpload_multipartUpload
- The container for the multipart upload request information.
$sel:expectedBucketOwner:CompleteMultipartUpload'
, completeMultipartUpload_expectedBucketOwner
- The account ID of the expected bucket owner. If the bucket is owned by a
different account, the request will fail with an HTTP
403 (Access Denied)
error.
$sel:bucket:CompleteMultipartUpload'
, completeMultipartUpload_bucket
- Name of the bucket to which the multipart upload was initiated.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.
$sel:key:CompleteMultipartUpload'
, completeMultipartUpload_key
- Object key for which the multipart upload was initiated.
$sel:uploadId:CompleteMultipartUpload'
, completeMultipartUpload_uploadId
- ID for the initiated multipart upload.
Request Lenses
completeMultipartUpload_requestPayer :: Lens' CompleteMultipartUpload (Maybe RequestPayer) Source #
Undocumented member.
completeMultipartUpload_multipartUpload :: Lens' CompleteMultipartUpload (Maybe CompletedMultipartUpload) Source #
The container for the multipart upload request information.
completeMultipartUpload_expectedBucketOwner :: Lens' CompleteMultipartUpload (Maybe Text) Source #
The account ID of the expected bucket owner. If the bucket is owned by a
different account, the request will fail with an HTTP
403 (Access Denied)
error.
completeMultipartUpload_bucket :: Lens' CompleteMultipartUpload BucketName Source #
Name of the bucket to which the multipart upload was initiated.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.
completeMultipartUpload_key :: Lens' CompleteMultipartUpload ObjectKey Source #
Object key for which the multipart upload was initiated.
completeMultipartUpload_uploadId :: Lens' CompleteMultipartUpload Text Source #
ID for the initiated multipart upload.
Destructuring the Response
data CompleteMultipartUploadResponse Source #
See: newCompleteMultipartUploadResponse
smart constructor.
CompleteMultipartUploadResponse' | |
|
Instances
newCompleteMultipartUploadResponse Source #
Create a value of CompleteMultipartUploadResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:requestCharged:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_requestCharged
- Undocumented member.
$sel:eTag:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_eTag
- Entity tag that identifies the newly created object's data. Objects
with different object data will have different entity tags. The entity
tag is an opaque string. The entity tag may or may not be an MD5 digest
of the object data. If the entity tag is not an MD5 digest of the object
data, it will contain one or more nonhexadecimal characters and/or will
consist of less than 32 or more than 32 hexadecimal digits.
$sel:versionId:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_versionId
- Version ID of the newly created object, in case the bucket has
versioning turned on.
$sel:location:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_location
- The URI that identifies the newly created object.
$sel:expiration:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_expiration
- If the object expiration is configured, this will contain the expiration
date (expiry-date) and rule ID (rule-id). The value of rule-id is URL
encoded.
$sel:bucket:CompleteMultipartUpload'
, completeMultipartUploadResponse_bucket
- The name of the bucket that contains the newly created object. Does not
return the access point ARN or access point alias if used.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.
$sel:bucketKeyEnabled:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_bucketKeyEnabled
- Indicates whether the multipart upload uses an S3 Bucket Key for
server-side encryption with Amazon Web Services KMS (SSE-KMS).
$sel:key:CompleteMultipartUpload'
, completeMultipartUploadResponse_key
- The object key of the newly created object.
$sel:sSEKMSKeyId:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_sSEKMSKeyId
- If present, specifies the ID of the Amazon Web Services Key Management
Service (Amazon Web Services KMS) symmetric customer managed key that
was used for the object.
$sel:serverSideEncryption:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_serverSideEncryption
- If you specified server-side encryption either with an Amazon S3-managed
encryption key or an Amazon Web Services KMS key in your initiate
multipart upload request, the response includes this header. It confirms
the encryption algorithm that Amazon S3 used to encrypt the object.
$sel:httpStatus:CompleteMultipartUploadResponse'
, completeMultipartUploadResponse_httpStatus
- The response's http status code.
Response Lenses
completeMultipartUploadResponse_requestCharged :: Lens' CompleteMultipartUploadResponse (Maybe RequestCharged) Source #
Undocumented member.
completeMultipartUploadResponse_eTag :: Lens' CompleteMultipartUploadResponse (Maybe ETag) Source #
Entity tag that identifies the newly created object's data. Objects with different object data will have different entity tags. The entity tag is an opaque string. The entity tag may or may not be an MD5 digest of the object data. If the entity tag is not an MD5 digest of the object data, it will contain one or more nonhexadecimal characters and/or will consist of less than 32 or more than 32 hexadecimal digits.
completeMultipartUploadResponse_versionId :: Lens' CompleteMultipartUploadResponse (Maybe ObjectVersionId) Source #
Version ID of the newly created object, in case the bucket has versioning turned on.
completeMultipartUploadResponse_location :: Lens' CompleteMultipartUploadResponse (Maybe Text) Source #
The URI that identifies the newly created object.
completeMultipartUploadResponse_expiration :: Lens' CompleteMultipartUploadResponse (Maybe Text) Source #
If the object expiration is configured, this will contain the expiration date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded.
completeMultipartUploadResponse_bucket :: Lens' CompleteMultipartUploadResponse (Maybe BucketName) Source #
The name of the bucket that contains the newly created object. Does not return the access point ARN or access point alias if used.
When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.
When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.
completeMultipartUploadResponse_bucketKeyEnabled :: Lens' CompleteMultipartUploadResponse (Maybe Bool) Source #
Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Amazon Web Services KMS (SSE-KMS).
completeMultipartUploadResponse_key :: Lens' CompleteMultipartUploadResponse (Maybe ObjectKey) Source #
The object key of the newly created object.
completeMultipartUploadResponse_sSEKMSKeyId :: Lens' CompleteMultipartUploadResponse (Maybe Text) Source #
If present, specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric customer managed key that was used for the object.
completeMultipartUploadResponse_serverSideEncryption :: Lens' CompleteMultipartUploadResponse (Maybe ServerSideEncryption) Source #
If you specified server-side encryption either with an Amazon S3-managed encryption key or an Amazon Web Services KMS key in your initiate multipart upload request, the response includes this header. It confirms the encryption algorithm that Amazon S3 used to encrypt the object.
completeMultipartUploadResponse_httpStatus :: Lens' CompleteMultipartUploadResponse Int Source #
The response's http status code.