Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a Dynamic Large Objects in Openstack swift with API

Follow the document's steps

http://docs.openstack.org/developer/swift/overview_large_objects.html

I put 3 segments file and 1 Manifest file successfully

# First, upload the segments
curl -X PUT -H 'X-Auth-Token: ' \
    http:///container/myobject/1 --data-binary 'data1'
curl -X PUT -H 'X-Auth-Token: ' \
    http:///container/myobject/2 --data-binary 'data2'
curl -X PUT -H 'X-Auth-Token: ' \
    http:///container/myobject/3 --data-binary 'data3'

# Next, create the manifest file
curl -X PUT -H 'X-Auth-Token: ' \
    -H 'X-Object-Manifest: container/myobject/' \
    http:///container/myobject --data-binary ''

When I download the object there's no problem ,the object is downloaded

curl -H 'X-Auth-Token: ' http:///container/myobject

But when I want to delete the object it only delete the manifest file ,all the segment file still exist on the cloud.

curl X DELETE -H 'X-Auth-Token: ' http:///container/myobject

How can I delete the object both the manifest file and the segment files? I want to use the API the the SWIFT tool.

like image 278
Ryker.Wang Avatar asked Dec 02 '25 03:12

Ryker.Wang


2 Answers

You need to delete the segments individually, in the same manner you delete the manifest file.

Keep in mind there is no way to atomically delete a dynamic large object. Even if you delete the manifest file first, the weak consistency model used by the API does not require the effects of two delete operations to appear to users (e.g. in future Get Object calls) in the order they were sent.

like image 132
Sam Harwell Avatar answered Dec 05 '25 23:12

Sam Harwell


The swift CLI tool deletes the complete list of all segment object and the dynamic large object which was created without any content in the API request.

swift delete container_name dynamic_object_name

But using the API's it only deletes the large object file and does not delete the associated segment objects.

The Static Large object file is a better option to choose if you are planning to use API's to delete the segment objects.

Ref:
Static Large object, Dynamic Large object

like image 39
dvigneshwer Avatar answered Dec 05 '25 23:12

dvigneshwer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!