Sha256: 82853bd663e86ce9e85475b3a6cc585998674e4c45ee4667d6369c4f02effbd9

Contents?: true

Size: 856 Bytes

Versions: 2

Compression:

Stored size: 856 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

2 entries across 2 versions & 1 rubygems

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