如需查看对象存储是否支持该特性,请参考:doc:managing-openstack-object-storage-with-swift-cli. 或者向你的服务提供商确认。
为删除调度对象适用于管理不希望做持久存储的对象,比如日志文件,数据集定期备份,或在特定时间过期的文档和镜像。
为删除操作调度对象时,在``PUT``或``POST`` 请求中包含以下请求头:
1348691905``表示``Wed, 26 Sept 2012 20:38:25 GMT
. 它表示对象的过期时间,对象过期则不再提供服务,完全从对象存储中删除。注解
Use EpochConverter to convert dates to and from epoch timestamps and for batch conversions.
使用POST方法将表示过期的请求头赋值给已存在的对象。
在这个例子中,``X-Delete-At``设置为UNIX epoch时间戳``Mon, 11 Jun 2012 15:38:25 GMT``的整数值。
$ curl -i publicURL/marktwain/goodbye -X PUT -H "X-Auth-Token: token" \
-H "X-Delete-At: 1390581073" -H "Content-Length: 14" -H \
"Content-Type: application/octet-stream"
在这个例子中, X-Delete-After
设置为864000秒。超过此时间后对象过期。
PUT /<api version>/<account>/<container>/<object> HTTP/1.1
Host: storage.example.com
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
Content-Type: image/jpeg
X-Delete-After: 864000
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.