I am working on OpenStack Swift for storing data objects and for this I am using JOSS API to upload, update, delete and retrieve objects. I am able to delete any object in a specific container.

I want to delete multiple objects in one go or say delete a whole container in one go. I have searched for this and found that to delete a container full of objects, use 'X-Bulk-Delete: true_value' header in curl command, but it's not working, may be, due to a syntax error. Also I am not getting any method from JOSS API that could do the same work for me.

Please suggest me the methods through which I could send this header and delete the objects in bulk.

Thanks in advance.

有帮助吗?

解决方案

Please, try the following:

curl -X DELETE -d "bulk-delete=true" -i -H "X-Auth-Token: $AUTH_TOKEN" -L "http://openstack.cloud.public.ip:6780/swift/v1/my_container"

also we can use POST method with the same arguments:

curl -X POST -d "bulk-delete=true" -i -H "X-Auth-Token: $AUTH_TOKEN" -L "http://openstack.cloud.public.ip:6780/swift/v1/my_container"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top