Sha256: fb38f15a1430e01698fe9a7b077d40095d2c2d193326283866b97ab53ea7ff9f

Contents?: true

Size: 800 Bytes

Versions: 9

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

class Aliyun < Fog::Bin
  class << self
    def class_for(key)
      case key
      when :storage
        Fog::Aliyun::Storage
      when :compute
        Fog::Compute::Aliyun
      else
        raise ArgumentError, "Unrecognized service: #{key}"
      end
    end

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] =
          case key
          when :storage
            Fog::Logger.warning('Aliyun[:storage] is not recommended, use Storage[:openstack] for portability')
            Fog::Storage.new(provider: 'aliyun')
          else
            raise ArgumentError, "Unrecognized service: #{key.inspect}"
          end
      end
      @@connections[service]
    end

    def services
      Fog::Aliyun.services
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fog-aliyun-0.4.0 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.19 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.18 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.17 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.16 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.15 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.13 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.12 lib/fog/bin/aliyun.rb
fog-aliyun-0.3.11 lib/fog/bin/aliyun.rb