1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add #head_containers and #head_container methods.

This commit is contained in:
Rupak Ganguly 2011-06-15 14:33:26 -04:00
parent 0210723e1e
commit 67d074e66a
3 changed files with 57 additions and 2 deletions

View file

@ -18,8 +18,8 @@ module Fog
request :get_container
request :get_containers
# request :get_object
# request :head_container
# request :head_containers
request :head_container
request :head_containers
# request :head_object
request :put_container
# request :put_object

View file

@ -0,0 +1,29 @@
module Fog
module HP
class Storage
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',
:path => URI.escape(container),
:query => {'format' => 'json'}
)
response
end
end
end
end
end

View file

@ -0,0 +1,26 @@
module Fog
module HP
class Storage
class Real
# List number of containers and total bytes stored
#
# ==== Returns
# * response<~Excon::Response>:
# * headers<~Hash>:
# * 'X-Account-Container-Count'<~String> - Count of containers
# * 'X-Account-Bytes-Used'<~String> - Bytes used
def head_containers
response = request(
:expects => 204,
:method => 'HEAD',
:path => '',
:query => {'format' => 'json'}
)
response
end
end
end
end
end