2011-06-15 14:33:26 -04:00
|
|
|
module Fog
|
2011-10-17 15:25:07 -04:00
|
|
|
module Storage
|
|
|
|
class HP
|
2011-06-15 14:33:26 -04:00
|
|
|
class Real
|
|
|
|
|
|
|
|
# List number of objects and total bytes stored
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * container<~String> - Name of container to retrieve info for
|
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
|
|
|
# * headers<~Hash>:
|
|
|
|
# * 'X-Container-Object-Count'<~String> - Count of containers
|
|
|
|
# * 'X-Container-Bytes-Used'<~String> - Bytes used
|
|
|
|
def head_container(container)
|
|
|
|
response = request(
|
|
|
|
:expects => 204,
|
|
|
|
:method => 'HEAD',
|
2012-03-21 16:59:08 -04:00
|
|
|
:path => Fog::HP.escape(container),
|
2011-06-15 14:33:26 -04:00
|
|
|
:query => {'format' => 'json'}
|
|
|
|
)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2011-07-29 11:33:28 -04:00
|
|
|
|
|
|
|
class Mock # :nodoc:all
|
|
|
|
|
|
|
|
def head_container(container_name)
|
|
|
|
response = get_container(container_name)
|
|
|
|
response.body = nil
|
2012-10-17 15:02:42 -04:00
|
|
|
response.status = 204
|
2011-07-29 11:33:28 -04:00
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2011-06-15 14:33:26 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|