1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/requests/storage/delete_object.rb

41 lines
1.1 KiB
Ruby
Raw Normal View History

module Fog
module Storage
class Rackspace
2013-12-18 17:01:42 -05: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
# @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)
request(
2009-10-31 00:41:39 -04:00
:expects => 204,
:method => 'DELETE',
: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)
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