Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This action enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this action provides a suitable alternative to sending individual delete requests, reducing per-request overhead.
The request contains a list of up to 1000 keys that you want to delete. In the XML, you provide the object key names, and optionally, version IDs if you want to delete a specific version of the object from a versioning-enabled bucket. For each key, Amazon S3 performs a delete action and returns the result of that delete, success, or failure, in the response. Note that if the object specified in the request is not found, Amazon S3 returns the result as deleted.
The action supports two modes for the response: verbose and quiet. By default, the action uses verbose mode in which the response includes the result of deletion of each key in your request. In quiet mode the response includes only keys where the delete action encountered an error. For a successful deletion, the action does not return any information about the delete in the response body.
When performing this action on an MFA Delete enabled bucket, that attempts to delete any versioned objects, you must include an MFA token. If you do not provide one, the entire request will fail, even if there are non-versioned objects you are trying to delete. If you provide an invalid token, whether there are versioned keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete.
Finally, the Content-MD5 header is required for all Multi-Object Delete requests. Amazon S3 uses the header value to ensure that your request body has not been altered in transit.
The following operations are related to DeleteObjects
:
Synopsis
- data DeleteObjects = DeleteObjects' {}
- newDeleteObjects :: BucketName -> Delete -> DeleteObjects
- deleteObjects_bypassGovernanceRetention :: Lens' DeleteObjects (Maybe Bool)
- deleteObjects_checksumAlgorithm :: Lens' DeleteObjects (Maybe ChecksumAlgorithm)
- deleteObjects_expectedBucketOwner :: Lens' DeleteObjects (Maybe Text)
- deleteObjects_mfa :: Lens' DeleteObjects (Maybe Text)
- deleteObjects_requestPayer :: Lens' DeleteObjects (Maybe RequestPayer)
- deleteObjects_bucket :: Lens' DeleteObjects BucketName
- deleteObjects_delete :: Lens' DeleteObjects Delete
- data DeleteObjectsResponse = DeleteObjectsResponse' {}
- newDeleteObjectsResponse :: Int -> DeleteObjectsResponse
- deleteObjectsResponse_deleted :: Lens' DeleteObjectsResponse (Maybe [DeletedObject])
- deleteObjectsResponse_errors :: Lens' DeleteObjectsResponse (Maybe [S3ServiceError])
- deleteObjectsResponse_requestCharged :: Lens' DeleteObjectsResponse (Maybe RequestCharged)
- deleteObjectsResponse_httpStatus :: Lens' DeleteObjectsResponse Int
Creating a Request
data DeleteObjects Source #
See: newDeleteObjects
smart constructor.
DeleteObjects' | |
|
Instances
Create a value of DeleteObjects
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:bypassGovernanceRetention:DeleteObjects'
, deleteObjects_bypassGovernanceRetention
- Specifies whether you want to delete this object even if it has a
Governance-type Object Lock in place. To use this header, you must have
the s3:BypassGovernanceRetention
permission.
DeleteObjects
, deleteObjects_checksumAlgorithm
- Indicates the algorithm used to create the checksum for the object when
using the SDK. This header will not provide any additional functionality
if not using the SDK. When sending this header, there must be a
corresponding x-amz-checksum
or x-amz-trailer
header sent.
Otherwise, Amazon S3 fails the request with the HTTP status code
400 Bad Request
. For more information, see
Checking object integrity
in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided
ChecksumAlgorithm
parameter.
This checksum algorithm must be the same for all parts and it match the
checksum value supplied in the CreateMultipartUpload
request.
$sel:expectedBucketOwner:DeleteObjects'
, deleteObjects_expectedBucketOwner
- 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).
$sel:mfa:DeleteObjects'
, deleteObjects_mfa
- The concatenation of the authentication device's serial number, a
space, and the value that is displayed on your authentication device.
Required to permanently delete a versioned object if versioning is
configured with MFA delete enabled.
$sel:requestPayer:DeleteObjects'
, deleteObjects_requestPayer
- Undocumented member.
DeleteObjects
, deleteObjects_bucket
- The bucket name containing the objects to delete.
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 with 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 Amazon S3 on Outposts
in the Amazon S3 User Guide.
$sel:delete':DeleteObjects'
, deleteObjects_delete
- Container for the request.
Request Lenses
deleteObjects_bypassGovernanceRetention :: Lens' DeleteObjects (Maybe Bool) Source #
Specifies whether you want to delete this object even if it has a
Governance-type Object Lock in place. To use this header, you must have
the s3:BypassGovernanceRetention
permission.
deleteObjects_checksumAlgorithm :: Lens' DeleteObjects (Maybe ChecksumAlgorithm) Source #
Indicates the algorithm used to create the checksum for the object when
using the SDK. This header will not provide any additional functionality
if not using the SDK. When sending this header, there must be a
corresponding x-amz-checksum
or x-amz-trailer
header sent.
Otherwise, Amazon S3 fails the request with the HTTP status code
400 Bad Request
. For more information, see
Checking object integrity
in the Amazon S3 User Guide.
If you provide an individual checksum, Amazon S3 ignores any provided
ChecksumAlgorithm
parameter.
This checksum algorithm must be the same for all parts and it match the
checksum value supplied in the CreateMultipartUpload
request.
deleteObjects_expectedBucketOwner :: Lens' DeleteObjects (Maybe Text) Source #
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).
deleteObjects_mfa :: Lens' DeleteObjects (Maybe Text) Source #
The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled.
deleteObjects_requestPayer :: Lens' DeleteObjects (Maybe RequestPayer) Source #
Undocumented member.
deleteObjects_bucket :: Lens' DeleteObjects BucketName Source #
The bucket name containing the objects to delete.
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 with 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 Amazon S3 on Outposts
in the Amazon S3 User Guide.
deleteObjects_delete :: Lens' DeleteObjects Delete Source #
Container for the request.
Destructuring the Response
data DeleteObjectsResponse Source #
See: newDeleteObjectsResponse
smart constructor.
DeleteObjectsResponse' | |
|
Instances
newDeleteObjectsResponse Source #
Create a value of DeleteObjectsResponse
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:deleted:DeleteObjectsResponse'
, deleteObjectsResponse_deleted
- Container element for a successful delete. It identifies the object that
was successfully deleted.
$sel:errors:DeleteObjectsResponse'
, deleteObjectsResponse_errors
- Container for a failed delete action that describes the object that
Amazon S3 attempted to delete and the error it encountered.
$sel:requestCharged:DeleteObjectsResponse'
, deleteObjectsResponse_requestCharged
- Undocumented member.
$sel:httpStatus:DeleteObjectsResponse'
, deleteObjectsResponse_httpStatus
- The response's http status code.
Response Lenses
deleteObjectsResponse_deleted :: Lens' DeleteObjectsResponse (Maybe [DeletedObject]) Source #
Container element for a successful delete. It identifies the object that was successfully deleted.
deleteObjectsResponse_errors :: Lens' DeleteObjectsResponse (Maybe [S3ServiceError]) Source #
Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.
deleteObjectsResponse_requestCharged :: Lens' DeleteObjectsResponse (Maybe RequestCharged) Source #
Undocumented member.
deleteObjectsResponse_httpStatus :: Lens' DeleteObjectsResponse Int Source #
The response's http status code.