class Aws::S3::MultipartUpload
def abort(options = {})
-
(Types::AbortMultipartUploadOutput)
-
Options Hash:
(**options)
-
:if_match_initiated_time
(Time, DateTime, Date, Integer, String
) -- -
:expected_bucket_owner
(String
) -- -
:request_payer
(String
) --
Parameters:
-
options
(Hash
) -- ({})
Other tags:
- Example: Request syntax with placeholder values -
def abort(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @id ) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.abort_multipart_upload(options) end resp.data end
def bucket_name
-
(String)
-
def bucket_name @bucket_name end
def checksum_algorithm
-
(String)
-
def checksum_algorithm data[:checksum_algorithm] end
def checksum_type
-
(String)
-
def checksum_type data[:checksum_type] end
def client
-
(Client)
-
def client @client end
def complete(options = {})
(**options)
-
:compute_parts
(Boolean
) -- When `true`,
def complete(options = {}) if options.delete(:compute_parts) options[:multipart_upload] = { parts: compute_parts } end basic_complete(options) end
def complete(options = {})
-
(Object)
-
Options Hash:
(**options)
-
:sse_customer_key_md5
(String
) -- -
:sse_customer_key
(String
) -- -
:sse_customer_algorithm
(String
) -- -
:if_none_match
(String
) -- -
:if_match
(String
) -- -
:expected_bucket_owner
(String
) -- -
:request_payer
(String
) -- -
:mpu_object_size
(Integer
) -- -
:checksum_type
(String
) -- -
:checksum_sha256
(String
) -- -
:checksum_sha1
(String
) -- -
:checksum_crc64nvme
(String
) -- -
:checksum_crc32c
(String
) -- -
:checksum_crc32
(String
) -- -
:multipart_upload
(Types::CompletedMultipartUpload
) --
Parameters:
-
options
(Hash
) -- ({})
Other tags:
- Example: Request syntax with placeholder values -
def complete(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @id ) Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.complete_multipart_upload(options) end Object.new( bucket_name: @bucket_name, key: @object_key, client: @client ) end
def compute_parts
def compute_parts parts.sort_by(&:part_number).each.with_object([]) do |part, part_list| part_list << { part_number: part.part_number, etag: part.etag } end end
def data
-
(Types::MultipartUpload)
-
Raises:
-
(NotImplementedError)
- Raises when {#data_loaded?} is `false`.
def data load unless @data @data end
def data_loaded?
-
(Boolean)
-
def data_loaded? !!@data end
def extract_bucket_name(args, options)
def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end
def extract_id(args, options)
def extract_id(args, options) value = args[2] || options.delete(:id) case value when String then value when nil then raise ArgumentError, "missing required option :id" else msg = "expected :id to be a String, got #{value.class}" raise ArgumentError, msg end end
def extract_object_key(args, options)
def extract_object_key(args, options) value = args[1] || options.delete(:object_key) case value when String then value when nil then raise ArgumentError, "missing required option :object_key" else msg = "expected :object_key to be a String, got #{value.class}" raise ArgumentError, msg end end
def id
-
(String)
-
def id @id end
def identifiers
- Api: - private
Deprecated:
def identifiers { bucket_name: @bucket_name, object_key: @object_key, id: @id } end
def initialize(*args)
(**options)
-
:client
(Client
) -- -
:id
(required, String
) -- -
:object_key
(required, String
) -- -
:bucket_name
(required, String
) -- -
:client
(Client
) --
Overloads:
-
def initialize(options = {})
-
def initialize(bucket_name, object_key, id, options = {})
Parameters:
-
id
(String
) -- -
object_key
(String
) -- -
bucket_name
(String
) --
def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @object_key = extract_object_key(args, options) @id = extract_id(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) @waiter_block_warned = false end
def initiated
-
(Time)
-
def initiated data[:initiated] end
def initiator
-
(Types::Initiator)
-
def initiator data[:initiator] end
def key
-
(String)
-
def key data[:key] end
def load
- Api: - private
Raises:
-
(NotImplementedError)
-
def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end
def object
-
(Object)
-
def object Object.new( bucket_name: @bucket_name, key: @object_key, client: @client ) end
def object_key
-
(String)
-
def object_key @object_key end
def owner
-
(Types::Owner)
-
def owner data[:owner] end
def part(part_number)
-
(MultipartUploadPart)
-
Parameters:
-
part_number
(String
) --
def part(part_number) MultipartUploadPart.new( bucket_name: @bucket_name, object_key: @object_key, multipart_upload_id: @id, part_number: part_number, client: @client ) end
def parts(options = {})
-
(MultipartUploadPart::Collection)
-
Options Hash:
(**options)
-
:sse_customer_key_md5
(String
) -- -
:sse_customer_key
(String
) -- -
:sse_customer_algorithm
(String
) -- -
:expected_bucket_owner
(String
) -- -
:request_payer
(String
) --
Parameters:
-
options
(Hash
) -- ({})
Other tags:
- Example: Request syntax with placeholder values -
def parts(options = {}) batches = Enumerator.new do |y| options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @id ) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.list_parts(options) end resp.each_page do |page| batch = [] page.data.parts.each do |p| batch << MultipartUploadPart.new( bucket_name: options[:bucket], object_key: options[:key], multipart_upload_id: options[:upload_id], part_number: p.part_number, data: p, client: @client ) end y.yield(batch) end end MultipartUploadPart::Collection.new(batches) end
def storage_class
-
(String)
-
def storage_class data[:storage_class] end
def upload_id
-
(String)
-
def upload_id data[:upload_id] end
def wait_until(options = {}, &block)
-
(Resource)
- if the waiter was successful
Options Hash:
(**options)
-
:before_wait
(Proc
) -- Callback -
:before_attempt
(Proc
) -- Callback -
:delay
(Integer
) -- Delay between each -
:max_attempts
(Integer
) -- Maximum number of
Raises:
-
(NotImplementedError)
- Raised when the resource does not -
(Aws::Waiters::Errors::UnexpectedError)
- Raised when an error is -
(Aws::Waiters::Errors::FailureStateError)
- Raised when the waiter
Other tags:
- Yieldparam: resource - to be used in the waiting condition.
Other tags:
- Note: - The waiting operation is performed on a copy. The original resource
Deprecated:
- Use [Aws::S3::Client] #wait_until instead
def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do Aws::Waiters::Waiter.new(options).wait({}) end end