Sha256: fb29cd22d220581acc77fb6e83de922d2d74b002f74c86973ae1bac57c72534e

Contents?: true

Size: 1.53 KB

Versions: 37

Compression:

Stored size: 1.53 KB

Contents

module Fog
  module Storage
    class InternetArchive
      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,
            :host       => "#{bucket_name}.#{@host}",
            :method     => 'PUT',
            :path       => CGI.escape(object_name),
            :query      => {'uploadId' => upload_id, 'partNumber' => part_number}
          })
        end
      end # Real
    end # Storage
  end # InternetArchive
end # Fog

Version data entries

37 entries across 35 versions & 6 rubygems

Version Path
fog-internet-archive-0.0.2 lib/fog/storage/internet_archive/requests/upload_part.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-internet-archive-0.0.1/lib/fog/internet_archive/requests/storage/upload_part.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-internet-archive-0.0.1/lib/fog/internet_archive/requests/storage/upload_part.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-internet-archive-0.0.1/lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.40.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.39.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-internet-archive-0.0.1 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.38.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.37.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.36.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.35.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-2.0.0.pre.0 lib/fog/internet_archive/requests/storage/upload_part.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.34.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.33.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.32.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.31.0 lib/fog/internet_archive/requests/storage/upload_part.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.30.0 lib/fog/internet_archive/requests/storage/upload_part.rb
fog-1.29.0 lib/fog/internet_archive/requests/storage/upload_part.rb