aws-sdk-s3 1.36.0 → 1.95.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +768 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/arn/access_point_arn.rb +69 -0
- data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +69 -0
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +73 -0
- data/lib/aws-sdk-s3/bucket.rb +277 -76
- data/lib/aws-sdk-s3/bucket_acl.rb +40 -15
- data/lib/aws-sdk-s3/bucket_cors.rb +50 -14
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +33 -14
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +32 -14
- data/lib/aws-sdk-s3/bucket_logging.rb +35 -15
- data/lib/aws-sdk-s3/bucket_notification.rb +32 -18
- data/lib/aws-sdk-s3/bucket_policy.rb +34 -13
- data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
- data/lib/aws-sdk-s3/bucket_request_payment.rb +34 -12
- data/lib/aws-sdk-s3/bucket_tagging.rb +42 -14
- data/lib/aws-sdk-s3/bucket_versioning.rb +67 -12
- data/lib/aws-sdk-s3/bucket_website.rb +49 -17
- data/lib/aws-sdk-s3/client.rb +7494 -618
- data/lib/aws-sdk-s3/client_api.rb +417 -2
- data/lib/aws-sdk-s3/customizations/bucket.rb +59 -16
- data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
- data/lib/aws-sdk-s3/customizations/object.rb +125 -60
- data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
- data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
- data/lib/aws-sdk-s3/customizations.rb +4 -1
- data/lib/aws-sdk-s3/encryption/client.rb +22 -5
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +72 -26
- data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
- data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
- data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
- 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 +34 -3
- 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 +566 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +226 -0
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
- data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +69 -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 +73 -0
- data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +169 -0
- data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
- data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
- data/lib/aws-sdk-s3/errors.rb +123 -1
- data/lib/aws-sdk-s3/event_streams.rb +15 -8
- data/lib/aws-sdk-s3/file_downloader.rb +10 -8
- data/lib/aws-sdk-s3/file_part.rb +11 -6
- data/lib/aws-sdk-s3/file_uploader.rb +28 -14
- data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +53 -13
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +20 -7
- data/lib/aws-sdk-s3/multipart_upload.rb +64 -29
- data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +115 -42
- data/lib/aws-sdk-s3/object.rb +656 -151
- data/lib/aws-sdk-s3/object_acl.rb +64 -21
- data/lib/aws-sdk-s3/object_copier.rb +2 -0
- data/lib/aws-sdk-s3/object_multipart_copier.rb +2 -0
- data/lib/aws-sdk-s3/object_summary.rb +474 -138
- data/lib/aws-sdk-s3/object_version.rb +122 -58
- data/lib/aws-sdk-s3/plugins/accelerate.rb +32 -38
- data/lib/aws-sdk-s3/plugins/arn.rb +228 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -7
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +25 -3
- data/lib/aws-sdk-s3/plugins/dualstack.rb +15 -4
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +4 -4
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +2 -0
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +67 -0
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +2 -0
- data/lib/aws-sdk-s3/plugins/md5s.rb +30 -28
- data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +25 -0
- data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +64 -35
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +118 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
- data/lib/aws-sdk-s3/presigned_post.rb +72 -32
- data/lib/aws-sdk-s3/presigner.rb +162 -66
- data/lib/aws-sdk-s3/resource.rb +23 -5
- data/lib/aws-sdk-s3/types.rb +6441 -952
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +12 -6
- metadata +35 -12
data/lib/aws-sdk-s3/bucket.rb
CHANGED
@@ -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 Bucket
|
10
13
|
|
11
14
|
extend Aws::Deprecations
|
@@ -21,6 +24,7 @@ module Aws::S3
|
|
21
24
|
@name = extract_name(args, options)
|
22
25
|
@data = options.delete(:data)
|
23
26
|
@client = options.delete(:client) || Client.new(options)
|
27
|
+
@waiter_block_warned = false
|
24
28
|
end
|
25
29
|
|
26
30
|
# @!group Read-Only Attributes
|
@@ -30,7 +34,8 @@ module Aws::S3
|
|
30
34
|
@name
|
31
35
|
end
|
32
36
|
|
33
|
-
# Date the bucket was created.
|
37
|
+
# Date the bucket was created. This date can change when making changes
|
38
|
+
# to your bucket, such as editing its bucket policy.
|
34
39
|
# @return [Time]
|
35
40
|
def creation_date
|
36
41
|
data[:creation_date]
|
@@ -86,10 +91,10 @@ module Aws::S3
|
|
86
91
|
# @option options [Proc] :before_attempt
|
87
92
|
# @option options [Proc] :before_wait
|
88
93
|
# @return [Bucket]
|
89
|
-
def wait_until_exists(options = {})
|
94
|
+
def wait_until_exists(options = {}, &block)
|
90
95
|
options, params = separate_params_and_options(options)
|
91
96
|
waiter = Waiters::BucketExists.new(options)
|
92
|
-
yield_waiter_and_warn(waiter, &
|
97
|
+
yield_waiter_and_warn(waiter, &block) if block_given?
|
93
98
|
waiter.wait(params.merge(bucket: @name))
|
94
99
|
Bucket.new({
|
95
100
|
name: @name,
|
@@ -103,10 +108,10 @@ module Aws::S3
|
|
103
108
|
# @option options [Proc] :before_attempt
|
104
109
|
# @option options [Proc] :before_wait
|
105
110
|
# @return [Bucket]
|
106
|
-
def wait_until_not_exists(options = {})
|
111
|
+
def wait_until_not_exists(options = {}, &block)
|
107
112
|
options, params = separate_params_and_options(options)
|
108
113
|
waiter = Waiters::BucketNotExists.new(options)
|
109
|
-
yield_waiter_and_warn(waiter, &
|
114
|
+
yield_waiter_and_warn(waiter, &block) if block_given?
|
110
115
|
waiter.wait(params.merge(bucket: @name))
|
111
116
|
Bucket.new({
|
112
117
|
name: @name,
|
@@ -119,7 +124,8 @@ module Aws::S3
|
|
119
124
|
# Waiter polls an API operation until a resource enters a desired
|
120
125
|
# state.
|
121
126
|
#
|
122
|
-
# @note The waiting operation is performed on a copy. The original resource
|
127
|
+
# @note The waiting operation is performed on a copy. The original resource
|
128
|
+
# remains unchanged.
|
123
129
|
#
|
124
130
|
# ## Basic Usage
|
125
131
|
#
|
@@ -132,13 +138,15 @@ module Aws::S3
|
|
132
138
|
#
|
133
139
|
# ## Example
|
134
140
|
#
|
135
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
141
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
142
|
+
# instance.state.name == 'running'
|
143
|
+
# end
|
136
144
|
#
|
137
145
|
# ## Configuration
|
138
146
|
#
|
139
147
|
# You can configure the maximum number of polling attempts, and the
|
140
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
141
|
-
# by passing a block to {#wait_until}:
|
148
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
149
|
+
# set by passing a block to {#wait_until}:
|
142
150
|
#
|
143
151
|
# # poll for ~25 seconds
|
144
152
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -169,17 +177,16 @@ module Aws::S3
|
|
169
177
|
# # resource did not enter the desired state in time
|
170
178
|
# end
|
171
179
|
#
|
180
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
172
181
|
#
|
173
|
-
# @
|
174
|
-
#
|
175
|
-
#
|
176
|
-
# because the waiter has entered a state that it will not transition
|
177
|
-
# out of, preventing success.
|
182
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
183
|
+
# terminates because the waiter has entered a state that it will not
|
184
|
+
# transition out of, preventing success.
|
178
185
|
#
|
179
186
|
# yet successful.
|
180
187
|
#
|
181
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
182
|
-
# while polling for a resource that is not expected.
|
188
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
189
|
+
# encountered while polling for a resource that is not expected.
|
183
190
|
#
|
184
191
|
# @raise [NotImplementedError] Raised when the resource does not
|
185
192
|
#
|
@@ -216,7 +223,7 @@ module Aws::S3
|
|
216
223
|
# bucket.create({
|
217
224
|
# acl: "private", # accepts private, public-read, public-read-write, authenticated-read
|
218
225
|
# create_bucket_configuration: {
|
219
|
-
# location_constraint: "
|
226
|
+
# location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
|
220
227
|
# },
|
221
228
|
# grant_full_control: "GrantFullControl",
|
222
229
|
# grant_read: "GrantRead",
|
@@ -229,6 +236,7 @@ module Aws::S3
|
|
229
236
|
# @option options [String] :acl
|
230
237
|
# The canned ACL to apply to the bucket.
|
231
238
|
# @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
|
239
|
+
# The configuration information for the bucket.
|
232
240
|
# @option options [String] :grant_full_control
|
233
241
|
# Allows grantee the read, write, read ACP, and write ACP permissions on
|
234
242
|
# the bucket.
|
@@ -237,8 +245,10 @@ module Aws::S3
|
|
237
245
|
# @option options [String] :grant_read_acp
|
238
246
|
# Allows grantee to read the bucket ACL.
|
239
247
|
# @option options [String] :grant_write
|
240
|
-
# Allows grantee to create
|
241
|
-
#
|
248
|
+
# Allows grantee to create new objects in the bucket.
|
249
|
+
#
|
250
|
+
# For the bucket and object owners of existing objects, also allows
|
251
|
+
# deletions and overwrites of those objects.
|
242
252
|
# @option options [String] :grant_write_acp
|
243
253
|
# Allows grantee to write the ACL for the applicable bucket.
|
244
254
|
# @option options [Boolean] :object_lock_enabled_for_bucket
|
@@ -253,8 +263,14 @@ module Aws::S3
|
|
253
263
|
|
254
264
|
# @example Request syntax with placeholder values
|
255
265
|
#
|
256
|
-
# bucket.delete(
|
266
|
+
# bucket.delete({
|
267
|
+
# expected_bucket_owner: "AccountId",
|
268
|
+
# })
|
257
269
|
# @param [Hash] options ({})
|
270
|
+
# @option options [String] :expected_bucket_owner
|
271
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
272
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
273
|
+
# Denied)` error.
|
258
274
|
# @return [EmptyStructure]
|
259
275
|
def delete(options = {})
|
260
276
|
options = options.merge(bucket: @name)
|
@@ -277,22 +293,34 @@ module Aws::S3
|
|
277
293
|
# mfa: "MFA",
|
278
294
|
# request_payer: "requester", # accepts requester
|
279
295
|
# bypass_governance_retention: false,
|
296
|
+
# expected_bucket_owner: "AccountId",
|
280
297
|
# })
|
281
298
|
# @param [Hash] options ({})
|
282
299
|
# @option options [required, Types::Delete] :delete
|
300
|
+
# Container for the request.
|
283
301
|
# @option options [String] :mfa
|
284
302
|
# The concatenation of the authentication device's serial number, a
|
285
303
|
# space, and the value that is displayed on your authentication device.
|
304
|
+
# Required to permanently delete a versioned object if versioning is
|
305
|
+
# configured with MFA delete enabled.
|
286
306
|
# @option options [String] :request_payer
|
287
|
-
# Confirms that the requester knows that
|
288
|
-
#
|
289
|
-
# requests.
|
290
|
-
# buckets
|
291
|
-
#
|
307
|
+
# Confirms that the requester knows that they will be charged for the
|
308
|
+
# request. Bucket owners need not specify this parameter in their
|
309
|
+
# requests. For information about downloading objects from requester
|
310
|
+
# pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
|
311
|
+
# in the *Amazon S3 User Guide*.
|
312
|
+
#
|
313
|
+
#
|
314
|
+
#
|
315
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
292
316
|
# @option options [Boolean] :bypass_governance_retention
|
293
317
|
# Specifies whether you want to delete this object even if it has a
|
294
318
|
# Governance-type Object Lock in place. You must have sufficient
|
295
319
|
# permissions to perform this operation.
|
320
|
+
# @option options [String] :expected_bucket_owner
|
321
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
322
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
323
|
+
# Denied)` error.
|
296
324
|
# @return [Types::DeleteObjectsOutput]
|
297
325
|
def delete_objects(options = {})
|
298
326
|
options = options.merge(bucket: @name)
|
@@ -322,90 +350,201 @@ module Aws::S3
|
|
322
350
|
# "MetadataKey" => "MetadataValue",
|
323
351
|
# },
|
324
352
|
# server_side_encryption: "AES256", # accepts AES256, aws:kms
|
325
|
-
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE
|
353
|
+
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS
|
326
354
|
# website_redirect_location: "WebsiteRedirectLocation",
|
327
355
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
328
356
|
# sse_customer_key: "SSECustomerKey",
|
329
357
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
330
358
|
# ssekms_key_id: "SSEKMSKeyId",
|
359
|
+
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
360
|
+
# bucket_key_enabled: false,
|
331
361
|
# request_payer: "requester", # accepts requester
|
332
362
|
# tagging: "TaggingHeader",
|
333
363
|
# object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
|
334
364
|
# object_lock_retain_until_date: Time.now,
|
335
365
|
# object_lock_legal_hold_status: "ON", # accepts ON, OFF
|
366
|
+
# expected_bucket_owner: "AccountId",
|
336
367
|
# })
|
337
368
|
# @param [Hash] options ({})
|
338
369
|
# @option options [String] :acl
|
339
|
-
# The canned ACL to apply to the object.
|
340
|
-
#
|
370
|
+
# The canned ACL to apply to the object. For more information, see
|
371
|
+
# [Canned ACL][1].
|
372
|
+
#
|
373
|
+
# This action is not supported by Amazon S3 on Outposts.
|
374
|
+
#
|
375
|
+
#
|
376
|
+
#
|
377
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL
|
378
|
+
# @option options [String, StringIO, File] :body
|
341
379
|
# Object data.
|
342
380
|
# @option options [String] :cache_control
|
343
|
-
#
|
381
|
+
# Can be used to specify caching behavior along the request/reply chain.
|
382
|
+
# For more information, see
|
383
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9][1].
|
384
|
+
#
|
385
|
+
#
|
386
|
+
#
|
387
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
|
344
388
|
# @option options [String] :content_disposition
|
345
|
-
# Specifies presentational information for the object.
|
389
|
+
# Specifies presentational information for the object. For more
|
390
|
+
# information, see
|
391
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1][1].
|
392
|
+
#
|
393
|
+
#
|
394
|
+
#
|
395
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
|
346
396
|
# @option options [String] :content_encoding
|
347
397
|
# Specifies what content encodings have been applied to the object and
|
348
398
|
# thus what decoding mechanisms must be applied to obtain the media-type
|
349
|
-
# referenced by the Content-Type header field.
|
399
|
+
# referenced by the Content-Type header field. For more information, see
|
400
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11][1].
|
401
|
+
#
|
402
|
+
#
|
403
|
+
#
|
404
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
|
350
405
|
# @option options [String] :content_language
|
351
406
|
# The language the content is in.
|
352
407
|
# @option options [Integer] :content_length
|
353
408
|
# Size of the body in bytes. This parameter is useful when the size of
|
354
|
-
# the body cannot be determined automatically.
|
409
|
+
# the body cannot be determined automatically. For more information, see
|
410
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13][1].
|
411
|
+
#
|
412
|
+
#
|
413
|
+
#
|
414
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
|
355
415
|
# @option options [String] :content_md5
|
356
|
-
# The base64-encoded 128-bit MD5 digest of the
|
357
|
-
#
|
416
|
+
# The base64-encoded 128-bit MD5 digest of the message (without the
|
417
|
+
# headers) according to RFC 1864. This header can be used as a message
|
418
|
+
# integrity check to verify that the data is the same data that was
|
419
|
+
# originally sent. Although it is optional, we recommend using the
|
420
|
+
# Content-MD5 mechanism as an end-to-end integrity check. For more
|
421
|
+
# information about REST request authentication, see [REST
|
422
|
+
# Authentication][1].
|
423
|
+
#
|
424
|
+
#
|
425
|
+
#
|
426
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
|
358
427
|
# @option options [String] :content_type
|
359
|
-
# A standard MIME type describing the format of the
|
428
|
+
# A standard MIME type describing the format of the contents. For more
|
429
|
+
# information, see
|
430
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17][1].
|
431
|
+
#
|
432
|
+
#
|
433
|
+
#
|
434
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
|
360
435
|
# @option options [Time,DateTime,Date,Integer,String] :expires
|
361
|
-
# The date and time at which the object is no longer cacheable.
|
436
|
+
# The date and time at which the object is no longer cacheable. For more
|
437
|
+
# information, see
|
438
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21][1].
|
439
|
+
#
|
440
|
+
#
|
441
|
+
#
|
442
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
|
362
443
|
# @option options [String] :grant_full_control
|
363
444
|
# Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
|
364
445
|
# object.
|
446
|
+
#
|
447
|
+
# This action is not supported by Amazon S3 on Outposts.
|
365
448
|
# @option options [String] :grant_read
|
366
449
|
# Allows grantee to read the object data and its metadata.
|
450
|
+
#
|
451
|
+
# This action is not supported by Amazon S3 on Outposts.
|
367
452
|
# @option options [String] :grant_read_acp
|
368
453
|
# Allows grantee to read the object ACL.
|
454
|
+
#
|
455
|
+
# This action is not supported by Amazon S3 on Outposts.
|
369
456
|
# @option options [String] :grant_write_acp
|
370
457
|
# Allows grantee to write the ACL for the applicable object.
|
458
|
+
#
|
459
|
+
# This action is not supported by Amazon S3 on Outposts.
|
371
460
|
# @option options [required, String] :key
|
372
|
-
# Object key for which the PUT
|
461
|
+
# Object key for which the PUT action was initiated.
|
373
462
|
# @option options [Hash<String,String>] :metadata
|
374
463
|
# A map of metadata to store with the object in S3.
|
375
464
|
# @option options [String] :server_side_encryption
|
376
|
-
# The
|
377
|
-
# S3 (
|
465
|
+
# The server-side encryption algorithm used when storing this object in
|
466
|
+
# Amazon S3 (for example, AES256, aws:kms).
|
378
467
|
# @option options [String] :storage_class
|
379
|
-
#
|
468
|
+
# By default, Amazon S3 uses the STANDARD Storage Class to store newly
|
469
|
+
# created objects. The STANDARD storage class provides high durability
|
470
|
+
# and high availability. Depending on performance needs, you can specify
|
471
|
+
# a different Storage Class. Amazon S3 on Outposts only uses the
|
472
|
+
# OUTPOSTS Storage Class. For more information, see [Storage Classes][1]
|
473
|
+
# in the *Amazon S3 User Guide*.
|
474
|
+
#
|
475
|
+
#
|
476
|
+
#
|
477
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html
|
380
478
|
# @option options [String] :website_redirect_location
|
381
479
|
# If the bucket is configured as a website, redirects requests for this
|
382
480
|
# object to another object in the same bucket or to an external URL.
|
383
|
-
# Amazon S3 stores the value of this header in the object metadata.
|
481
|
+
# Amazon S3 stores the value of this header in the object metadata. For
|
482
|
+
# information about object metadata, see [Object Key and Metadata][1].
|
483
|
+
#
|
484
|
+
# In the following example, the request header sets the redirect to an
|
485
|
+
# object (anotherPage.html) in the same bucket:
|
486
|
+
#
|
487
|
+
# `x-amz-website-redirect-location: /anotherPage.html`
|
488
|
+
#
|
489
|
+
# In the following example, the request header sets the object redirect
|
490
|
+
# to another website:
|
491
|
+
#
|
492
|
+
# `x-amz-website-redirect-location: http://www.example.com/`
|
493
|
+
#
|
494
|
+
# For more information about website hosting in Amazon S3, see [Hosting
|
495
|
+
# Websites on Amazon S3][2] and [How to Configure Website Page
|
496
|
+
# Redirects][3].
|
497
|
+
#
|
498
|
+
#
|
499
|
+
#
|
500
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
|
501
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
|
502
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
|
384
503
|
# @option options [String] :sse_customer_algorithm
|
385
|
-
# Specifies the algorithm to use to when encrypting the object (
|
386
|
-
# AES256).
|
504
|
+
# Specifies the algorithm to use to when encrypting the object (for
|
505
|
+
# example, AES256).
|
387
506
|
# @option options [String] :sse_customer_key
|
388
507
|
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
389
508
|
# encrypting data. This value is used to store the object and then it is
|
390
|
-
# discarded; Amazon does not store the encryption key. The key must
|
391
|
-
# appropriate for use with the algorithm specified in the
|
392
|
-
# x-amz-server-side
|
509
|
+
# discarded; Amazon S3 does not store the encryption key. The key must
|
510
|
+
# be appropriate for use with the algorithm specified in the
|
511
|
+
# `x-amz-server-side-encryption-customer-algorithm` header.
|
393
512
|
# @option options [String] :sse_customer_key_md5
|
394
513
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
395
514
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
396
|
-
# ensure the encryption key was transmitted without error.
|
515
|
+
# ensure that the encryption key was transmitted without error.
|
397
516
|
# @option options [String] :ssekms_key_id
|
398
|
-
#
|
399
|
-
#
|
400
|
-
#
|
401
|
-
#
|
402
|
-
#
|
517
|
+
# If `x-amz-server-side-encryption` is present and has the value of
|
518
|
+
# `aws:kms`, this header specifies the ID of the AWS Key Management
|
519
|
+
# Service (AWS KMS) symmetrical customer managed customer master key
|
520
|
+
# (CMK) that was used for the object. If you specify
|
521
|
+
# `x-amz-server-side-encryption:aws:kms`, but do not provide`
|
522
|
+
# x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the AWS
|
523
|
+
# managed CMK in AWS to protect the data. If the KMS key does not exist
|
524
|
+
# in the same account issuing the command, you must use the full ARN and
|
525
|
+
# not just the ID.
|
526
|
+
# @option options [String] :ssekms_encryption_context
|
527
|
+
# Specifies the AWS KMS Encryption Context to use for object encryption.
|
528
|
+
# The value of this header is a base64-encoded UTF-8 string holding JSON
|
529
|
+
# with the encryption context key-value pairs.
|
530
|
+
# @option options [Boolean] :bucket_key_enabled
|
531
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
532
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
533
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
534
|
+
# for object encryption with SSE-KMS.
|
535
|
+
#
|
536
|
+
# Specifying this header with a PUT action doesn’t affect bucket-level
|
537
|
+
# settings for S3 Bucket Key.
|
403
538
|
# @option options [String] :request_payer
|
404
|
-
# Confirms that the requester knows that
|
405
|
-
#
|
406
|
-
# requests.
|
407
|
-
# buckets
|
408
|
-
#
|
539
|
+
# Confirms that the requester knows that they will be charged for the
|
540
|
+
# request. Bucket owners need not specify this parameter in their
|
541
|
+
# requests. For information about downloading objects from requester
|
542
|
+
# pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
|
543
|
+
# in the *Amazon S3 User Guide*.
|
544
|
+
#
|
545
|
+
#
|
546
|
+
#
|
547
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
409
548
|
# @option options [String] :tagging
|
410
549
|
# The tag-set for the object. The tag-set must be encoded as URL Query
|
411
550
|
# parameters. (For example, "Key1=Value1")
|
@@ -414,11 +553,20 @@ module Aws::S3
|
|
414
553
|
# @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
|
415
554
|
# The date and time when you want this object's Object Lock to expire.
|
416
555
|
# @option options [String] :object_lock_legal_hold_status
|
417
|
-
#
|
556
|
+
# Specifies whether a legal hold will be applied to this object. For
|
557
|
+
# more information about S3 Object Lock, see [Object Lock][1].
|
558
|
+
#
|
559
|
+
#
|
560
|
+
#
|
561
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
|
562
|
+
# @option options [String] :expected_bucket_owner
|
563
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
564
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
565
|
+
# Denied)` error.
|
418
566
|
# @return [Object]
|
419
567
|
def put_object(options = {})
|
420
568
|
options = options.merge(bucket: @name)
|
421
|
-
|
569
|
+
@client.put_object(options)
|
422
570
|
Object.new(
|
423
571
|
bucket_name: @name,
|
424
572
|
key: options[:key],
|
@@ -476,10 +624,18 @@ module Aws::S3
|
|
476
624
|
# key_marker: "KeyMarker",
|
477
625
|
# prefix: "Prefix",
|
478
626
|
# upload_id_marker: "UploadIdMarker",
|
627
|
+
# expected_bucket_owner: "AccountId",
|
479
628
|
# })
|
480
629
|
# @param [Hash] options ({})
|
481
630
|
# @option options [String] :delimiter
|
482
631
|
# Character you use to group keys.
|
632
|
+
#
|
633
|
+
# All keys that contain the same string between the prefix, if
|
634
|
+
# specified, and the first occurrence of the delimiter after the prefix
|
635
|
+
# are grouped under a single result element, `CommonPrefixes`. If you
|
636
|
+
# don't specify the prefix parameter, then the substring starts at the
|
637
|
+
# beginning of the key. The keys that are grouped under `CommonPrefixes`
|
638
|
+
# result element are not returned elsewhere in the response.
|
483
639
|
# @option options [String] :encoding_type
|
484
640
|
# Requests Amazon S3 to encode the object keys in the response and
|
485
641
|
# specifies the encoding method to use. An object key may contain any
|
@@ -490,13 +646,31 @@ module Aws::S3
|
|
490
646
|
# @option options [String] :key_marker
|
491
647
|
# Together with upload-id-marker, this parameter specifies the multipart
|
492
648
|
# upload after which listing should begin.
|
649
|
+
#
|
650
|
+
# If `upload-id-marker` is not specified, only the keys
|
651
|
+
# lexicographically greater than the specified `key-marker` will be
|
652
|
+
# included in the list.
|
653
|
+
#
|
654
|
+
# If `upload-id-marker` is specified, any multipart uploads for a key
|
655
|
+
# equal to the `key-marker` might also be included, provided those
|
656
|
+
# multipart uploads have upload IDs lexicographically greater than the
|
657
|
+
# specified `upload-id-marker`.
|
493
658
|
# @option options [String] :prefix
|
494
659
|
# Lists in-progress uploads only for those keys that begin with the
|
495
|
-
# specified prefix.
|
660
|
+
# specified prefix. You can use prefixes to separate a bucket into
|
661
|
+
# different grouping of keys. (You can think of using prefix to make
|
662
|
+
# groups in the same way you'd use a folder in a file system.)
|
496
663
|
# @option options [String] :upload_id_marker
|
497
664
|
# Together with key-marker, specifies the multipart upload after which
|
498
665
|
# listing should begin. If key-marker is not specified, the
|
499
|
-
# upload-id-marker parameter is ignored.
|
666
|
+
# upload-id-marker parameter is ignored. Otherwise, any multipart
|
667
|
+
# uploads for a key equal to the key-marker might be included in the
|
668
|
+
# list only if they have an upload ID lexicographically greater than the
|
669
|
+
# specified `upload-id-marker`.
|
670
|
+
# @option options [String] :expected_bucket_owner
|
671
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
672
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
673
|
+
# Denied)` error.
|
500
674
|
# @return [MultipartUpload::Collection]
|
501
675
|
def multipart_uploads(options = {})
|
502
676
|
batches = Enumerator.new do |y|
|
@@ -545,10 +719,16 @@ module Aws::S3
|
|
545
719
|
# key_marker: "KeyMarker",
|
546
720
|
# prefix: "Prefix",
|
547
721
|
# version_id_marker: "VersionIdMarker",
|
722
|
+
# expected_bucket_owner: "AccountId",
|
548
723
|
# })
|
549
724
|
# @param [Hash] options ({})
|
550
725
|
# @option options [String] :delimiter
|
551
|
-
# A delimiter is a character you
|
726
|
+
# A delimiter is a character that you specify to group keys. All keys
|
727
|
+
# that contain the same string between the `prefix` and the first
|
728
|
+
# occurrence of the delimiter are grouped under a single result element
|
729
|
+
# in CommonPrefixes. These groups are counted as one result against the
|
730
|
+
# max-keys limitation. These keys are not returned elsewhere in the
|
731
|
+
# response.
|
552
732
|
# @option options [String] :encoding_type
|
553
733
|
# Requests Amazon S3 to encode the object keys in the response and
|
554
734
|
# specifies the encoding method to use. An object key may contain any
|
@@ -559,9 +739,18 @@ module Aws::S3
|
|
559
739
|
# @option options [String] :key_marker
|
560
740
|
# Specifies the key to start with when listing objects in a bucket.
|
561
741
|
# @option options [String] :prefix
|
562
|
-
#
|
742
|
+
# Use this parameter to select only those keys that begin with the
|
743
|
+
# specified prefix. You can use prefixes to separate a bucket into
|
744
|
+
# different groupings of keys. (You can think of using prefix to make
|
745
|
+
# groups in the same way you'd use a folder in a file system.) You can
|
746
|
+
# use prefix with delimiter to roll up numerous objects into a single
|
747
|
+
# result under CommonPrefixes.
|
563
748
|
# @option options [String] :version_id_marker
|
564
749
|
# Specifies the object version you want to start listing from.
|
750
|
+
# @option options [String] :expected_bucket_owner
|
751
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
752
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
753
|
+
# Denied)` error.
|
565
754
|
# @return [ObjectVersion::Collection]
|
566
755
|
def object_versions(options = {})
|
567
756
|
batches = Enumerator.new do |y|
|
@@ -590,29 +779,39 @@ module Aws::S3
|
|
590
779
|
# delimiter: "Delimiter",
|
591
780
|
# encoding_type: "url", # accepts url
|
592
781
|
# prefix: "Prefix",
|
782
|
+
# fetch_owner: false,
|
783
|
+
# start_after: "StartAfter",
|
593
784
|
# request_payer: "requester", # accepts requester
|
785
|
+
# expected_bucket_owner: "AccountId",
|
594
786
|
# })
|
595
787
|
# @param [Hash] options ({})
|
596
788
|
# @option options [String] :delimiter
|
597
789
|
# A delimiter is a character you use to group keys.
|
598
790
|
# @option options [String] :encoding_type
|
599
|
-
#
|
600
|
-
# specifies the encoding method to use. An object key may contain any
|
601
|
-
# Unicode character; however, XML 1.0 parser cannot parse some
|
602
|
-
# characters, such as characters with an ASCII value from 0 to 10. For
|
603
|
-
# characters that are not supported in XML 1.0, you can add this
|
604
|
-
# parameter to request that Amazon S3 encode the keys in the response.
|
791
|
+
# Encoding type used by Amazon S3 to encode object keys in the response.
|
605
792
|
# @option options [String] :prefix
|
606
793
|
# Limits the response to keys that begin with the specified prefix.
|
794
|
+
# @option options [Boolean] :fetch_owner
|
795
|
+
# The owner field is not present in listV2 by default, if you want to
|
796
|
+
# return owner field with each key in the result then set the fetch
|
797
|
+
# owner field to true.
|
798
|
+
# @option options [String] :start_after
|
799
|
+
# StartAfter is where you want Amazon S3 to start listing from. Amazon
|
800
|
+
# S3 starts listing after this specified key. StartAfter can be any key
|
801
|
+
# in the bucket.
|
607
802
|
# @option options [String] :request_payer
|
608
803
|
# Confirms that the requester knows that she or he will be charged for
|
609
|
-
# the list objects request. Bucket owners need not specify
|
610
|
-
# parameter in their requests.
|
804
|
+
# the list objects request in V2 style. Bucket owners need not specify
|
805
|
+
# this parameter in their requests.
|
806
|
+
# @option options [String] :expected_bucket_owner
|
807
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
808
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
809
|
+
# Denied)` error.
|
611
810
|
# @return [ObjectSummary::Collection]
|
612
811
|
def objects(options = {})
|
613
812
|
batches = Enumerator.new do |y|
|
614
813
|
options = options.merge(bucket: @name)
|
615
|
-
resp = @client.
|
814
|
+
resp = @client.list_objects_v2(options)
|
616
815
|
resp.each_page do |page|
|
617
816
|
batch = []
|
618
817
|
page.data.contents.each do |c|
|
@@ -691,8 +890,8 @@ module Aws::S3
|
|
691
890
|
|
692
891
|
def yield_waiter_and_warn(waiter, &block)
|
693
892
|
if !@waiter_block_warned
|
694
|
-
msg = "pass options to configure the waiter; "
|
695
|
-
|
893
|
+
msg = "pass options to configure the waiter; "\
|
894
|
+
"yielding the waiter is deprecated"
|
696
895
|
warn(msg)
|
697
896
|
@waiter_block_warned = true
|
698
897
|
end
|
@@ -700,7 +899,9 @@ module Aws::S3
|
|
700
899
|
end
|
701
900
|
|
702
901
|
def separate_params_and_options(options)
|
703
|
-
opts = Set.new(
|
902
|
+
opts = Set.new(
|
903
|
+
[:client, :max_attempts, :delay, :before_attempt, :before_wait]
|
904
|
+
)
|
704
905
|
waiter_opts = {}
|
705
906
|
waiter_params = {}
|
706
907
|
options.each_pair do |key, value|
|