Sha256: 1be74619d0fb7d618bea9ed424b29d1142512499c9a8a7ed7afa72fd49bdc49e
Contents?: true
Size: 1.44 KB
Versions: 2
Compression:
Stored size: 1.44 KB
Contents
module Fog module Storage class Dtdream class Real # Copy object # # ==== Parameters # * source_container_name<~String> - Name of source bucket # * source_object_name<~String> - Name of source object # * target_container_name<~String> - Name of bucket to create copy in # * target_object_name<~String> - Name for new copy of object # * options<~Hash> - Additional headers options={} def copy_object(source_bucket, source_object, target_bucket, target_object, options = {}) options = options.reject {|key, value| value.nil?} bucket = options[:bucket] bucket ||= @aliyun_oss_bucket source_bucket ||= bucket target_bucket ||= bucket headers = { 'x-oss-copy-source' => "/#{source_bucket}/#{source_object}" } location = get_bucket_location(target_bucket) endpoint = "http://"+location+".aliyuncs.com" resource = target_bucket+'/'+target_object request({ :expects => [200, 203], :headers => headers, :method => 'PUT', :path => target_object, :bucket => target_bucket, :resource => resource, :endpoint => endpoint }) end end class Mock def copy_object(source_bucket, source_object, target_bucket, target_object) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fog-dtdream-0.0.8 | lib/fog/dtdream/requests/storage/copy_object.rb |
fog-dtdream-0.0.7 | lib/fog/dtdream/requests/storage/copy_object.rb |