2010-03-19 21:29:42 -04:00
|
|
|
module Fog
|
2011-06-15 17:26:43 -04:00
|
|
|
module Storage
|
|
|
|
class Rackspace
|
2013-12-18 17:01:42 -05:00
|
|
|
|
2010-03-19 21:29:42 -04:00
|
|
|
class Real
|
2009-10-31 00:41:39 -04:00
|
|
|
|
2012-08-17 09:56:39 -04:00
|
|
|
# Delete an existing object
|
2009-10-31 00:41:39 -04:00
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * container<~String> - Name of container to delete
|
|
|
|
# * object<~String> - Name of object to delete
|
2013-04-15 14:12:14 -04:00
|
|
|
# @raise [Fog::Storage::Rackspace::NotFound] - HTTP 404
|
|
|
|
# @raise [Fog::Storage::Rackspace::BadRequest] - HTTP 400
|
|
|
|
# @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500
|
|
|
|
# @raise [Fog::Storage::Rackspace::ServiceError]
|
2009-10-31 00:41:39 -04:00
|
|
|
def delete_object(container, object)
|
2011-06-15 17:26:43 -04:00
|
|
|
request(
|
2009-10-31 00:41:39 -04:00
|
|
|
:expects => 204,
|
|
|
|
:method => 'DELETE',
|
2011-09-16 23:46:22 -04:00
|
|
|
:path => "#{Fog::Rackspace.escape(container)}/#{Fog::Rackspace.escape(object)}"
|
2009-10-31 00:41:39 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2013-12-18 17:01:42 -05:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
def delete_object(container, object)
|
2013-12-19 15:57:45 -05:00
|
|
|
c = mock_container! container
|
|
|
|
c.mock_object! object
|
|
|
|
c.remove_object object
|
2013-12-18 17:01:42 -05:00
|
|
|
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 204
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-10-31 00:41:39 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|