HCP Tenant Management Help


Deleting an object or folder

You use the HTTP DELETE method to delete an object or folder in a bucket. To delete an object, you need delete permission for the bucket containing the object or for the object itself. To delete a folder, you need delete permission for the bucket.

Objects under retention or on hold

You cannot delete an object or any version of that object if the object is under retention or on hold.

Deleting an object while versioning is enabled

When you delete an object while versioning is enabled, HCP:

Retains the current version of the object as an old version. The version ID does not change.

Creates a delete marker as the new current version of the object. A delete marker is a special version of an object that indicates that a version of the object has been deleted.

A delete marker has a version ID but does not have any data or metadata. When you delete an object while versioning is enabled, the version ID of the delete marker is different from the version ID of the object you deleted.

The example below shows what happens when you delete object Obj1 while versioning is enabled. Obj1 has multiple versions, which are listed below with the current version at the top.

Before deletion

After deletion

Obj1 — version ID 87288727469829
Obj1 — version ID 87288727469825
Obj1 — version ID 87288727469816

Obj1 — version ID 87288727469833 (delete marker)
Obj1 — version ID 87288727469829 (old version)
Obj1 — version ID 87288727469825
Obj1 — version ID 87288727469816

Deleting an object while versioning is disabled

When you delete an object while versioning is disabled, HCP changes the current version of the object to a delete marker and does not change the version ID.

The example below shows what happens when you delete object Obj1 while versioning is disabled. Obj1 has multiple versions that were created while versioning was enabled. The versions are listed below with the current version at the top.

Before deletion

After deletion

Obj1 — version ID 87288727469829
Obj1 — version ID 87288727469825
Obj1 — version ID 87288727469816

Obj1 — version ID 87288727469829 (delete marker)
Obj1 — version ID 87288727469825
Obj1 — version ID 87288727469816

Deleting a deleted object

If you try to delete an object where the current version is a delete marker, HCP returns a 204 (No Content) status code.

Recovering a deleted object

If you inadvertently delete an object, you can recover it from an old version. You can recover an object only while versioning is enabled.

To recover an object, use a PUT request to copy the object to itself. Use the versionId query parameter with the source object specification to specify which version of the object you want to use for recovery.

You cannot use a delete marker to recover an object.

You cannot recover an object from an old version that has been pruned. For information about pruning, see Versioning.

For more information about using the PUT method to copy an object, see Copying an object.

© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.