Atom feed of this document
 
 
 

 4.2.9.7. Expiring Objects with the X-Delete-After and X-Delete-At Headers

When an object is assigned either an X-Delete-After or X-Delete-At header when doing a PUT or POST on the object, it is scheduled for deletion. This feature is helpful for objects you do not want to permanently store, such as log files, recurring full backups of a dataset, or documents or images you know will be outdated at a future time.

The X-Delete-At header requires a Unix Epoch timestamp, in integer form; for example: 1348691905 represents Wed, 26 Sep 2012 20:38:25 GMT. By setting the header to a specific Epoch time, you indicate when you want the object to expire, not be served, and be deleted completely from the storage system.

The X-Delete-After header takes an integer number of seconds and calculates the amount of time from now that you want the object to be deleted. The proxy server that receives the request converts this header into an X-Delete-At header and calculates the deletion time using its current time plus the value given in seconds.

For existing objects that you want to assign expiration headers to, use the POST operation.

 

Example 4.45. Delete At Example

In the example, the X-Delete-At header is assigned with a Unix Epoch timestamp in integer form for Mon, 11 Jun 2012 15:38:25 GMT. Use http://www.epochconverter.com/ for example timestamps and a batch converter.

  PUT /<api version>/<account>/<container>/<object> HTTP/1.1
  Host: storage.clouddrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
  Content-Type: image/jpeg
    X-Delete-At: 1339429105
                    

 

Example 4.46. Delete After Example

In this example, the X-Delete-After header is assigned a value in seconds, equivalent to 10 days. After this time, the object shall expire.

  PUT /<api version>/<account>/<container>/<object> HTTP/1.1
  Host: storage.clouddrive.com
  X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
  Content-Type: image/jpeg
  X-Delete-After: 864000
                    



loading table of contents...