Sha256: 1b77d6f0e48e4253a620515704385342347a01dbb7ef727ab4ec973ccd5345eb

Contents?: true

Size: 851 Bytes

Versions: 1

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

module Fog
  module Storage
    class Aliyun
      class Real
        # Create a new container
        #
        # ==== Parameters
        # * name<~String> - Name for container
        #
        def put_container(name, options = {})
          bucket = options[:bucket]
          bucket ||= @aliyun_oss_bucket
          location = get_bucket_location(bucket)
          endpoint = 'http://' + location + '.aliyuncs.com'

          path = name + '/'
          resource = bucket + '/' + name + '/'
          request(
            expects: [200, 203],
            method: 'PUT',
            path: path,
            bucket: bucket,
            resource: resource,
            endpoint: endpoint
          )
        end
      end

      class Mock
        def put_container(name, options = {}); end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-aliyun-0.3.1 lib/fog/aliyun/requests/storage/put_container.rb