Sha256: 2edf342e6e4a2490780348ac260614b4aa0216d866cf5a4e6a69d9a6e7493536

Contents?: true

Size: 827 Bytes

Versions: 6

Compression:

Stored size: 827 Bytes

Contents

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

6 entries across 6 versions & 2 rubygems

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