amazonka-s3-2.0: Amazon Simple Storage Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.S3.DeleteObjects

Description

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

Creating a Request

data DeleteObjects Source #

See: newDeleteObjects smart constructor.

Constructors

DeleteObjects' 

Fields

  • bypassGovernanceRetention :: Maybe Bool

    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.

  • checksumAlgorithm :: Maybe 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.

  • expectedBucketOwner :: Maybe Text

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

  • mfa :: Maybe Text

    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.

  • requestPayer :: Maybe RequestPayer
     
  • bucket :: BucketName

    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.

  • delete' :: Delete

    Container for the request.

Instances

Instances details
ToHeaders DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

ToPath DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

ToQuery DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

ToElement DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

AWSRequest DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Associated Types

type AWSResponse DeleteObjects #

Generic DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Associated Types

type Rep DeleteObjects :: Type -> Type #

Read DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Show DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

NFData DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Methods

rnf :: DeleteObjects -> () #

Eq DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Hashable DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

type AWSResponse DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

type Rep DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

newDeleteObjects Source #

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

Constructors

DeleteObjectsResponse' 

Fields

Instances

Instances details
Generic DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Associated Types

type Rep DeleteObjectsResponse :: Type -> Type #

Read DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Show DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

NFData DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Methods

rnf :: DeleteObjectsResponse -> () #

Eq DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

type Rep DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

type Rep DeleteObjectsResponse = D1 ('MetaData "DeleteObjectsResponse" "Amazonka.S3.DeleteObjects" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" 'False) (C1 ('MetaCons "DeleteObjectsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "deleted") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [DeletedObject])) :*: S1 ('MetaSel ('Just "errors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [S3ServiceError]))) :*: (S1 ('MetaSel ('Just "requestCharged") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RequestCharged)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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.