[swift] Object Versioning: How to retrieve old versions of deleted objects?

Bernd Bausch berndbausch at gmail.com
Sun May 31 07:33:36 UTC 2020


According to documentation of Swift's new object versioning middleware 
[1], a deleted object won't be visible but previous version content is 
still recoverable.

Documentation doesn't say how, though. After deleting /myobject/, I can 
see its versions:

$ openstack object delete testcontainer myobject
$ curl http://192.168.1.200:8080/v1/$ACCOUNT/testcontainer?versions -H 
"x-auth-token: $T" | python -m json.tool | grep -e version_id -e name
         "name": "myobject",
         "version_id": "1590896642.07497"
         "name": "myobject",
         "version_id": "1590892906.83929"
         "name": "myobject",
         "version_id": "1590892899.36921"

But I can't GET old versions of /myobject/:

$ curl -i 
http://192.168.1.200:8080/v1/$ACCOUNT/testcontainer/myobject?version-id="1590896642.07497" 
-H "x-auth-token: $T"
HTTP/1.1 404 Not Found

After creating another object with the same name /myobject/, old 
versions are accessible again. This is a solution, but dare I say not a 
very elegant one. *Can **a deleted, versioned object be recovered 
without creating a dummy object with the same name?*

[1] 
https://docs.openstack.org/swift/latest/middleware.html#object-crud-operations-to-a-versioned-container

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20200531/eab39894/attachment.html>


More information about the openstack-discuss mailing list