2010-03-19 21:29:42 -04:00
|
|
|
module Fog
|
|
|
|
module Rackspace
|
2010-09-08 16:50:23 -04:00
|
|
|
class Storage
|
2010-03-19 21:29:42 -04:00
|
|
|
class Real
|
2009-10-11 16:37:25 -04: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 12:25:33 -04:00
|
|
|
#
|
2009-10-11 16:37:25 -04:00
|
|
|
# ==== Returns
|
2009-11-02 21:48:49 -05:00
|
|
|
# * response<~Excon::Response>:
|
2009-10-12 12:25:33 -04: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 16:37:25 -04:00
|
|
|
def get_containers(options = {})
|
2011-01-26 14:15:34 -05:00
|
|
|
options = options.reject {|key, value| value.nil?}
|
2010-11-01 14:50:30 -04:00
|
|
|
response = request(
|
2009-10-11 16:37:25 -04:00
|
|
|
:expects => [200, 204],
|
|
|
|
:method => 'GET',
|
|
|
|
:path => '',
|
2010-06-05 17:19:39 -04:00
|
|
|
:query => {'format' => 'json'}.merge!(options)
|
2009-10-11 16:37:25 -04:00
|
|
|
)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|