2010-03-20 01:29:42 +00:00
|
|
|
module Fog
|
|
|
|
module Rackspace
|
|
|
|
module Files
|
|
|
|
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
|
2009-11-03 02:48:49 +00:00
|
|
|
# * 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 = { 'format' => 'json' }.merge!(options)
|
2009-11-05 08:02:26 +00:00
|
|
|
query = ''
|
2009-10-11 20:37:25 +00:00
|
|
|
for key, value in options
|
2009-10-27 00:56:08 +00:00
|
|
|
query << "#{key}=#{CGI.escape(value)}&"
|
2009-10-11 20:37:25 +00:00
|
|
|
end
|
2009-10-27 00:56:08 +00:00
|
|
|
query.chop!
|
2009-10-11 20:37:25 +00:00
|
|
|
response = storage_request(
|
|
|
|
:expects => [200, 204],
|
|
|
|
:method => 'GET',
|
|
|
|
:path => '',
|
2009-10-27 00:56:08 +00:00
|
|
|
:query => query
|
2009-10-11 20:37:25 +00:00
|
|
|
)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2010-03-20 01:29:42 +00:00
|
|
|
class Mock
|
2009-10-11 20:37:25 +00:00
|
|
|
|
2010-02-02 06:53:18 +00:00
|
|
|
def get_containers(options = {})
|
2010-05-27 00:38:23 +00:00
|
|
|
Fog::Mock.not_implemented
|
2009-10-11 20:37:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|