Petabox
  • Introduction
  • Petabox FAQ
  • Concepts
    • Bucket versioning
    • Logging actions with a bucket
    • Object Lock
  • Tools
    • Supported tools
      • CyberDuck S3 Client
      • Mountain Duck
      • S3 Browser
      • RClone
      • AWS CLI Console client
      • SDKs for different languages
        • JavaScript SDK
        • AWS SDK for Java
        • Python SDK (boto)
  • S3 Compatible API
    • How to use the API
    • Signing Requests
    • API Reference
      • Bucket
        • HeadBucket
        • ListObjects/ListObjectsV2
        • PutBucketVersioning
        • PutBucketLogging
        • ListBuckets
        • RenameBucket
        • GetBucketLocation
      • Object
        • PutObject
        • GetObject
        • HeadObject
        • RenameObject
        • PutObjectAcl
      • Multipart upload
        • General multipart upload order
        • CreateMultipartUpload
        • UploadPart
        • CompleteMultipartUpload
        • ListMultipartUploads
      • Analytics
        • GetStatistics
        • GetBandwidthAnalytics
        • GetStorageAnalytics
      • Common request headers
      • Common response headers
      • Responses
      • GetObjectTagging
      • GetObjectAcl
      • GetBucketAcl
      • ListObjectVersions
      • GetBucketRequestPayment
      • GetBucketReplication
      • GetBucketTagging
      • GetBucketLocation
      • GetBucketVersioning
      • GetBucketLifecycle
      • GetObjectLockConfiguration
      • PutObjectLockConfiguration
      • GetObjectRetention
      • GetObjectLegalHold
      • PutObjectRetention
      • PutObjectLegalHold
      • PutObjectAcl
      • PutBucketAcl
      • PutBucketVersioning
      • CopyObject
      • DeleteObjects
      • AbortMultipartUpload
      • DeleteObject
      • DeleteBucket
      • PutBucketTagging
      • PutObjectTagging
      • DeleteBucketTagging
      • DeleteObjectTagging
      • PutBucketLogging
      • GetBucketLogging
      • ListParts
      • UploadPartCopy
      • PutBucketPolicy
      • GetBucketPolicy
      • DeleteBucketPolicy
Powered by GitBook
On this page
  • Request Syntax
  • URI Request Parameters
  • Request Body
  • Response Syntax
  • Response Elements
  • Examples
  • Sample Request
  • Sample Response
  • Sample Request: Deleting a specified version of an object
  • Sample Response
  • Sample Response: If the object deleted is a delete marker
  1. S3 Compatible API
  2. API Reference

DeleteObject

Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object

If there isn't a null version, Petabox does not remove any objects but will still respond that the command was successful.

To remove a specific version, you must use the version Id subresource. Using this subresource permanently deletes the version. If the object deleted is a delete marker, Petabox sets the response header, x-amz-delete-marker, to true.

You can delete objects by explicitly calling DELETE Object or configure its lifecycle (PutBucketLifecycle) to enable Petabox to remove them for you. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them the s3:DeleteObject, s3:DeleteObjectVersion, and s3:PutLifeCycleConfiguration actions.

Request Syntax

DELETE /Key+?versionId=VersionId HTTP/1.1
Host: Bucket.s3.petabox.io
x-amz-request-payer: RequestPayer
x-amz-bypass-governance-retention: BypassGovernanceRetention
x-amz-expected-bucket-owner: ExpectedBucketOwner

URI Request Parameters

The request uses the following URI parameters.

Bucket

The bucket name of the bucket containing the object.

Required: Yes

Key

Key name of the object to delete.

Length Constraints: Minimum length of 1.

Required: Yes

versionId

VersionId used to reference a specific version of the object.

x-amz-bypass-governance-retention

Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the s3:BypassGovernanceRetention permission.

x-amz-expected-bucket-owner

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

x-amz-request-payer

Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests.

Valid Values: requester

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 204
x-amz-delete-marker: DeleteMarker
x-amz-version-id: VersionId
x-amz-request-charged: RequestCharged

Response Elements

If the action is successful, the service sends back an HTTP 204 response.

The response returns the following HTTP headers.

x-amz-delete-marker

Specifies whether the versioned object that was permanently deleted was (true) or was not (false) a delete marker.

x-amz-request-charged

If present, indicates that the requester was successfully charged for the request.

Valid Values: requester

x-amz-version-id

Returns the version ID of the delete marker created as a result of the DELETE operation.

Examples

Sample Request

The following request deletes the object my-second-image.jpg.

DELETE /my-second-image.jpg HTTP/1.1
Host: bucket.s3.<Region>.petabox.io
Date: Wed, 12 Oct 2009 17:50:00 GMT
Authorization: authorization string
Content-Type: text/plain

Sample Response

This example illustrates one usage of DeleteObject.

HTTP/1.1 204 NoContent
x-amz-id-2: LriYPLdmOdAiIfgSm/F1YsViT1LW94/xUQxMsF7xiEb1a0wiIOIxl+zbwZ163pt7
x-amz-request-id: 0A49CE4060975EAC
Date: Wed, 12 Oct 2009 17:50:00 GMT
Content-Length: 0
Connection: close
Server: Petabox

Sample Request: Deleting a specified version of an object

The following request deletes the specified version of the object my-third-image.jpg.

DELETE /my-third-image.jpg?versionId=UIORUnfndfiufdisojhr398493jfdkjFJjkndnqUifhnw89493jJFJ HTTP/1.1 
Host: bucket.s3.<Region>.petabox.io
Date: Wed, 12 Oct 2009 17:50:00 GMT
Authorization: authorization string
Content-Type: text/plain
Content-Length: 0

Sample Response

This example illustrates one usage of DeleteObject.

HTTP/1.1 204 NoContent
x-amz-id-2: LriYPLdmOdAiIfgSm/F1YsViT1LW94/xUQxMsF7xiEb1a0wiIOIxl+zbwZ163pt7
x-amz-request-id: 0A49CE4060975EAC
x-amz-version-id: UIORUnfndfiufdisojhr398493jfdkjFJjkndnqUifhnw89493jJFJ
Date: Wed, 12 Oct 2009 17:50:00 GMT
Content-Length: 0
Connection: close
Server: Petabox

Sample Response: If the object deleted is a delete marker

This example illustrates one usage of DeleteObject.

HTTP/1.1 204 NoContent
x-amz-id-2: LriYPLdmOdAiIfgSm/F1YsViT1LW94/xUQxMsF7xiEb1a0wiIOIxl+zbwZ163pt7
x-amz-request-id: 0A49CE4060975EAC
x-amz-version-id: 3/L4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo
x-amz-delete-marker: true
Date: Wed, 12 Oct 2009 17:50:00 GMT
Content-Length: 0
Connection: close
Server: Petabox
PreviousAbortMultipartUploadNextDeleteBucket

Last updated 1 year ago