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:
parent
0210723e1e
commit
67d074e66a
3 changed files with 57 additions and 2 deletions
|
@ -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
|
||||
|
|
29
lib/fog/storage/requests/hp/head_container.rb
Normal file
29
lib/fog/storage/requests/hp/head_container.rb
Normal 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
|
26
lib/fog/storage/requests/hp/head_containers.rb
Normal file
26
lib/fog/storage/requests/hp/head_containers.rb
Normal 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
|
Loading…
Reference in a new issue