fog--fog/lib/fog/storage/requests/rackspace/get_containers.rb

43 lines
1.1 KiB
Ruby
Raw Normal View History

module Fog
module Rackspace
class Storage
class Real
2009-10-11 20:37:25 +00:00
# List existing storage containers
#
# ==== Parameters
# * options<~Hash>:
# * 'limit'<~Integer> - Upper limit to number of results returned
# * 'marker'<~String> - Only return objects with name greater than this value
2009-10-12 16:25:33 +00:00
#
2009-10-11 20:37:25 +00:00
# ==== Returns
# * response<~Excon::Response>:
2009-10-12 16:25:33 +00:00
# * body<~Array>:
# * container<~Hash>:
# * 'bytes'<~Integer>: - Number of bytes used by container
# * 'count'<~Integer>: - Number of items in container
# * 'name'<~String>: - Name of container
2009-10-11 20:37:25 +00:00
def get_containers(options = {})
options.reject! {|key, value| value.nil?}
response = request(
2009-10-11 20:37:25 +00:00
:expects => [200, 204],
:method => 'GET',
:path => '',
:query => {'format' => 'json'}.merge!(options)
2009-10-11 20:37:25 +00:00
)
response
end
end
class Mock
2009-10-11 20:37:25 +00:00
def get_containers(options = {})
Fog::Mock.not_implemented
2009-10-11 20:37:25 +00:00
end
end
end
end
end