2010-03-19 21:29:42 -04:00
|
|
|
module Fog
|
2011-06-15 17:26:43 -04:00
|
|
|
module Storage
|
|
|
|
class Rackspace
|
2013-12-17 15:05:43 -05:00
|
|
|
|
2010-03-19 21:29:42 -04:00
|
|
|
class Real
|
2009-10-28 01:20:50 -04:00
|
|
|
|
|
|
|
# Delete an existing container
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * name<~String> - Name of container 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-28 01:20:50 -04:00
|
|
|
def delete_container(name)
|
2011-06-15 17:26:43 -04:00
|
|
|
request(
|
2009-10-28 01:20:50 -04:00
|
|
|
:expects => 204,
|
|
|
|
:method => 'DELETE',
|
2011-09-16 23:46:22 -04:00
|
|
|
:path => Fog::Rackspace.escape(name)
|
2009-10-28 01:20:50 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2013-12-17 15:05:43 -05:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
def delete_container(name)
|
2013-12-19 15:57:45 -05:00
|
|
|
c = mock_container! name
|
2013-12-17 15:05:43 -05:00
|
|
|
|
2013-12-19 15:57:45 -05:00
|
|
|
raise Excon::Errors::Conflict.new 'Conflict' unless c.empty?
|
|
|
|
remove_container name
|
2013-12-17 15:05:43 -05:00
|
|
|
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 204
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-10-28 01:20:50 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|