From: Itamar Turner-Trauring Date: Mon, 4 Mar 2013 20:06:45 +0000 (-0500) Subject: googlestorage_container.py: Implement DELETE object. X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty//%22%3C?a=commitdiff_plain;h=51449a3a6446b8895882f882c91d03a0daef1192;p=tahoe-lafs%2Ftahoe-lafs.git googlestorage_container.py: Implement DELETE object. --- diff --git a/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py b/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py index 5e91c87f..d272bd3c 100644 --- a/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py +++ b/src/allmydata/storage/backends/cloud/googlestorage/googlestorage_container.py @@ -109,6 +109,24 @@ class GoogleStorageContainer(CommonContainerMixin): d.addCallback(lambda (response, body): body) return d + def _delete_object(self, object_name): + """ + Delete an object from this container. + """ + d = self._auth_client.get_authorization_header() + def _do_delete(auth_header): + request_headers = { + 'Authorization': [auth_header], + "x-goog-api-version": ["2"], + } + url = self._make_object_url(self.URI, object_name) + return self._http_request("DELETE object", 'DELETE', url, request_headers, + body=None, + need_response_body=False) + d.addCallback(_do_delete) + d.addCallback(lambda (response, body): body) + return d + if __name__ == '__main__': from twisted.internet import reactor