Sha256: ad376dfc84f378301f03f663a91431c9502ba2a0915f79dbf5dfe223f75fb32d

Contents?: true

Size: 923 Bytes

Versions: 6

Compression:

Stored size: 923 Bytes

Contents

module Fog
  module Storage
    class Aliyun
      class Real
        def list_buckets(options = {})
          prefix = options[:prefix]
          marker = options[:marker]
          maxKeys = options[:maxKeys]

          path = ''
          if prefix
            path += '?prefix=' + prefix
            path += '&marker=' + marker if marker
            path += '&max-keys=' + maxKeys if maxKeys

          elsif marker
            path += '?marker=' + marker
            path += '&max-keys=' + maxKeys if maxKeys

          elsif maxKeys
            path += '?max-keys=' + maxKeys
          end

          ret = request(
            expects: [200, 203],
            method: 'GET',
            path: path
          )
          xml = ret.data[:body]
          result = XmlSimple.xml_in(xml)['Buckets'][0]
        end
      end

      class Mock
        def list_buckets(options = {})
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
fog-aliyun-0.3.0 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.2.2 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-xiaozhu-0.2.2 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-xiaozhu-0.2.1 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.2.1 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.2.0 lib/fog/aliyun/requests/storage/list_buckets.rb