mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
38 lines
No EOL
827 B
Ruby
38 lines
No EOL
827 B
Ruby
module Fog
|
|
module CDN
|
|
class HP
|
|
class Real
|
|
|
|
# Delete an existing container
|
|
#
|
|
# ==== Parameters
|
|
# * name<~String> - Name of container to delete
|
|
#
|
|
def delete_container(name)
|
|
response = request(
|
|
:expects => 204,
|
|
:method => 'DELETE',
|
|
:path => Fog::HP.escape(name)
|
|
)
|
|
response
|
|
end
|
|
|
|
end
|
|
|
|
class Mock # :nodoc:all
|
|
def delete_container(name)
|
|
response = Excon::Response.new
|
|
if self.data[:cdn_containers][name]
|
|
self.data[:cdn_containers].delete(name)
|
|
response.status = 204
|
|
response.body = ""
|
|
response
|
|
else
|
|
raise Fog::CDN::HP::NotFound
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
end |