File: list_multipart_uploads.rb

package info (click to toggle)
ruby-fog-aws 3.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,140 kB
  • sloc: ruby: 73,328; javascript: 14; makefile: 9; sh: 4
file content (52 lines) | stat: -rw-r--r-- 2,543 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module Fog
  module AWS
    class Storage
      class Real
        require 'fog/aws/parsers/storage/list_multipart_uploads'

        # List multipart uploads for a bucket
        #
        # @param [String] bucket_name Name of bucket to list multipart uploads for
        # @param [Hash] options config arguments for list.  Defaults to {}.
        # @option options [String] key-marker limits parts to only those that appear lexicographically after this key.
        # @option options [Integer] max-uploads limits number of uploads returned
        # @option options [String] upload-id-marker limits uploads to only those that appear lexicographically after this upload id.
        #
        # @return [Excon::Response] response:
        #   * body [Hash]:
        #     * Bucket [String] Bucket where the multipart upload was initiated
        #     * IsTruncated [Boolean] Whether or not the listing is truncated
        #     * KeyMarker [String] first key in list, only upload ids after this lexographically will appear
        #     * MaxUploads [Integer] Maximum results to return
        #     * NextKeyMarker [String] last key in list, for further pagination
        #     * NextUploadIdMarker [String] last key in list, for further pagination
        #     * Upload [Hash]:
        #       * Initiated [Time] Time when upload was initiated
        #       * Initiator [Hash]:
        #         * DisplayName [String] Display name of upload initiator
        #         * ID [String] Id of upload initiator
        #       * Key [String] Key where multipart upload was initiated
        #       * Owner [Hash]:
        #         * DisplayName [String] Display name of upload owner
        #         * ID [String] Id of upload owner
        #       * StorageClass [String] Storage class of object
        #       * UploadId [String] upload id of upload containing part
        #     * UploadIdMarker [String] first key in list, only upload ids after this lexographically will appear
        #
        # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListMPUpload.html
        #
        def list_multipart_uploads(bucket_name, options = {})
          request({
            :expects  => 200,
            :headers  => {},
            :bucket_name => bucket_name,
            :idempotent => true,
            :method   => 'GET',
            :parser   => Fog::Parsers::AWS::Storage::ListMultipartUploads.new,
            :query    => options.merge!({'uploads' => nil})
          })
        end
      end
    end
  end
end