Sha256: 257631d3aa68fbb322313a6b2c8b7bc2e7858c2c35b73415f698aac2dcb91b79

Contents?: true

Size: 1.49 KB

Versions: 50

Compression:

Stored size: 1.49 KB

Contents

module Fog
  module Storage
    class AWS
      class Real

        # Upload a part for a multipart upload
        #
        # @param bucket_name [String] Name of bucket to add part to
        # @param object_name [String] Name of object to add part to
        # @param upload_id [String] Id of upload to add part to
        # @param part_number [String] Index of part in upload
        # @param data [File||String] Content for part
        # @param options [Hash]
        # @option options Content-MD5 [String] Base64 encoded 128-bit MD5 digest of message
        #
        # @return [Excon::Response] response
        #   * headers [Hash]:
        #     * ETag [String] etag of new object (will be needed to complete upload)
        #
        # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadUploadPart.html
        #
        def upload_part(bucket_name, object_name, upload_id, part_number, data, options = {})
          data = Fog::Storage.parse_data(data)
          headers = options
          headers['Content-Length'] = data[:headers]['Content-Length']
          request({
            :body       => data[:body],
            :expects    => 200,
            :idempotent => true,
            :headers    => headers,
            :bucket_name => bucket_name,
            :object_name => object_name,
            :method     => 'PUT',
            :query      => {'uploadId' => upload_id, 'partNumber' => part_number}
          })
        end

      end # Real
    end # Storage
  end # AWS
end # Fog

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/storage/upload_part.rb
fog-1.19.0 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/aws/requests/storage/upload_part.rb