libZSservicesZSamazonka-s3ZSamazonka-s3
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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

  • 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
     
  • 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:PutBucketPublicAccessBlock permission.

  • expectedBucketOwner :: Maybe Text

    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.

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

  • delete' :: Delete

    Container for the request.

Instances

Instances details
Eq DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Read DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Show DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Generic DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Associated Types

type Rep DeleteObjects :: Type -> Type #

NFData DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Methods

rnf :: DeleteObjects -> () #

Hashable DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

AWSRequest DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Associated Types

type AWSResponse DeleteObjects #

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

type Rep DeleteObjects Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

type Rep DeleteObjects = D1 ('MetaData "DeleteObjects" "Amazonka.S3.DeleteObjects" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "DeleteObjects'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mfa") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "requestPayer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RequestPayer)) :*: S1 ('MetaSel ('Just "bypassGovernanceRetention") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)))) :*: (S1 ('MetaSel ('Just "expectedBucketOwner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "bucket") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BucketName) :*: S1 ('MetaSel ('Just "delete'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Delete)))))
type AWSResponse 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: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.

$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:PutBucketPublicAccessBlock permission.

$sel:expectedBucketOwner:DeleteObjects', deleteObjects_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: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 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:delete':DeleteObjects', deleteObjects_delete - Container for the request.

Request Lenses

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_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:PutBucketPublicAccessBlock permission.

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 will fail with an HTTP 403 (Access Denied) error.

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

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
Eq DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Read DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Show DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Generic DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Associated Types

type Rep DeleteObjectsResponse :: Type -> Type #

NFData DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

Methods

rnf :: DeleteObjectsResponse -> () #

type Rep DeleteObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteObjects

type Rep DeleteObjectsResponse = D1 ('MetaData "DeleteObjectsResponse" "Amazonka.S3.DeleteObjects" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "DeleteObjectsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "requestCharged") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RequestCharged)) :*: S1 ('MetaSel ('Just "deleted") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [DeletedObject]))) :*: (S1 ('MetaSel ('Just "errors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [S3ServiceError])) :*: 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:requestCharged:DeleteObjectsResponse', deleteObjectsResponse_requestCharged - Undocumented member.

$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: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.