Sha256: 96cc8a6917cca8b4deed60aed1b85765444ad1e7aa42c5effe5f29b6f0c764b2

Contents?: true

Size: 1.33 KB

Versions: 16

Compression:

Stored size: 1.33 KB

Contents

unless Fog.mocking?

  module Fog
    module Rackspace
      class Files

        # 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
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Array>:
        #     * container<~Hash>:
        #       * 'bytes'<~Integer>: - Number of bytes used by container
        #       * 'count'<~Integer>: - Number of items in container
        #       * 'name'<~String>: - Name of container
        def get_containers(options = {})
          options = { 'format' => 'json' }.merge!(options)
          query = ''
          for key, value in options
            query << "#{key}=#{CGI.escape(value)}&"
          end
          query.chop!
          response = storage_request(
            :expects  => [200, 204],
            :method   => 'GET',
            :path     => '',
            :query    => query
          )
          response
        end

      end
    end
  end

else

  module Fog
    module Rackspace
      class Servers

        def get_containers(options = {})
          raise MockNotImplemented.new("Contributions welcome!")
        end

      end
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fog-0.0.58 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.57 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.56 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.55 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.54 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.53 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.52 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.51 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.50 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.49 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.48 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.47 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.46 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.45 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.44 lib/fog/rackspace/requests/files/get_containers.rb
fog-0.0.43 lib/fog/rackspace/requests/files/get_containers.rb