Sha256: 317807aef6ad37732ab005fa0edb881711b8e2d9fccd3a8123ac86c595ab4719

Contents?: true

Size: 866 Bytes

Versions: 12

Compression:

Stored size: 866 Bytes

Contents

# frozen_string_literal: true

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]
          XmlSimple.xml_in(xml)['Buckets'][0]
        end
      end
    end
  end
end

Version data entries

12 entries across 10 versions & 2 rubygems

Version Path
fog-aliyun-0.3.10 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.9 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.8 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.7 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.6 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.5 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.4 lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.3 lib/fog/aliyun/requests/storage/list_buckets.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/requests/storage/list_buckets.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/requests/storage/list_buckets.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/requests/storage/list_buckets.rb
fog-aliyun-0.3.2 lib/fog/aliyun/requests/storage/list_buckets.rb