aws-sdk-s3 1.10.0 → 1.208.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1517 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
- data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
- data/lib/aws-sdk-s3/bucket.rb +1062 -99
- data/lib/aws-sdk-s3/bucket_acl.rb +67 -17
- data/lib/aws-sdk-s3/bucket_cors.rb +80 -17
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +71 -19
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +126 -20
- data/lib/aws-sdk-s3/bucket_logging.rb +68 -18
- data/lib/aws-sdk-s3/bucket_notification.rb +56 -20
- data/lib/aws-sdk-s3/bucket_policy.rb +108 -17
- data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
- data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
- data/lib/aws-sdk-s3/bucket_tagging.rb +71 -17
- data/lib/aws-sdk-s3/bucket_versioning.rb +166 -17
- data/lib/aws-sdk-s3/bucket_website.rb +78 -17
- data/lib/aws-sdk-s3/client.rb +20068 -3879
- data/lib/aws-sdk-s3/client_api.rb +1957 -209
- data/lib/aws-sdk-s3/customizations/bucket.rb +57 -38
- data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
- data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
- data/lib/aws-sdk-s3/customizations/object.rb +338 -68
- data/lib/aws-sdk-s3/customizations/object_summary.rb +17 -0
- data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
- data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
- data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
- data/lib/aws-sdk-s3/customizations.rb +30 -27
- data/lib/aws-sdk-s3/default_executor.rb +103 -0
- data/lib/aws-sdk-s3/encryption/client.rb +29 -8
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
- data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +45 -5
- data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +15 -2
- data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +11 -3
- data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
- data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +48 -11
- data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
- data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
- data/lib/aws-sdk-s3/encryption.rb +4 -0
- data/lib/aws-sdk-s3/encryptionV2/client.rb +645 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +68 -0
- data/lib/aws-sdk-s3/encryptionV2/decryption.rb +205 -0
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +187 -0
- data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +67 -0
- data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
- data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +75 -0
- data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +181 -0
- data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV2/utils.rb +108 -0
- data/lib/aws-sdk-s3/encryptionV3/client.rb +885 -0
- data/lib/aws-sdk-s3/encryptionV3/decrypt_handler.rb +98 -0
- data/lib/aws-sdk-s3/encryptionV3/decryption.rb +244 -0
- data/lib/aws-sdk-s3/encryptionV3/default_cipher_provider.rb +159 -0
- data/lib/aws-sdk-s3/encryptionV3/default_key_provider.rb +35 -0
- data/lib/aws-sdk-s3/encryptionV3/encrypt_handler.rb +98 -0
- data/lib/aws-sdk-s3/encryptionV3/errors.rb +47 -0
- data/lib/aws-sdk-s3/encryptionV3/io_auth_decrypter.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV3/io_decrypter.rb +35 -0
- data/lib/aws-sdk-s3/encryptionV3/io_encrypter.rb +84 -0
- data/lib/aws-sdk-s3/encryptionV3/key_provider.rb +28 -0
- data/lib/aws-sdk-s3/encryptionV3/kms_cipher_provider.rb +159 -0
- data/lib/aws-sdk-s3/encryptionV3/materials.rb +58 -0
- data/lib/aws-sdk-s3/encryptionV3/utils.rb +321 -0
- data/lib/aws-sdk-s3/encryption_v2.rb +24 -0
- data/lib/aws-sdk-s3/encryption_v3.rb +24 -0
- data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +886 -0
- data/lib/aws-sdk-s3/endpoints.rb +1544 -0
- data/lib/aws-sdk-s3/errors.rb +181 -1
- data/lib/aws-sdk-s3/event_streams.rb +69 -0
- data/lib/aws-sdk-s3/express_credentials.rb +55 -0
- data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
- data/lib/aws-sdk-s3/file_downloader.rb +261 -82
- data/lib/aws-sdk-s3/file_part.rb +16 -13
- data/lib/aws-sdk-s3/file_uploader.rb +37 -22
- data/lib/aws-sdk-s3/legacy_signer.rb +19 -26
- data/lib/aws-sdk-s3/multipart_download_error.rb +8 -0
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +142 -80
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +191 -0
- data/lib/aws-sdk-s3/multipart_upload.rb +342 -31
- data/lib/aws-sdk-s3/multipart_upload_error.rb +5 -4
- data/lib/aws-sdk-s3/multipart_upload_part.rb +387 -47
- data/lib/aws-sdk-s3/object.rb +2733 -204
- data/lib/aws-sdk-s3/object_acl.rb +112 -25
- data/lib/aws-sdk-s3/object_copier.rb +9 -5
- data/lib/aws-sdk-s3/object_multipart_copier.rb +50 -23
- data/lib/aws-sdk-s3/object_summary.rb +2265 -181
- data/lib/aws-sdk-s3/object_version.rb +542 -74
- data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
- data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
- data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
- data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
- data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
- data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +88 -0
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +62 -17
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
- data/lib/aws-sdk-s3/plugins/md5s.rb +14 -67
- data/lib/aws-sdk-s3/plugins/redirects.rb +5 -1
- data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +67 -93
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +137 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +4 -1
- data/lib/aws-sdk-s3/presigned_post.rb +160 -99
- data/lib/aws-sdk-s3/presigner.rb +178 -81
- data/lib/aws-sdk-s3/resource.rb +164 -15
- data/lib/aws-sdk-s3/transfer_manager.rb +303 -0
- data/lib/aws-sdk-s3/types.rb +15981 -4168
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +46 -31
- data/sig/bucket.rbs +231 -0
- data/sig/bucket_acl.rbs +78 -0
- data/sig/bucket_cors.rbs +69 -0
- data/sig/bucket_lifecycle.rbs +88 -0
- data/sig/bucket_lifecycle_configuration.rbs +115 -0
- data/sig/bucket_logging.rbs +76 -0
- data/sig/bucket_notification.rbs +114 -0
- data/sig/bucket_policy.rbs +59 -0
- data/sig/bucket_request_payment.rbs +54 -0
- data/sig/bucket_tagging.rbs +65 -0
- data/sig/bucket_versioning.rbs +77 -0
- data/sig/bucket_website.rbs +93 -0
- data/sig/client.rbs +2612 -0
- data/sig/customizations/bucket.rbs +19 -0
- data/sig/customizations/object.rbs +38 -0
- data/sig/customizations/object_summary.rbs +35 -0
- data/sig/errors.rbs +44 -0
- data/sig/multipart_upload.rbs +120 -0
- data/sig/multipart_upload_part.rbs +109 -0
- data/sig/object.rbs +464 -0
- data/sig/object_acl.rbs +86 -0
- data/sig/object_summary.rbs +347 -0
- data/sig/object_version.rbs +143 -0
- data/sig/resource.rbs +141 -0
- data/sig/types.rbs +2899 -0
- data/sig/waiters.rbs +95 -0
- metadata +97 -14
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
|
2
4
|
#
|
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
|
5
7
|
#
|
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
|
7
9
|
|
|
8
10
|
module Aws::S3
|
|
11
|
+
|
|
9
12
|
class MultipartUpload
|
|
10
13
|
|
|
11
14
|
extend Aws::Deprecations
|
|
@@ -27,6 +30,7 @@ module Aws::S3
|
|
|
27
30
|
@id = extract_id(args, options)
|
|
28
31
|
@data = options.delete(:data)
|
|
29
32
|
@client = options.delete(:client) || Client.new(options)
|
|
33
|
+
@waiter_block_warned = false
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @!group Read-Only Attributes
|
|
@@ -65,11 +69,25 @@ module Aws::S3
|
|
|
65
69
|
end
|
|
66
70
|
|
|
67
71
|
# The class of storage used to store the object.
|
|
72
|
+
#
|
|
73
|
+
# <note markdown="1"> **Directory buckets** - Directory buckets only support
|
|
74
|
+
# `EXPRESS_ONEZONE` (the S3 Express One Zone storage class) in
|
|
75
|
+
# Availability Zones and `ONEZONE_IA` (the S3 One Zone-Infrequent Access
|
|
76
|
+
# storage class) in Dedicated Local Zones.
|
|
77
|
+
#
|
|
78
|
+
# </note>
|
|
68
79
|
# @return [String]
|
|
69
80
|
def storage_class
|
|
70
81
|
data[:storage_class]
|
|
71
82
|
end
|
|
72
83
|
|
|
84
|
+
# Specifies the owner of the object that is part of the multipart
|
|
85
|
+
# upload.
|
|
86
|
+
#
|
|
87
|
+
# <note markdown="1"> **Directory buckets** - The bucket owner is returned as the object
|
|
88
|
+
# owner for all the objects.
|
|
89
|
+
#
|
|
90
|
+
# </note>
|
|
73
91
|
# @return [Types::Owner]
|
|
74
92
|
def owner
|
|
75
93
|
data[:owner]
|
|
@@ -81,6 +99,24 @@ module Aws::S3
|
|
|
81
99
|
data[:initiator]
|
|
82
100
|
end
|
|
83
101
|
|
|
102
|
+
# The algorithm that was used to create a checksum of the object.
|
|
103
|
+
# @return [String]
|
|
104
|
+
def checksum_algorithm
|
|
105
|
+
data[:checksum_algorithm]
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# The checksum type that is used to calculate the object’s checksum
|
|
109
|
+
# value. For more information, see [Checking object integrity][1] in the
|
|
110
|
+
# *Amazon S3 User Guide*.
|
|
111
|
+
#
|
|
112
|
+
#
|
|
113
|
+
#
|
|
114
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
115
|
+
# @return [String]
|
|
116
|
+
def checksum_type
|
|
117
|
+
data[:checksum_type]
|
|
118
|
+
end
|
|
119
|
+
|
|
84
120
|
# @!endgroup
|
|
85
121
|
|
|
86
122
|
# @return [Client]
|
|
@@ -116,7 +152,8 @@ module Aws::S3
|
|
|
116
152
|
# Waiter polls an API operation until a resource enters a desired
|
|
117
153
|
# state.
|
|
118
154
|
#
|
|
119
|
-
# @note The waiting operation is performed on a copy. The original resource
|
|
155
|
+
# @note The waiting operation is performed on a copy. The original resource
|
|
156
|
+
# remains unchanged.
|
|
120
157
|
#
|
|
121
158
|
# ## Basic Usage
|
|
122
159
|
#
|
|
@@ -129,13 +166,15 @@ module Aws::S3
|
|
|
129
166
|
#
|
|
130
167
|
# ## Example
|
|
131
168
|
#
|
|
132
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
|
169
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
|
170
|
+
# instance.state.name == 'running'
|
|
171
|
+
# end
|
|
133
172
|
#
|
|
134
173
|
# ## Configuration
|
|
135
174
|
#
|
|
136
175
|
# You can configure the maximum number of polling attempts, and the
|
|
137
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
|
138
|
-
# by passing a block to {#wait_until}:
|
|
176
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
|
177
|
+
# set by passing a block to {#wait_until}:
|
|
139
178
|
#
|
|
140
179
|
# # poll for ~25 seconds
|
|
141
180
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
|
@@ -166,17 +205,16 @@ module Aws::S3
|
|
|
166
205
|
# # resource did not enter the desired state in time
|
|
167
206
|
# end
|
|
168
207
|
#
|
|
208
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
|
169
209
|
#
|
|
170
|
-
# @
|
|
171
|
-
#
|
|
172
|
-
#
|
|
173
|
-
# because the waiter has entered a state that it will not transition
|
|
174
|
-
# out of, preventing success.
|
|
210
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
|
211
|
+
# terminates because the waiter has entered a state that it will not
|
|
212
|
+
# transition out of, preventing success.
|
|
175
213
|
#
|
|
176
214
|
# yet successful.
|
|
177
215
|
#
|
|
178
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
|
179
|
-
# while polling for a resource that is not expected.
|
|
216
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
|
217
|
+
# encountered while polling for a resource that is not expected.
|
|
180
218
|
#
|
|
181
219
|
# @raise [NotImplementedError] Raised when the resource does not
|
|
182
220
|
#
|
|
@@ -203,7 +241,9 @@ module Aws::S3
|
|
|
203
241
|
:retry
|
|
204
242
|
end
|
|
205
243
|
end
|
|
206
|
-
Aws::
|
|
244
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
245
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
|
246
|
+
end
|
|
207
247
|
end
|
|
208
248
|
|
|
209
249
|
# @!group Actions
|
|
@@ -212,14 +252,41 @@ module Aws::S3
|
|
|
212
252
|
#
|
|
213
253
|
# multipart_upload.abort({
|
|
214
254
|
# request_payer: "requester", # accepts requester
|
|
255
|
+
# expected_bucket_owner: "AccountId",
|
|
256
|
+
# if_match_initiated_time: Time.now,
|
|
215
257
|
# })
|
|
216
258
|
# @param [Hash] options ({})
|
|
217
259
|
# @option options [String] :request_payer
|
|
218
|
-
# Confirms that the requester knows that
|
|
219
|
-
#
|
|
220
|
-
# requests.
|
|
221
|
-
#
|
|
222
|
-
#
|
|
260
|
+
# Confirms that the requester knows that they will be charged for the
|
|
261
|
+
# request. Bucket owners need not specify this parameter in their
|
|
262
|
+
# requests. If either the source or destination S3 bucket has Requester
|
|
263
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
|
264
|
+
# the object. For information about downloading objects from Requester
|
|
265
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
|
266
|
+
# in the *Amazon S3 User Guide*.
|
|
267
|
+
#
|
|
268
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
269
|
+
#
|
|
270
|
+
# </note>
|
|
271
|
+
#
|
|
272
|
+
#
|
|
273
|
+
#
|
|
274
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
|
275
|
+
# @option options [String] :expected_bucket_owner
|
|
276
|
+
# The account ID of the expected bucket owner. If the account ID that
|
|
277
|
+
# you provide does not match the actual owner of the bucket, the request
|
|
278
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
|
279
|
+
# @option options [Time,DateTime,Date,Integer,String] :if_match_initiated_time
|
|
280
|
+
# If present, this header aborts an in progress multipart upload only if
|
|
281
|
+
# it was initiated on the provided timestamp. If the initiated timestamp
|
|
282
|
+
# of the multipart upload does not match the provided value, the
|
|
283
|
+
# operation returns a `412 Precondition Failed` error. If the initiated
|
|
284
|
+
# timestamp matches or if the multipart upload doesn’t exist, the
|
|
285
|
+
# operation returns a `204 Success (No Content)` response.
|
|
286
|
+
#
|
|
287
|
+
# <note markdown="1"> This functionality is only supported for directory buckets.
|
|
288
|
+
#
|
|
289
|
+
# </note>
|
|
223
290
|
# @return [Types::AbortMultipartUploadOutput]
|
|
224
291
|
def abort(options = {})
|
|
225
292
|
options = options.merge(
|
|
@@ -227,7 +294,9 @@ module Aws::S3
|
|
|
227
294
|
key: @object_key,
|
|
228
295
|
upload_id: @id
|
|
229
296
|
)
|
|
230
|
-
resp =
|
|
297
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
298
|
+
@client.abort_multipart_upload(options)
|
|
299
|
+
end
|
|
231
300
|
resp.data
|
|
232
301
|
end
|
|
233
302
|
|
|
@@ -238,20 +307,198 @@ module Aws::S3
|
|
|
238
307
|
# parts: [
|
|
239
308
|
# {
|
|
240
309
|
# etag: "ETag",
|
|
310
|
+
# checksum_crc32: "ChecksumCRC32",
|
|
311
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
|
312
|
+
# checksum_crc64nvme: "ChecksumCRC64NVME",
|
|
313
|
+
# checksum_sha1: "ChecksumSHA1",
|
|
314
|
+
# checksum_sha256: "ChecksumSHA256",
|
|
241
315
|
# part_number: 1,
|
|
242
316
|
# },
|
|
243
317
|
# ],
|
|
244
318
|
# },
|
|
319
|
+
# checksum_crc32: "ChecksumCRC32",
|
|
320
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
|
321
|
+
# checksum_crc64nvme: "ChecksumCRC64NVME",
|
|
322
|
+
# checksum_sha1: "ChecksumSHA1",
|
|
323
|
+
# checksum_sha256: "ChecksumSHA256",
|
|
324
|
+
# checksum_type: "COMPOSITE", # accepts COMPOSITE, FULL_OBJECT
|
|
325
|
+
# mpu_object_size: 1,
|
|
245
326
|
# request_payer: "requester", # accepts requester
|
|
327
|
+
# expected_bucket_owner: "AccountId",
|
|
328
|
+
# if_match: "IfMatch",
|
|
329
|
+
# if_none_match: "IfNoneMatch",
|
|
330
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
|
331
|
+
# sse_customer_key: "SSECustomerKey",
|
|
332
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
|
246
333
|
# })
|
|
247
334
|
# @param [Hash] options ({})
|
|
248
335
|
# @option options [Types::CompletedMultipartUpload] :multipart_upload
|
|
336
|
+
# The container for the multipart upload request information.
|
|
337
|
+
# @option options [String] :checksum_crc32
|
|
338
|
+
# This header can be used as a data integrity check to verify that the
|
|
339
|
+
# data received is the same data that was originally sent. This header
|
|
340
|
+
# specifies the Base64 encoded, 32-bit `CRC32` checksum of the object.
|
|
341
|
+
# For more information, see [Checking object integrity][1] in the
|
|
342
|
+
# *Amazon S3 User Guide*.
|
|
343
|
+
#
|
|
344
|
+
#
|
|
345
|
+
#
|
|
346
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
347
|
+
# @option options [String] :checksum_crc32c
|
|
348
|
+
# This header can be used as a data integrity check to verify that the
|
|
349
|
+
# data received is the same data that was originally sent. This header
|
|
350
|
+
# specifies the Base64 encoded, 32-bit `CRC32C` checksum of the object.
|
|
351
|
+
# For more information, see [Checking object integrity][1] in the
|
|
352
|
+
# *Amazon S3 User Guide*.
|
|
353
|
+
#
|
|
354
|
+
#
|
|
355
|
+
#
|
|
356
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
357
|
+
# @option options [String] :checksum_crc64nvme
|
|
358
|
+
# This header can be used as a data integrity check to verify that the
|
|
359
|
+
# data received is the same data that was originally sent. This header
|
|
360
|
+
# specifies the Base64 encoded, 64-bit `CRC64NVME` checksum of the
|
|
361
|
+
# object. The `CRC64NVME` checksum is always a full object checksum. For
|
|
362
|
+
# more information, see [Checking object integrity in the Amazon S3 User
|
|
363
|
+
# Guide][1].
|
|
364
|
+
#
|
|
365
|
+
#
|
|
366
|
+
#
|
|
367
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
368
|
+
# @option options [String] :checksum_sha1
|
|
369
|
+
# This header can be used as a data integrity check to verify that the
|
|
370
|
+
# data received is the same data that was originally sent. This header
|
|
371
|
+
# specifies the Base64 encoded, 160-bit `SHA1` digest of the object. For
|
|
372
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
|
373
|
+
# User Guide*.
|
|
374
|
+
#
|
|
375
|
+
#
|
|
376
|
+
#
|
|
377
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
378
|
+
# @option options [String] :checksum_sha256
|
|
379
|
+
# This header can be used as a data integrity check to verify that the
|
|
380
|
+
# data received is the same data that was originally sent. This header
|
|
381
|
+
# specifies the Base64 encoded, 256-bit `SHA256` digest of the object.
|
|
382
|
+
# For more information, see [Checking object integrity][1] in the
|
|
383
|
+
# *Amazon S3 User Guide*.
|
|
384
|
+
#
|
|
385
|
+
#
|
|
386
|
+
#
|
|
387
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
|
388
|
+
# @option options [String] :checksum_type
|
|
389
|
+
# This header specifies the checksum type of the object, which
|
|
390
|
+
# determines how part-level checksums are combined to create an
|
|
391
|
+
# object-level checksum for multipart objects. You can use this header
|
|
392
|
+
# as a data integrity check to verify that the checksum type that is
|
|
393
|
+
# received is the same checksum that was specified. If the checksum type
|
|
394
|
+
# doesn’t match the checksum type that was specified for the object
|
|
395
|
+
# during the `CreateMultipartUpload` request, it’ll result in a
|
|
396
|
+
# `BadDigest` error. For more information, see Checking object integrity
|
|
397
|
+
# in the Amazon S3 User Guide.
|
|
398
|
+
# @option options [Integer] :mpu_object_size
|
|
399
|
+
# The expected total object size of the multipart upload request. If
|
|
400
|
+
# there’s a mismatch between the specified object size value and the
|
|
401
|
+
# actual object size value, it results in an `HTTP 400 InvalidRequest`
|
|
402
|
+
# error.
|
|
249
403
|
# @option options [String] :request_payer
|
|
250
|
-
# Confirms that the requester knows that
|
|
251
|
-
#
|
|
252
|
-
# requests.
|
|
253
|
-
#
|
|
254
|
-
#
|
|
404
|
+
# Confirms that the requester knows that they will be charged for the
|
|
405
|
+
# request. Bucket owners need not specify this parameter in their
|
|
406
|
+
# requests. If either the source or destination S3 bucket has Requester
|
|
407
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
|
408
|
+
# the object. For information about downloading objects from Requester
|
|
409
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
|
410
|
+
# in the *Amazon S3 User Guide*.
|
|
411
|
+
#
|
|
412
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
413
|
+
#
|
|
414
|
+
# </note>
|
|
415
|
+
#
|
|
416
|
+
#
|
|
417
|
+
#
|
|
418
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
|
419
|
+
# @option options [String] :expected_bucket_owner
|
|
420
|
+
# The account ID of the expected bucket owner. If the account ID that
|
|
421
|
+
# you provide does not match the actual owner of the bucket, the request
|
|
422
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
|
423
|
+
# @option options [String] :if_match
|
|
424
|
+
# Uploads the object only if the ETag (entity tag) value provided during
|
|
425
|
+
# the WRITE operation matches the ETag of the object in S3. If the ETag
|
|
426
|
+
# values do not match, the operation returns a `412 Precondition Failed`
|
|
427
|
+
# error.
|
|
428
|
+
#
|
|
429
|
+
# If a conflicting operation occurs during the upload S3 returns a `409
|
|
430
|
+
# ConditionalRequestConflict` response. On a 409 failure you should
|
|
431
|
+
# fetch the object's ETag, re-initiate the multipart upload with
|
|
432
|
+
# `CreateMultipartUpload`, and re-upload each part.
|
|
433
|
+
#
|
|
434
|
+
# Expects the ETag value as a string.
|
|
435
|
+
#
|
|
436
|
+
# For more information about conditional requests, see [RFC 7232][1], or
|
|
437
|
+
# [Conditional requests][2] in the *Amazon S3 User Guide*.
|
|
438
|
+
#
|
|
439
|
+
#
|
|
440
|
+
#
|
|
441
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
442
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
|
|
443
|
+
# @option options [String] :if_none_match
|
|
444
|
+
# Uploads the object only if the object key name does not already exist
|
|
445
|
+
# in the bucket specified. Otherwise, Amazon S3 returns a `412
|
|
446
|
+
# Precondition Failed` error.
|
|
447
|
+
#
|
|
448
|
+
# If a conflicting operation occurs during the upload S3 returns a `409
|
|
449
|
+
# ConditionalRequestConflict` response. On a 409 failure you should
|
|
450
|
+
# re-initiate the multipart upload with `CreateMultipartUpload` and
|
|
451
|
+
# re-upload each part.
|
|
452
|
+
#
|
|
453
|
+
# Expects the '*' (asterisk) character.
|
|
454
|
+
#
|
|
455
|
+
# For more information about conditional requests, see [RFC 7232][1], or
|
|
456
|
+
# [Conditional requests][2] in the *Amazon S3 User Guide*.
|
|
457
|
+
#
|
|
458
|
+
#
|
|
459
|
+
#
|
|
460
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
|
461
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
|
|
462
|
+
# @option options [String] :sse_customer_algorithm
|
|
463
|
+
# The server-side encryption (SSE) algorithm used to encrypt the object.
|
|
464
|
+
# This parameter is required only when the object was created using a
|
|
465
|
+
# checksum algorithm or if your bucket policy requires the use of SSE-C.
|
|
466
|
+
# For more information, see [Protecting data using SSE-C keys][1] in the
|
|
467
|
+
# *Amazon S3 User Guide*.
|
|
468
|
+
#
|
|
469
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
470
|
+
#
|
|
471
|
+
# </note>
|
|
472
|
+
#
|
|
473
|
+
#
|
|
474
|
+
#
|
|
475
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html#ssec-require-condition-key
|
|
476
|
+
# @option options [String] :sse_customer_key
|
|
477
|
+
# The server-side encryption (SSE) customer managed key. This parameter
|
|
478
|
+
# is needed only when the object was created using a checksum algorithm.
|
|
479
|
+
# For more information, see [Protecting data using SSE-C keys][1] in the
|
|
480
|
+
# *Amazon S3 User Guide*.
|
|
481
|
+
#
|
|
482
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
483
|
+
#
|
|
484
|
+
# </note>
|
|
485
|
+
#
|
|
486
|
+
#
|
|
487
|
+
#
|
|
488
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
489
|
+
# @option options [String] :sse_customer_key_md5
|
|
490
|
+
# The MD5 server-side encryption (SSE) customer managed key. This
|
|
491
|
+
# parameter is needed only when the object was created using a checksum
|
|
492
|
+
# algorithm. For more information, see [Protecting data using SSE-C
|
|
493
|
+
# keys][1] in the *Amazon S3 User Guide*.
|
|
494
|
+
#
|
|
495
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
496
|
+
#
|
|
497
|
+
# </note>
|
|
498
|
+
#
|
|
499
|
+
#
|
|
500
|
+
#
|
|
501
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
255
502
|
# @return [Object]
|
|
256
503
|
def complete(options = {})
|
|
257
504
|
options = options.merge(
|
|
@@ -259,7 +506,9 @@ module Aws::S3
|
|
|
259
506
|
key: @object_key,
|
|
260
507
|
upload_id: @id
|
|
261
508
|
)
|
|
262
|
-
|
|
509
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
510
|
+
@client.complete_multipart_upload(options)
|
|
511
|
+
end
|
|
263
512
|
Object.new(
|
|
264
513
|
bucket_name: @bucket_name,
|
|
265
514
|
key: @object_key,
|
|
@@ -294,14 +543,71 @@ module Aws::S3
|
|
|
294
543
|
#
|
|
295
544
|
# parts = multipart_upload.parts({
|
|
296
545
|
# request_payer: "requester", # accepts requester
|
|
546
|
+
# expected_bucket_owner: "AccountId",
|
|
547
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
|
548
|
+
# sse_customer_key: "SSECustomerKey",
|
|
549
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
|
297
550
|
# })
|
|
298
551
|
# @param [Hash] options ({})
|
|
299
552
|
# @option options [String] :request_payer
|
|
300
|
-
# Confirms that the requester knows that
|
|
301
|
-
#
|
|
302
|
-
# requests.
|
|
303
|
-
#
|
|
304
|
-
#
|
|
553
|
+
# Confirms that the requester knows that they will be charged for the
|
|
554
|
+
# request. Bucket owners need not specify this parameter in their
|
|
555
|
+
# requests. If either the source or destination S3 bucket has Requester
|
|
556
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
|
557
|
+
# the object. For information about downloading objects from Requester
|
|
558
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
|
559
|
+
# in the *Amazon S3 User Guide*.
|
|
560
|
+
#
|
|
561
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
562
|
+
#
|
|
563
|
+
# </note>
|
|
564
|
+
#
|
|
565
|
+
#
|
|
566
|
+
#
|
|
567
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
|
568
|
+
# @option options [String] :expected_bucket_owner
|
|
569
|
+
# The account ID of the expected bucket owner. If the account ID that
|
|
570
|
+
# you provide does not match the actual owner of the bucket, the request
|
|
571
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
|
572
|
+
# @option options [String] :sse_customer_algorithm
|
|
573
|
+
# The server-side encryption (SSE) algorithm used to encrypt the object.
|
|
574
|
+
# This parameter is needed only when the object was created using a
|
|
575
|
+
# checksum algorithm. For more information, see [Protecting data using
|
|
576
|
+
# SSE-C keys][1] in the *Amazon S3 User Guide*.
|
|
577
|
+
#
|
|
578
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
579
|
+
#
|
|
580
|
+
# </note>
|
|
581
|
+
#
|
|
582
|
+
#
|
|
583
|
+
#
|
|
584
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
585
|
+
# @option options [String] :sse_customer_key
|
|
586
|
+
# The server-side encryption (SSE) customer managed key. This parameter
|
|
587
|
+
# is needed only when the object was created using a checksum algorithm.
|
|
588
|
+
# For more information, see [Protecting data using SSE-C keys][1] in the
|
|
589
|
+
# *Amazon S3 User Guide*.
|
|
590
|
+
#
|
|
591
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
592
|
+
#
|
|
593
|
+
# </note>
|
|
594
|
+
#
|
|
595
|
+
#
|
|
596
|
+
#
|
|
597
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
598
|
+
# @option options [String] :sse_customer_key_md5
|
|
599
|
+
# The MD5 server-side encryption (SSE) customer managed key. This
|
|
600
|
+
# parameter is needed only when the object was created using a checksum
|
|
601
|
+
# algorithm. For more information, see [Protecting data using SSE-C
|
|
602
|
+
# keys][1] in the *Amazon S3 User Guide*.
|
|
603
|
+
#
|
|
604
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
|
605
|
+
#
|
|
606
|
+
# </note>
|
|
607
|
+
#
|
|
608
|
+
#
|
|
609
|
+
#
|
|
610
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
|
305
611
|
# @return [MultipartUploadPart::Collection]
|
|
306
612
|
def parts(options = {})
|
|
307
613
|
batches = Enumerator.new do |y|
|
|
@@ -310,7 +616,9 @@ module Aws::S3
|
|
|
310
616
|
key: @object_key,
|
|
311
617
|
upload_id: @id
|
|
312
618
|
)
|
|
313
|
-
resp =
|
|
619
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
|
620
|
+
@client.list_parts(options)
|
|
621
|
+
end
|
|
314
622
|
resp.each_page do |page|
|
|
315
623
|
batch = []
|
|
316
624
|
page.data.parts.each do |p|
|
|
@@ -378,3 +686,6 @@ module Aws::S3
|
|
|
378
686
|
class Collection < Aws::Resources::Collection; end
|
|
379
687
|
end
|
|
380
688
|
end
|
|
689
|
+
|
|
690
|
+
# Load customizations if they exist
|
|
691
|
+
require 'aws-sdk-s3/customizations/multipart_upload'
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Aws
|
|
2
4
|
module S3
|
|
5
|
+
# Raise when multipart upload fails to complete.
|
|
3
6
|
class MultipartUploadError < StandardError
|
|
4
7
|
|
|
5
|
-
def initialize(message, errors)
|
|
8
|
+
def initialize(message, errors = [])
|
|
6
9
|
@errors = errors
|
|
7
10
|
super(message)
|
|
8
11
|
end
|
|
9
12
|
|
|
10
|
-
# @return [Array<StandardError>] The list of errors encountered
|
|
11
|
-
# when uploading or aborting the upload.
|
|
13
|
+
# @return [Array<StandardError>] The list of errors encountered when uploading or aborting the upload.
|
|
12
14
|
attr_reader :errors
|
|
13
|
-
|
|
14
15
|
end
|
|
15
16
|
end
|
|
16
17
|
end
|