These files are imported (and very lightly edited) from the old ocata user-guide. It has a few other swift-related docs that seemed more duplacative of what we already have, but these seem to fill existing gaps in our docs. Change-Id: Ib00bf6992327f15f271120dc5dbc86a4a235baec
1.4 KiB
Object expiration
You can schedule Object Storage (swift) objects to expire by setting
the X-Delete-At or X-Delete-After header. Once
the object is deleted, swift will no longer serve the object and it will
be deleted from the cluster shortly thereafter.
Set an object to expire at an absolute time (in Unix time). You can get the current Unix time by running
date +'%s'.$ swift post CONTAINER OBJECT_FILENAME -H "X-Delete-At:UNIX_TIME"Verify the
X-Delete-Atheader has posted to the object:$ swift stat CONTAINER OBJECT_FILENAMESet an object to expire after a relative amount of time (in seconds):
$ swift post CONTAINER OBJECT_FILENAME -H "X-Delete-After:SECONDS"The
X-Delete-Afterheader will be converted toX-Delete-At. Verify theX-Delete-Atheader has posted to the object:$ swift stat CONTAINER OBJECT_FILENAMEIf you no longer want to expire the object, you can remove the
X-Delete-Atheader:$ swift post CONTAINER OBJECT_FILENAME -H "X-Remove-Delete-At:"
Note
In order for object expiration to work properly, the
swift-object-expirer daemon will need access to all backend
servers in the cluster. The daemon does not need access to the
proxy-server or public network.