Sha256: f112f3087a9853ec737a9c5b20ba4cc87bb5bd854652864b5bc6e9b71b434bf7

Contents?: true

Size: 1.55 KB

Versions: 14

Compression:

Stored size: 1.55 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,
            :idempotent => true,
            :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

14 entries across 14 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/aws/requests/storage/upload_part.rb
fog-nirvanix-1.8.1 lib/fog/aws/requests/storage/upload_part.rb
fog-parser-fix-1.6.1 lib/fog/aws/requests/storage/upload_part.rb
fog-test-again-1.6.0 lib/fog/aws/requests/storage/upload_part.rb
fog-parser-fix-1.6.0 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/aws/requests/storage/upload_part.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/aws/requests/storage/upload_part.rb
fog-sgonyea-1.8.1 lib/fog/aws/requests/storage/upload_part.rb
fog-1.8.0 lib/fog/aws/requests/storage/upload_part.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/requests/storage/upload_part.rb
fog-1.7.0 lib/fog/aws/requests/storage/upload_part.rb
fog-1.6.0 lib/fog/aws/requests/storage/upload_part.rb