Sha256: 7dd3b99e176322ae07123c33e1cbdbf14313a9b6731abb35bd3333cf1d14bb6c

Contents?: true

Size: 1.52 KB

Versions: 35

Compression:

Stored size: 1.52 KB

Contents

module Fog
  module Storage
    class AWS
      class Real

        # Upload a part for a multipart upload
        #
        # ==== Parameters
        # * bucket_name<~String> - Name of bucket to add part to
        # * object_name<~String> - Name of object to add part to
        # * upload_id<~String> - Id of upload to add part to
        # * part_number<~String> - Index of part in upload
        # * data<~File||String> - Content for part
        # * options<~Hash>:
        #   * 'Content-MD5'<~String> - Base64 encoded 128-bit MD5 digest of message
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * headers<~Hash>:
        #     * 'ETag'<~String> - etag of new object (will be needed to complete upload)
        #
        # ==== See Also
        # 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,
            :headers    => headers,
            :host       => "#{bucket_name}.#{@host}",
            :method     => 'PUT',
            :path       => CGI.escape(object_name),
            :query      => {'uploadId' => upload_id, 'partNumber' => part_number}
          })
        end

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

Version data entries

35 entries across 35 versions & 9 rubygems

Version Path
fog-1.5.0 lib/fog/aws/requests/storage/upload_part.rb
rackspace-fog-1.4.2 lib/rackspace-fog/aws/requests/storage/upload_part.rb
fog-1.4.0 lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
michiels-fog-1.3.1 lib/fog/aws/requests/storage/upload_part.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
fog-1.3.1 lib/fog/aws/requests/storage/upload_part.rb
fog-1.3.0 lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
fog-1.2.0 lib/fog/aws/requests/storage/upload_part.rb
ktheory-fog-1.1.2 lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/upload_part.rb
fog-1.1.2 lib/fog/aws/requests/storage/upload_part.rb
fog_tractical-1.1.4 lib/fog/aws/requests/storage/upload_part.rb
fog_tractical-1.1.3 lib/fog/aws/requests/storage/upload_part.rb