HCP Tenant Management Help
You use the HTTP DELETE method to delete an object. If versioning is enabled for a bucket, you can delete old versions of objects.
To delete a specific version of an object, you use a version ID or timestamp. To delete a range of versions of an object, you specify starting and ending version IDs or timestamps.
The result of an object or version deletion is a delete marker. A delete marker is an indicator that a version of an object has been deleted. A delete marker has a version ID but does not have any data or metadata.
Similar to purging an object, you can use a version ID or timestamp range to delete all versions of an object. However, purging an object does not result in delete markers. For information about deleting all versions of an object, see Purging an object and using privileged purge.
If an object is under retention or on hold, you can delete it only if the namespace is configured to allow privileged operations and you have the necessary permissions. Privileged operations require you to provide a reason for the deletion.
![]() |
Tip: If an object is not under retention, you can use a privileged delete operation to specify a reason for the deletion. Although the object is not under retention, the namespace must still support privileged operations, and you need privileged permission. |
Using the DELETE method with a symbolic link deletes the link, not the target object.
Deleting an object without specifying a version ID while versioning is enabled
While versioning is enabled, if you delete an object without specifying a version ID in the DELETE request, HCP:
•Retains the current version of the object as an old version. The version ID does not change.
•Creates a delete marker. The delete marker is an indicator 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 without specifying a version ID, the version ID of the delete marker is different from the version ID of the object you deleted.
When you delete the current version of an object, the delete marker becomes the new current version.
The example below shows what happens when you delete object Obj1 without specifying a version ID 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 87288727469833 (delete marker) |
Deleting a version with a specified version ID while versioning is enabled
While versioning is enabled, if you delete a specific version of an object, regardless of whether that version is the current version or an old version, HCP changes that version to a delete marker. In this case, the version ID of the delete marker is the same as the version ID of the version you deleted.
The example below shows what happens when you delete version 87288727469825 of 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 87288727469829 |
Deleting a version with a specified timestamp while versioning is enabled
While versioning is enabled, if you specify an object version to delete using the object version timestamp, regardless of whether that version is the current version or an old version, HCP changes that version to a delete marker. In this case, the version ID of the delete marker is the same as the version ID of the version you deleted.
The example below shows what happens when you delete version 1415463674 of object Obj1 while versioning is enabled. Obj1 has multiple versions with different timestamps, which are listed below with the latest version at the top.
Before deletion |
After deletion |
---|---|
Obj1 — timestamp 1415463675 |
Obj1 — timestamp 1415463675 |
Deleting versions in a specified range of version IDs while versioning is enabled
While versioning is enabled, if you delete a specified range of version IDs of an object, HCP changes those object versions to delete markers. The version IDs of the delete markers are the same as the version IDs of the versions you deleted.
The example below shows what happens when you delete version 87288727469829 through 87288727469816 of 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 87288727469829 (delete marker) |
Deleting versions in a specified timestamp range while versioning is enabled
While versioning is enabled, if you delete a specified range of object versions using timestamp range, HCP changes those object versions to delete markers. The version IDs of the delete markers are the same as the version IDs of the versions you deleted.
The example below shows what happens when you delete object versions with timestamps 1415463675 through 1415463673 of object Obj1 while versioning is enabled. Obj1 has multiple versions with different timestamps, which are listed below with the latest version at the top.
Before deletion |
After deletion |
---|---|
Obj1 — timestamp 1415463675 |
Obj1 — timestamp 1415463675 (delete marker) |
Deleting an object while versioning is disabled
While versioning is disabled, you can delete only the current version of an object, even if older versions exist. If you specify an object version ID or timestamp range, the request fails.
When you delete an object with versioning disabled, HCP changes the current version of the object to a delete marker and does not change the version ID. HCP changes the current version even if you specify the version ID of an old version in the delete request.
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 87288727469829 (delete marker) |
Deleting a delete marker or deleted object version
If you try to delete a delete marker, HCP returns a 403 (Forbidden) status code. If you try to delete an old version of an object that was deleted without a specified version ID while versioning was enabled, 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. If you deleted the object without specifying a version ID while versioning was enabled, you can recover the object from the version you just deleted.
To recover an object, issue a GET request that specifies the version ID of the version you want to use for recovery. Then use a PUT request to save the retrieved version as a new version of the object.
You cannot use a delete marker to recover an object. If you try to retrieve a delete marker, HCP returns a 204 (No Content) status code.
You cannot recover an object from an old version that has been pruned. For information about pruning, see Versioning.
Trademarks and Legal Disclaimer
© 2015, 2019 Hitachi Vantara Corporation. All rights reserved.