aws-sdk-s3 1.103.0 → 1.120.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +139 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/bucket.rb +134 -34
- data/lib/aws-sdk-s3/bucket_acl.rb +18 -2
- data/lib/aws-sdk-s3/bucket_cors.rb +20 -4
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +24 -6
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +28 -6
- data/lib/aws-sdk-s3/bucket_logging.rb +18 -2
- data/lib/aws-sdk-s3/bucket_notification.rb +17 -5
- data/lib/aws-sdk-s3/bucket_policy.rb +20 -4
- data/lib/aws-sdk-s3/bucket_request_payment.rb +18 -2
- data/lib/aws-sdk-s3/bucket_tagging.rb +20 -4
- data/lib/aws-sdk-s3/bucket_versioning.rb +54 -6
- data/lib/aws-sdk-s3/bucket_website.rb +20 -4
- data/lib/aws-sdk-s3/client.rb +2574 -1199
- data/lib/aws-sdk-s3/client_api.rb +574 -208
- data/lib/aws-sdk-s3/customizations/bucket.rb +20 -46
- data/lib/aws-sdk-s3/customizations/errors.rb +27 -0
- data/lib/aws-sdk-s3/customizations/object.rb +80 -4
- data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
- data/lib/aws-sdk-s3/customizations.rb +2 -0
- data/lib/aws-sdk-s3/endpoint_parameters.rb +142 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +733 -0
- data/lib/aws-sdk-s3/endpoints.rb +2149 -0
- data/lib/aws-sdk-s3/file_downloader.rb +1 -1
- data/lib/aws-sdk-s3/file_uploader.rb +5 -0
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +26 -7
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +36 -10
- data/lib/aws-sdk-s3/multipart_upload.rb +126 -12
- data/lib/aws-sdk-s3/multipart_upload_part.rb +133 -14
- data/lib/aws-sdk-s3/object.rb +289 -112
- data/lib/aws-sdk-s3/object_acl.rb +20 -4
- data/lib/aws-sdk-s3/object_multipart_copier.rb +11 -5
- data/lib/aws-sdk-s3/object_summary.rb +204 -74
- data/lib/aws-sdk-s3/object_version.rb +68 -40
- data/lib/aws-sdk-s3/plugins/accelerate.rb +3 -44
- data/lib/aws-sdk-s3/plugins/arn.rb +0 -197
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +3 -39
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +1 -6
- data/lib/aws-sdk-s3/plugins/dualstack.rb +1 -55
- data/lib/aws-sdk-s3/plugins/endpoints.rb +262 -0
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +2 -1
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +6 -29
- data/lib/aws-sdk-s3/plugins/md5s.rb +5 -3
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +33 -109
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +23 -2
- data/lib/aws-sdk-s3/presigned_post.rb +47 -35
- data/lib/aws-sdk-s3/presigner.rb +20 -33
- data/lib/aws-sdk-s3/resource.rb +19 -1
- data/lib/aws-sdk-s3/types.rb +2519 -4175
- data/lib/aws-sdk-s3.rb +5 -1
- metadata +11 -9
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +0 -69
- data/lib/aws-sdk-s3/arn/multi_region_access_point_arn.rb +0 -69
- data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +0 -69
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +0 -73
- data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +0 -25
@@ -134,7 +134,7 @@ module Aws
|
|
134
134
|
def write(resp)
|
135
135
|
range, _ = resp.content_range.split(' ').last.split('/')
|
136
136
|
head, _ = range.split('-').map {|s| s.to_i}
|
137
|
-
|
137
|
+
File.write(@path, resp.body.read, head)
|
138
138
|
end
|
139
139
|
|
140
140
|
def single_request
|
@@ -32,11 +32,16 @@ module Aws
|
|
32
32
|
# @option options [Proc] :progress_callback
|
33
33
|
# A Proc that will be called when each chunk of the upload is sent.
|
34
34
|
# It will be invoked with [bytes_read], [total_sizes]
|
35
|
+
# @option options [Integer] :thread_count
|
36
|
+
# The thread count to use for multipart uploads. Ignored for
|
37
|
+
# objects smaller than the multipart threshold.
|
35
38
|
# @return [void]
|
36
39
|
def upload(source, options = {})
|
37
40
|
if File.size(source) >= multipart_threshold
|
38
41
|
MultipartFileUploader.new(@options).upload(source, options)
|
39
42
|
else
|
43
|
+
# remove multipart parameters not supported by put_object
|
44
|
+
options.delete(:thread_count)
|
40
45
|
put_object(source, options)
|
41
46
|
end
|
42
47
|
end
|
@@ -21,6 +21,10 @@ module Aws
|
|
21
21
|
Client.api.operation(:create_multipart_upload).input.shape.member_names
|
22
22
|
)
|
23
23
|
|
24
|
+
COMPLETE_OPTIONS = Set.new(
|
25
|
+
Client.api.operation(:complete_multipart_upload).input.shape.member_names
|
26
|
+
)
|
27
|
+
|
24
28
|
# @api private
|
25
29
|
UPLOAD_PART_OPTIONS = Set.new(
|
26
30
|
Client.api.operation(:upload_part).input.shape.member_names
|
@@ -42,7 +46,7 @@ module Aws
|
|
42
46
|
# @option options [Proc] :progress_callback
|
43
47
|
# A Proc that will be called when each chunk of the upload is sent.
|
44
48
|
# It will be invoked with [bytes_read], [total_sizes]
|
45
|
-
# @return [
|
49
|
+
# @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
|
46
50
|
def upload(source, options = {})
|
47
51
|
if File.size(source) < MIN_PART_SIZE
|
48
52
|
raise ArgumentError, FILE_TOO_SMALL
|
@@ -61,10 +65,10 @@ module Aws
|
|
61
65
|
|
62
66
|
def complete_upload(upload_id, parts, options)
|
63
67
|
@client.complete_multipart_upload(
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
+
**complete_opts(options).merge(
|
69
|
+
upload_id: upload_id,
|
70
|
+
multipart_upload: { parts: parts }
|
71
|
+
)
|
68
72
|
)
|
69
73
|
end
|
70
74
|
|
@@ -123,6 +127,13 @@ module Aws
|
|
123
127
|
end
|
124
128
|
end
|
125
129
|
|
130
|
+
def complete_opts(options)
|
131
|
+
COMPLETE_OPTIONS.inject({}) do |hash, key|
|
132
|
+
hash[key] = options[key] if options.key?(key)
|
133
|
+
hash
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
126
137
|
def upload_part_opts(options)
|
127
138
|
UPLOAD_PART_OPTIONS.inject({}) do |hash, key|
|
128
139
|
hash[key] = options[key] if options.key?(key)
|
@@ -147,7 +158,15 @@ module Aws
|
|
147
158
|
end
|
148
159
|
resp = @client.upload_part(part)
|
149
160
|
part[:body].close
|
150
|
-
|
161
|
+
completed_part = {etag: resp.etag, part_number: part[:part_number]}
|
162
|
+
|
163
|
+
# get the requested checksum from the response
|
164
|
+
if part[:checksum_algorithm]
|
165
|
+
k = "checksum_#{part[:checksum_algorithm].downcase}".to_sym
|
166
|
+
completed_part[k] = resp[k]
|
167
|
+
end
|
168
|
+
|
169
|
+
completed.push(completed_part)
|
151
170
|
end
|
152
171
|
nil
|
153
172
|
rescue => error
|
@@ -224,4 +243,4 @@ module Aws
|
|
224
243
|
end
|
225
244
|
end
|
226
245
|
end
|
227
|
-
end
|
246
|
+
end
|
@@ -26,6 +26,10 @@ module Aws
|
|
26
26
|
UPLOAD_PART_OPTIONS =
|
27
27
|
Set.new(Client.api.operation(:upload_part).input.shape.member_names)
|
28
28
|
|
29
|
+
# @api private
|
30
|
+
COMPLETE_UPLOAD_OPTIONS =
|
31
|
+
Set.new(Client.api.operation(:complete_multipart_upload).input.shape.member_names)
|
32
|
+
|
29
33
|
# @option options [Client] :client
|
30
34
|
def initialize(options = {})
|
31
35
|
@client = options[:client] || Client.new
|
@@ -39,7 +43,7 @@ module Aws
|
|
39
43
|
|
40
44
|
# @option options [required,String] :bucket
|
41
45
|
# @option options [required,String] :key
|
42
|
-
# @return [
|
46
|
+
# @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
|
43
47
|
def upload(options = {}, &block)
|
44
48
|
upload_id = initiate_upload(options)
|
45
49
|
parts = upload_parts(upload_id, options, &block)
|
@@ -54,17 +58,22 @@ module Aws
|
|
54
58
|
|
55
59
|
def complete_upload(upload_id, parts, options)
|
56
60
|
@client.complete_multipart_upload(
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
**complete_opts(options).merge(
|
62
|
+
upload_id: upload_id,
|
63
|
+
multipart_upload: { parts: parts }
|
64
|
+
)
|
65
|
+
)
|
61
66
|
end
|
62
67
|
|
63
68
|
def upload_parts(upload_id, options, &block)
|
64
69
|
completed = Queue.new
|
70
|
+
thread_errors = []
|
65
71
|
errors = begin
|
66
72
|
IO.pipe do |read_pipe, write_pipe|
|
67
|
-
threads = upload_in_threads(
|
73
|
+
threads = upload_in_threads(
|
74
|
+
read_pipe, completed,
|
75
|
+
upload_part_opts(options).merge(upload_id: upload_id),
|
76
|
+
thread_errors)
|
68
77
|
begin
|
69
78
|
block.call(write_pipe)
|
70
79
|
ensure
|
@@ -74,7 +83,7 @@ module Aws
|
|
74
83
|
threads.map(&:value).compact
|
75
84
|
end
|
76
85
|
rescue => e
|
77
|
-
[e]
|
86
|
+
thread_errors + [e]
|
78
87
|
end
|
79
88
|
|
80
89
|
if errors.empty?
|
@@ -113,6 +122,13 @@ module Aws
|
|
113
122
|
end
|
114
123
|
end
|
115
124
|
|
125
|
+
def complete_opts(options)
|
126
|
+
COMPLETE_UPLOAD_OPTIONS.inject({}) do |hash, key|
|
127
|
+
hash[key] = options[key] if options.key?(key)
|
128
|
+
hash
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
116
132
|
def read_to_part_body(read_pipe)
|
117
133
|
return if read_pipe.closed?
|
118
134
|
temp_io = @tempfile ? Tempfile.new(TEMPFILE_PREIX) : StringIO.new(String.new)
|
@@ -130,7 +146,7 @@ module Aws
|
|
130
146
|
end
|
131
147
|
end
|
132
148
|
|
133
|
-
def upload_in_threads(read_pipe, completed, options)
|
149
|
+
def upload_in_threads(read_pipe, completed, options, thread_errors)
|
134
150
|
mutex = Mutex.new
|
135
151
|
part_number = 0
|
136
152
|
@thread_count.times.map do
|
@@ -147,7 +163,14 @@ module Aws
|
|
147
163
|
part_number: thread_part_number,
|
148
164
|
)
|
149
165
|
resp = @client.upload_part(part)
|
150
|
-
|
166
|
+
completed_part = {etag: resp.etag, part_number: part[:part_number]}
|
167
|
+
|
168
|
+
# get the requested checksum from the response
|
169
|
+
if part[:checksum_algorithm]
|
170
|
+
k = "checksum_#{part[:checksum_algorithm].downcase}".to_sym
|
171
|
+
completed_part[k] = resp[k]
|
172
|
+
end
|
173
|
+
completed.push(completed_part)
|
151
174
|
ensure
|
152
175
|
if Tempfile === body
|
153
176
|
body.close
|
@@ -160,7 +183,10 @@ module Aws
|
|
160
183
|
nil
|
161
184
|
rescue => error
|
162
185
|
# keep other threads from uploading other parts
|
163
|
-
mutex.synchronize
|
186
|
+
mutex.synchronize do
|
187
|
+
thread_errors.push(error)
|
188
|
+
read_pipe.close_read unless read_pipe.closed?
|
189
|
+
end
|
164
190
|
error
|
165
191
|
end
|
166
192
|
end
|
@@ -87,6 +87,12 @@ module Aws::S3
|
|
87
87
|
data[:initiator]
|
88
88
|
end
|
89
89
|
|
90
|
+
# The algorithm that was used to create a checksum of the object.
|
91
|
+
# @return [String]
|
92
|
+
def checksum_algorithm
|
93
|
+
data[:checksum_algorithm]
|
94
|
+
end
|
95
|
+
|
90
96
|
# @!endgroup
|
91
97
|
|
92
98
|
# @return [Client]
|
@@ -226,8 +232,8 @@ module Aws::S3
|
|
226
232
|
# @option options [String] :request_payer
|
227
233
|
# Confirms that the requester knows that they will be charged for the
|
228
234
|
# request. Bucket owners need not specify this parameter in their
|
229
|
-
# requests. For information about downloading objects from
|
230
|
-
#
|
235
|
+
# requests. For information about downloading objects from Requester
|
236
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
231
237
|
# in the *Amazon S3 User Guide*.
|
232
238
|
#
|
233
239
|
#
|
@@ -235,8 +241,8 @@ module Aws::S3
|
|
235
241
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
236
242
|
# @option options [String] :expected_bucket_owner
|
237
243
|
# The account ID of the expected bucket owner. If the bucket is owned by
|
238
|
-
# a different account, the request
|
239
|
-
#
|
244
|
+
# a different account, the request fails with the HTTP status code `403
|
245
|
+
# Forbidden` (access denied).
|
240
246
|
# @return [Types::AbortMultipartUploadOutput]
|
241
247
|
def abort(options = {})
|
242
248
|
options = options.merge(
|
@@ -255,21 +261,72 @@ module Aws::S3
|
|
255
261
|
# parts: [
|
256
262
|
# {
|
257
263
|
# etag: "ETag",
|
264
|
+
# checksum_crc32: "ChecksumCRC32",
|
265
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
266
|
+
# checksum_sha1: "ChecksumSHA1",
|
267
|
+
# checksum_sha256: "ChecksumSHA256",
|
258
268
|
# part_number: 1,
|
259
269
|
# },
|
260
270
|
# ],
|
261
271
|
# },
|
272
|
+
# checksum_crc32: "ChecksumCRC32",
|
273
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
274
|
+
# checksum_sha1: "ChecksumSHA1",
|
275
|
+
# checksum_sha256: "ChecksumSHA256",
|
262
276
|
# request_payer: "requester", # accepts requester
|
263
277
|
# expected_bucket_owner: "AccountId",
|
278
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
279
|
+
# sse_customer_key: "SSECustomerKey",
|
280
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
264
281
|
# })
|
265
282
|
# @param [Hash] options ({})
|
266
283
|
# @option options [Types::CompletedMultipartUpload] :multipart_upload
|
267
284
|
# The container for the multipart upload request information.
|
285
|
+
# @option options [String] :checksum_crc32
|
286
|
+
# This header can be used as a data integrity check to verify that the
|
287
|
+
# data received is the same data that was originally sent. This header
|
288
|
+
# specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
|
289
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
290
|
+
# User Guide*.
|
291
|
+
#
|
292
|
+
#
|
293
|
+
#
|
294
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
295
|
+
# @option options [String] :checksum_crc32c
|
296
|
+
# This header can be used as a data integrity check to verify that the
|
297
|
+
# data received is the same data that was originally sent. This header
|
298
|
+
# specifies the base64-encoded, 32-bit CRC32C checksum of the object.
|
299
|
+
# For more information, see [Checking object integrity][1] in the
|
300
|
+
# *Amazon S3 User Guide*.
|
301
|
+
#
|
302
|
+
#
|
303
|
+
#
|
304
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
305
|
+
# @option options [String] :checksum_sha1
|
306
|
+
# This header can be used as a data integrity check to verify that the
|
307
|
+
# data received is the same data that was originally sent. This header
|
308
|
+
# specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
|
309
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
310
|
+
# User Guide*.
|
311
|
+
#
|
312
|
+
#
|
313
|
+
#
|
314
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
315
|
+
# @option options [String] :checksum_sha256
|
316
|
+
# This header can be used as a data integrity check to verify that the
|
317
|
+
# data received is the same data that was originally sent. This header
|
318
|
+
# specifies the base64-encoded, 256-bit SHA-256 digest of the object.
|
319
|
+
# For more information, see [Checking object integrity][1] in the
|
320
|
+
# *Amazon S3 User Guide*.
|
321
|
+
#
|
322
|
+
#
|
323
|
+
#
|
324
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
268
325
|
# @option options [String] :request_payer
|
269
326
|
# Confirms that the requester knows that they will be charged for the
|
270
327
|
# request. Bucket owners need not specify this parameter in their
|
271
|
-
# requests. For information about downloading objects from
|
272
|
-
#
|
328
|
+
# requests. For information about downloading objects from Requester
|
329
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
273
330
|
# in the *Amazon S3 User Guide*.
|
274
331
|
#
|
275
332
|
#
|
@@ -277,8 +334,35 @@ module Aws::S3
|
|
277
334
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
278
335
|
# @option options [String] :expected_bucket_owner
|
279
336
|
# The account ID of the expected bucket owner. If the bucket is owned by
|
280
|
-
# a different account, the request
|
281
|
-
#
|
337
|
+
# a different account, the request fails with the HTTP status code `403
|
338
|
+
# Forbidden` (access denied).
|
339
|
+
# @option options [String] :sse_customer_algorithm
|
340
|
+
# The server-side encryption (SSE) algorithm used to encrypt the object.
|
341
|
+
# This parameter is needed only when the object was created using a
|
342
|
+
# checksum algorithm. For more information, see [Protecting data using
|
343
|
+
# SSE-C keys][1] in the *Amazon S3 User Guide*.
|
344
|
+
#
|
345
|
+
#
|
346
|
+
#
|
347
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
348
|
+
# @option options [String] :sse_customer_key
|
349
|
+
# The server-side encryption (SSE) customer managed key. This parameter
|
350
|
+
# is needed only when the object was created using a checksum algorithm.
|
351
|
+
# For more information, see [Protecting data using SSE-C keys][1] in the
|
352
|
+
# *Amazon S3 User Guide*.
|
353
|
+
#
|
354
|
+
#
|
355
|
+
#
|
356
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
357
|
+
# @option options [String] :sse_customer_key_md5
|
358
|
+
# The MD5 server-side encryption (SSE) customer managed key. This
|
359
|
+
# parameter is needed only when the object was created using a checksum
|
360
|
+
# algorithm. For more information, see [Protecting data using SSE-C
|
361
|
+
# keys][1] in the *Amazon S3 User Guide*.
|
362
|
+
#
|
363
|
+
#
|
364
|
+
#
|
365
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
282
366
|
# @return [Object]
|
283
367
|
def complete(options = {})
|
284
368
|
options = options.merge(
|
@@ -322,13 +406,16 @@ module Aws::S3
|
|
322
406
|
# parts = multipart_upload.parts({
|
323
407
|
# request_payer: "requester", # accepts requester
|
324
408
|
# expected_bucket_owner: "AccountId",
|
409
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
410
|
+
# sse_customer_key: "SSECustomerKey",
|
411
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
325
412
|
# })
|
326
413
|
# @param [Hash] options ({})
|
327
414
|
# @option options [String] :request_payer
|
328
415
|
# Confirms that the requester knows that they will be charged for the
|
329
416
|
# request. Bucket owners need not specify this parameter in their
|
330
|
-
# requests. For information about downloading objects from
|
331
|
-
#
|
417
|
+
# requests. For information about downloading objects from Requester
|
418
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
332
419
|
# in the *Amazon S3 User Guide*.
|
333
420
|
#
|
334
421
|
#
|
@@ -336,8 +423,35 @@ module Aws::S3
|
|
336
423
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
337
424
|
# @option options [String] :expected_bucket_owner
|
338
425
|
# The account ID of the expected bucket owner. If the bucket is owned by
|
339
|
-
# a different account, the request
|
340
|
-
#
|
426
|
+
# a different account, the request fails with the HTTP status code `403
|
427
|
+
# Forbidden` (access denied).
|
428
|
+
# @option options [String] :sse_customer_algorithm
|
429
|
+
# The server-side encryption (SSE) algorithm used to encrypt the object.
|
430
|
+
# This parameter is needed only when the object was created using a
|
431
|
+
# checksum algorithm. For more information, see [Protecting data using
|
432
|
+
# SSE-C keys][1] in the *Amazon S3 User Guide*.
|
433
|
+
#
|
434
|
+
#
|
435
|
+
#
|
436
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
437
|
+
# @option options [String] :sse_customer_key
|
438
|
+
# The server-side encryption (SSE) customer managed key. This parameter
|
439
|
+
# is needed only when the object was created using a checksum algorithm.
|
440
|
+
# For more information, see [Protecting data using SSE-C keys][1] in the
|
441
|
+
# *Amazon S3 User Guide*.
|
442
|
+
#
|
443
|
+
#
|
444
|
+
#
|
445
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
446
|
+
# @option options [String] :sse_customer_key_md5
|
447
|
+
# The MD5 server-side encryption (SSE) customer managed key. This
|
448
|
+
# parameter is needed only when the object was created using a checksum
|
449
|
+
# algorithm. For more information, see [Protecting data using SSE-C
|
450
|
+
# keys][1] in the *Amazon S3 User Guide*.
|
451
|
+
#
|
452
|
+
#
|
453
|
+
#
|
454
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
341
455
|
# @return [MultipartUploadPart::Collection]
|
342
456
|
def parts(options = {})
|
343
457
|
batches = Enumerator.new do |y|
|
@@ -76,6 +76,62 @@ module Aws::S3
|
|
76
76
|
data[:size]
|
77
77
|
end
|
78
78
|
|
79
|
+
# This header can be used as a data integrity check to verify that the
|
80
|
+
# data received is the same data that was originally sent. This header
|
81
|
+
# specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
|
82
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
83
|
+
# User Guide*.
|
84
|
+
#
|
85
|
+
#
|
86
|
+
#
|
87
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
88
|
+
# @return [String]
|
89
|
+
def checksum_crc32
|
90
|
+
data[:checksum_crc32]
|
91
|
+
end
|
92
|
+
|
93
|
+
# The base64-encoded, 32-bit CRC32C checksum of the object. This will
|
94
|
+
# only be present if it was uploaded with the object. With multipart
|
95
|
+
# uploads, this may not be a checksum value of the object. For more
|
96
|
+
# information about how checksums are calculated with multipart uploads,
|
97
|
+
# see [ Checking object integrity][1] in the *Amazon S3 User Guide*.
|
98
|
+
#
|
99
|
+
#
|
100
|
+
#
|
101
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
102
|
+
# @return [String]
|
103
|
+
def checksum_crc32c
|
104
|
+
data[:checksum_crc32c]
|
105
|
+
end
|
106
|
+
|
107
|
+
# The base64-encoded, 160-bit SHA-1 digest of the object. This will only
|
108
|
+
# be present if it was uploaded with the object. With multipart uploads,
|
109
|
+
# this may not be a checksum value of the object. For more information
|
110
|
+
# about how checksums are calculated with multipart uploads, see [
|
111
|
+
# Checking object integrity][1] in the *Amazon S3 User Guide*.
|
112
|
+
#
|
113
|
+
#
|
114
|
+
#
|
115
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
|
116
|
+
# @return [String]
|
117
|
+
def checksum_sha1
|
118
|
+
data[:checksum_sha1]
|
119
|
+
end
|
120
|
+
|
121
|
+
# This header can be used as a data integrity check to verify that the
|
122
|
+
# data received is the same data that was originally sent. This header
|
123
|
+
# specifies the base64-encoded, 256-bit SHA-256 digest of the object.
|
124
|
+
# For more information, see [Checking object integrity][1] in the
|
125
|
+
# *Amazon S3 User Guide*.
|
126
|
+
#
|
127
|
+
#
|
128
|
+
#
|
129
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
130
|
+
# @return [String]
|
131
|
+
def checksum_sha256
|
132
|
+
data[:checksum_sha256]
|
133
|
+
end
|
134
|
+
|
79
135
|
# @!endgroup
|
80
136
|
|
81
137
|
# @return [Client]
|
@@ -228,14 +284,14 @@ module Aws::S3
|
|
228
284
|
# @option options [required, String] :copy_source
|
229
285
|
# Specifies the source object for the copy operation. You specify the
|
230
286
|
# value in one of two formats, depending on whether you want to access
|
231
|
-
# the source object through an [access point][1]
|
287
|
+
# the source object through an [access point][1]:
|
232
288
|
#
|
233
289
|
# * For objects not accessed through an access point, specify the name
|
234
290
|
# of the source bucket and key of the source object, separated by a
|
235
291
|
# slash (/). For example, to copy the object `reports/january.pdf`
|
236
292
|
# from the bucket `awsexamplebucket`, use
|
237
|
-
# `awsexamplebucket/reports/january.pdf`. The value must be
|
238
|
-
# encoded.
|
293
|
+
# `awsexamplebucket/reports/january.pdf`. The value must be
|
294
|
+
# URL-encoded.
|
239
295
|
#
|
240
296
|
# * For objects accessed through access points, specify the Amazon
|
241
297
|
# Resource Name (ARN) of the object as accessed through the access
|
@@ -260,7 +316,7 @@ module Aws::S3
|
|
260
316
|
# outpost `my-outpost` owned by account `123456789012` in Region
|
261
317
|
# `us-west-2`, use the URL encoding of
|
262
318
|
# `arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf`.
|
263
|
-
# The value must be URL
|
319
|
+
# The value must be URL-encoded.
|
264
320
|
#
|
265
321
|
# To copy a specific version of an object, append
|
266
322
|
# `?versionId=<version-id>` to the value (for example,
|
@@ -316,8 +372,8 @@ module Aws::S3
|
|
316
372
|
# @option options [String] :request_payer
|
317
373
|
# Confirms that the requester knows that they will be charged for the
|
318
374
|
# request. Bucket owners need not specify this parameter in their
|
319
|
-
# requests. For information about downloading objects from
|
320
|
-
#
|
375
|
+
# requests. For information about downloading objects from Requester
|
376
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
321
377
|
# in the *Amazon S3 User Guide*.
|
322
378
|
#
|
323
379
|
#
|
@@ -325,12 +381,12 @@ module Aws::S3
|
|
325
381
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
326
382
|
# @option options [String] :expected_bucket_owner
|
327
383
|
# The account ID of the expected destination bucket owner. If the
|
328
|
-
# destination bucket is owned by a different account, the request
|
329
|
-
#
|
384
|
+
# destination bucket is owned by a different account, the request fails
|
385
|
+
# with the HTTP status code `403 Forbidden` (access denied).
|
330
386
|
# @option options [String] :expected_source_bucket_owner
|
331
387
|
# The account ID of the expected source bucket owner. If the source
|
332
|
-
# bucket is owned by a different account, the request
|
333
|
-
# HTTP `403 (
|
388
|
+
# bucket is owned by a different account, the request fails with the
|
389
|
+
# HTTP status code `403 Forbidden` (access denied).
|
334
390
|
# @return [Types::UploadPartCopyOutput]
|
335
391
|
def copy_from(options = {})
|
336
392
|
options = options.merge(
|
@@ -349,6 +405,11 @@ module Aws::S3
|
|
349
405
|
# body: source_file,
|
350
406
|
# content_length: 1,
|
351
407
|
# content_md5: "ContentMD5",
|
408
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
409
|
+
# checksum_crc32: "ChecksumCRC32",
|
410
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
411
|
+
# checksum_sha1: "ChecksumSHA1",
|
412
|
+
# checksum_sha256: "ChecksumSHA256",
|
352
413
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
353
414
|
# sse_customer_key: "SSECustomerKey",
|
354
415
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
@@ -365,6 +426,64 @@ module Aws::S3
|
|
365
426
|
# The base64-encoded 128-bit MD5 digest of the part data. This parameter
|
366
427
|
# is auto-populated when using the command from the CLI. This parameter
|
367
428
|
# is required if object lock parameters are specified.
|
429
|
+
# @option options [String] :checksum_algorithm
|
430
|
+
# Indicates the algorithm used to create the checksum for the object
|
431
|
+
# when using the SDK. This header will not provide any additional
|
432
|
+
# functionality if not using the SDK. When sending this header, there
|
433
|
+
# must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
|
434
|
+
# sent. Otherwise, Amazon S3 fails the request with the HTTP status code
|
435
|
+
# `400 Bad Request`. For more information, see [Checking object
|
436
|
+
# integrity][1] in the *Amazon S3 User Guide*.
|
437
|
+
#
|
438
|
+
# If you provide an individual checksum, Amazon S3 ignores any provided
|
439
|
+
# `ChecksumAlgorithm` parameter.
|
440
|
+
#
|
441
|
+
# This checksum algorithm must be the same for all parts and it match
|
442
|
+
# the checksum value supplied in the `CreateMultipartUpload` request.
|
443
|
+
#
|
444
|
+
#
|
445
|
+
#
|
446
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
447
|
+
# @option options [String] :checksum_crc32
|
448
|
+
# This header can be used as a data integrity check to verify that the
|
449
|
+
# data received is the same data that was originally sent. This header
|
450
|
+
# specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
|
451
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
452
|
+
# User Guide*.
|
453
|
+
#
|
454
|
+
#
|
455
|
+
#
|
456
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
457
|
+
# @option options [String] :checksum_crc32c
|
458
|
+
# This header can be used as a data integrity check to verify that the
|
459
|
+
# data received is the same data that was originally sent. This header
|
460
|
+
# specifies the base64-encoded, 32-bit CRC32C checksum of the object.
|
461
|
+
# For more information, see [Checking object integrity][1] in the
|
462
|
+
# *Amazon S3 User Guide*.
|
463
|
+
#
|
464
|
+
#
|
465
|
+
#
|
466
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
467
|
+
# @option options [String] :checksum_sha1
|
468
|
+
# This header can be used as a data integrity check to verify that the
|
469
|
+
# data received is the same data that was originally sent. This header
|
470
|
+
# specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
|
471
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
472
|
+
# User Guide*.
|
473
|
+
#
|
474
|
+
#
|
475
|
+
#
|
476
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
477
|
+
# @option options [String] :checksum_sha256
|
478
|
+
# This header can be used as a data integrity check to verify that the
|
479
|
+
# data received is the same data that was originally sent. This header
|
480
|
+
# specifies the base64-encoded, 256-bit SHA-256 digest of the object.
|
481
|
+
# For more information, see [Checking object integrity][1] in the
|
482
|
+
# *Amazon S3 User Guide*.
|
483
|
+
#
|
484
|
+
#
|
485
|
+
#
|
486
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
368
487
|
# @option options [String] :sse_customer_algorithm
|
369
488
|
# Specifies the algorithm to use to when encrypting the object (for
|
370
489
|
# example, AES256).
|
@@ -383,8 +502,8 @@ module Aws::S3
|
|
383
502
|
# @option options [String] :request_payer
|
384
503
|
# Confirms that the requester knows that they will be charged for the
|
385
504
|
# request. Bucket owners need not specify this parameter in their
|
386
|
-
# requests. For information about downloading objects from
|
387
|
-
#
|
505
|
+
# requests. For information about downloading objects from Requester
|
506
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
388
507
|
# in the *Amazon S3 User Guide*.
|
389
508
|
#
|
390
509
|
#
|
@@ -392,8 +511,8 @@ module Aws::S3
|
|
392
511
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
393
512
|
# @option options [String] :expected_bucket_owner
|
394
513
|
# The account ID of the expected bucket owner. If the bucket is owned by
|
395
|
-
# a different account, the request
|
396
|
-
#
|
514
|
+
# a different account, the request fails with the HTTP status code `403
|
515
|
+
# Forbidden` (access denied).
|
397
516
|
# @return [Types::UploadPartOutput]
|
398
517
|
def upload(options = {})
|
399
518
|
options = options.merge(
|