aws-sdk-s3 1.30.1 → 1.112.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +883 -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/multi_region_access_point_arn.rb +68 -0
- data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +69 -0
- data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +74 -0
- data/lib/aws-sdk-s3/bucket.rb +298 -77
- data/lib/aws-sdk-s3/bucket_acl.rb +41 -14
- data/lib/aws-sdk-s3/bucket_cors.rb +51 -13
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +38 -15
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +40 -15
- data/lib/aws-sdk-s3/bucket_logging.rb +36 -15
- data/lib/aws-sdk-s3/bucket_notification.rb +44 -15
- data/lib/aws-sdk-s3/bucket_policy.rb +35 -13
- data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
- data/lib/aws-sdk-s3/bucket_request_payment.rb +35 -12
- data/lib/aws-sdk-s3/bucket_tagging.rb +43 -13
- data/lib/aws-sdk-s3/bucket_versioning.rb +70 -12
- data/lib/aws-sdk-s3/bucket_website.rb +50 -13
- data/lib/aws-sdk-s3/client.rb +7889 -661
- data/lib/aws-sdk-s3/client_api.rb +436 -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 +200 -62
- 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 +23 -6
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
- 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 +222 -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 +65 -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 +20 -7
- data/lib/aws-sdk-s3/file_downloader.rb +17 -10
- data/lib/aws-sdk-s3/file_part.rb +11 -6
- data/lib/aws-sdk-s3/file_uploader.rb +33 -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 -28
- data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +117 -43
- data/lib/aws-sdk-s3/object.rb +656 -152
- data/lib/aws-sdk-s3/object_acl.rb +65 -20
- 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 +485 -138
- data/lib/aws-sdk-s3/object_version.rb +117 -60
- data/lib/aws-sdk-s3/plugins/accelerate.rb +38 -38
- data/lib/aws-sdk-s3/plugins/arn.rb +254 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +8 -8
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +25 -3
- data/lib/aws-sdk-s3/plugins/dualstack.rb +38 -33
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +4 -4
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +73 -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 +89 -36
- 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 +101 -49
- data/lib/aws-sdk-s3/presigner.rb +168 -66
- data/lib/aws-sdk-s3/resource.rb +41 -5
- data/lib/aws-sdk-s3/types.rb +6768 -1033
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +12 -6
- metadata +37 -13
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",
|
@@ -224,11 +231,13 @@ module Aws::S3
|
|
224
231
|
# grant_write: "GrantWrite",
|
225
232
|
# grant_write_acp: "GrantWriteACP",
|
226
233
|
# object_lock_enabled_for_bucket: false,
|
234
|
+
# object_ownership: "BucketOwnerPreferred", # accepts BucketOwnerPreferred, ObjectWriter, BucketOwnerEnforced
|
227
235
|
# })
|
228
236
|
# @param [Hash] options ({})
|
229
237
|
# @option options [String] :acl
|
230
238
|
# The canned ACL to apply to the bucket.
|
231
239
|
# @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
|
240
|
+
# The configuration information for the bucket.
|
232
241
|
# @option options [String] :grant_full_control
|
233
242
|
# Allows grantee the read, write, read ACP, and write ACP permissions on
|
234
243
|
# the bucket.
|
@@ -237,13 +246,32 @@ module Aws::S3
|
|
237
246
|
# @option options [String] :grant_read_acp
|
238
247
|
# Allows grantee to read the bucket ACL.
|
239
248
|
# @option options [String] :grant_write
|
240
|
-
# Allows grantee to create
|
241
|
-
#
|
249
|
+
# Allows grantee to create new objects in the bucket.
|
250
|
+
#
|
251
|
+
# For the bucket and object owners of existing objects, also allows
|
252
|
+
# deletions and overwrites of those objects.
|
242
253
|
# @option options [String] :grant_write_acp
|
243
254
|
# Allows grantee to write the ACL for the applicable bucket.
|
244
255
|
# @option options [Boolean] :object_lock_enabled_for_bucket
|
245
256
|
# Specifies whether you want S3 Object Lock to be enabled for the new
|
246
257
|
# bucket.
|
258
|
+
# @option options [String] :object_ownership
|
259
|
+
# The container element for object ownership for a bucket's ownership
|
260
|
+
# controls.
|
261
|
+
#
|
262
|
+
# BucketOwnerPreferred - Objects uploaded to the bucket change ownership
|
263
|
+
# to the bucket owner if the objects are uploaded with the
|
264
|
+
# `bucket-owner-full-control` canned ACL.
|
265
|
+
#
|
266
|
+
# ObjectWriter - The uploading account will own the object if the object
|
267
|
+
# is uploaded with the `bucket-owner-full-control` canned ACL.
|
268
|
+
#
|
269
|
+
# BucketOwnerEnforced - Access control lists (ACLs) are disabled and no
|
270
|
+
# longer affect permissions. The bucket owner automatically owns and has
|
271
|
+
# full control over every object in the bucket. The bucket only accepts
|
272
|
+
# PUT requests that don't specify an ACL or bucket owner full control
|
273
|
+
# ACLs, such as the `bucket-owner-full-control` canned ACL or an
|
274
|
+
# equivalent form of this ACL expressed in the XML format.
|
247
275
|
# @return [Types::CreateBucketOutput]
|
248
276
|
def create(options = {})
|
249
277
|
options = options.merge(bucket: @name)
|
@@ -253,8 +281,14 @@ module Aws::S3
|
|
253
281
|
|
254
282
|
# @example Request syntax with placeholder values
|
255
283
|
#
|
256
|
-
# bucket.delete(
|
284
|
+
# bucket.delete({
|
285
|
+
# expected_bucket_owner: "AccountId",
|
286
|
+
# })
|
257
287
|
# @param [Hash] options ({})
|
288
|
+
# @option options [String] :expected_bucket_owner
|
289
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
290
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
291
|
+
# Denied)` error.
|
258
292
|
# @return [EmptyStructure]
|
259
293
|
def delete(options = {})
|
260
294
|
options = options.merge(bucket: @name)
|
@@ -277,22 +311,34 @@ module Aws::S3
|
|
277
311
|
# mfa: "MFA",
|
278
312
|
# request_payer: "requester", # accepts requester
|
279
313
|
# bypass_governance_retention: false,
|
314
|
+
# expected_bucket_owner: "AccountId",
|
280
315
|
# })
|
281
316
|
# @param [Hash] options ({})
|
282
317
|
# @option options [required, Types::Delete] :delete
|
318
|
+
# Container for the request.
|
283
319
|
# @option options [String] :mfa
|
284
320
|
# The concatenation of the authentication device's serial number, a
|
285
321
|
# space, and the value that is displayed on your authentication device.
|
322
|
+
# Required to permanently delete a versioned object if versioning is
|
323
|
+
# configured with MFA delete enabled.
|
286
324
|
# @option options [String] :request_payer
|
287
|
-
# Confirms that the requester knows that
|
288
|
-
#
|
289
|
-
# requests.
|
290
|
-
# buckets
|
291
|
-
#
|
325
|
+
# Confirms that the requester knows that they will be charged for the
|
326
|
+
# request. Bucket owners need not specify this parameter in their
|
327
|
+
# requests. For information about downloading objects from requester
|
328
|
+
# pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
|
329
|
+
# in the *Amazon S3 User Guide*.
|
330
|
+
#
|
331
|
+
#
|
332
|
+
#
|
333
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
292
334
|
# @option options [Boolean] :bypass_governance_retention
|
293
335
|
# Specifies whether you want to delete this object even if it has a
|
294
|
-
# Governance-type Object Lock in place.
|
295
|
-
#
|
336
|
+
# Governance-type Object Lock in place. To use this header, you must
|
337
|
+
# have the `s3:PutBucketPublicAccessBlock` permission.
|
338
|
+
# @option options [String] :expected_bucket_owner
|
339
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
340
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
341
|
+
# Denied)` error.
|
296
342
|
# @return [Types::DeleteObjectsOutput]
|
297
343
|
def delete_objects(options = {})
|
298
344
|
options = options.merge(bucket: @name)
|
@@ -322,89 +368,201 @@ module Aws::S3
|
|
322
368
|
# "MetadataKey" => "MetadataValue",
|
323
369
|
# },
|
324
370
|
# server_side_encryption: "AES256", # accepts AES256, aws:kms
|
325
|
-
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER
|
371
|
+
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR
|
326
372
|
# website_redirect_location: "WebsiteRedirectLocation",
|
327
373
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
328
374
|
# sse_customer_key: "SSECustomerKey",
|
329
375
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
330
376
|
# ssekms_key_id: "SSEKMSKeyId",
|
377
|
+
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
378
|
+
# bucket_key_enabled: false,
|
331
379
|
# request_payer: "requester", # accepts requester
|
332
380
|
# tagging: "TaggingHeader",
|
333
381
|
# object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
|
334
382
|
# object_lock_retain_until_date: Time.now,
|
335
383
|
# object_lock_legal_hold_status: "ON", # accepts ON, OFF
|
384
|
+
# expected_bucket_owner: "AccountId",
|
336
385
|
# })
|
337
386
|
# @param [Hash] options ({})
|
338
387
|
# @option options [String] :acl
|
339
|
-
# The canned ACL to apply to the object.
|
340
|
-
#
|
388
|
+
# The canned ACL to apply to the object. For more information, see
|
389
|
+
# [Canned ACL][1].
|
390
|
+
#
|
391
|
+
# This action is not supported by Amazon S3 on Outposts.
|
392
|
+
#
|
393
|
+
#
|
394
|
+
#
|
395
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL
|
396
|
+
# @option options [String, StringIO, File] :body
|
341
397
|
# Object data.
|
342
398
|
# @option options [String] :cache_control
|
343
|
-
#
|
399
|
+
# Can be used to specify caching behavior along the request/reply chain.
|
400
|
+
# For more information, see
|
401
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9][1].
|
402
|
+
#
|
403
|
+
#
|
404
|
+
#
|
405
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
|
344
406
|
# @option options [String] :content_disposition
|
345
|
-
# Specifies presentational information for the object.
|
407
|
+
# Specifies presentational information for the object. For more
|
408
|
+
# information, see
|
409
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1][1].
|
410
|
+
#
|
411
|
+
#
|
412
|
+
#
|
413
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
|
346
414
|
# @option options [String] :content_encoding
|
347
415
|
# Specifies what content encodings have been applied to the object and
|
348
416
|
# thus what decoding mechanisms must be applied to obtain the media-type
|
349
|
-
# referenced by the Content-Type header field.
|
417
|
+
# referenced by the Content-Type header field. For more information, see
|
418
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11][1].
|
419
|
+
#
|
420
|
+
#
|
421
|
+
#
|
422
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
|
350
423
|
# @option options [String] :content_language
|
351
424
|
# The language the content is in.
|
352
425
|
# @option options [Integer] :content_length
|
353
426
|
# Size of the body in bytes. This parameter is useful when the size of
|
354
|
-
# the body cannot be determined automatically.
|
427
|
+
# the body cannot be determined automatically. For more information, see
|
428
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13][1].
|
429
|
+
#
|
430
|
+
#
|
431
|
+
#
|
432
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
|
355
433
|
# @option options [String] :content_md5
|
356
|
-
# The base64-encoded 128-bit MD5 digest of the
|
434
|
+
# The base64-encoded 128-bit MD5 digest of the message (without the
|
435
|
+
# headers) according to RFC 1864. This header can be used as a message
|
436
|
+
# integrity check to verify that the data is the same data that was
|
437
|
+
# originally sent. Although it is optional, we recommend using the
|
438
|
+
# Content-MD5 mechanism as an end-to-end integrity check. For more
|
439
|
+
# information about REST request authentication, see [REST
|
440
|
+
# Authentication][1].
|
441
|
+
#
|
442
|
+
#
|
443
|
+
#
|
444
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
|
357
445
|
# @option options [String] :content_type
|
358
|
-
# A standard MIME type describing the format of the
|
446
|
+
# A standard MIME type describing the format of the contents. For more
|
447
|
+
# information, see
|
448
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17][1].
|
449
|
+
#
|
450
|
+
#
|
451
|
+
#
|
452
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
|
359
453
|
# @option options [Time,DateTime,Date,Integer,String] :expires
|
360
|
-
# The date and time at which the object is no longer cacheable.
|
454
|
+
# The date and time at which the object is no longer cacheable. For more
|
455
|
+
# information, see
|
456
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21][1].
|
457
|
+
#
|
458
|
+
#
|
459
|
+
#
|
460
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
|
361
461
|
# @option options [String] :grant_full_control
|
362
462
|
# Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
|
363
463
|
# object.
|
464
|
+
#
|
465
|
+
# This action is not supported by Amazon S3 on Outposts.
|
364
466
|
# @option options [String] :grant_read
|
365
467
|
# Allows grantee to read the object data and its metadata.
|
468
|
+
#
|
469
|
+
# This action is not supported by Amazon S3 on Outposts.
|
366
470
|
# @option options [String] :grant_read_acp
|
367
471
|
# Allows grantee to read the object ACL.
|
472
|
+
#
|
473
|
+
# This action is not supported by Amazon S3 on Outposts.
|
368
474
|
# @option options [String] :grant_write_acp
|
369
475
|
# Allows grantee to write the ACL for the applicable object.
|
476
|
+
#
|
477
|
+
# This action is not supported by Amazon S3 on Outposts.
|
370
478
|
# @option options [required, String] :key
|
371
|
-
# Object key for which the PUT
|
479
|
+
# Object key for which the PUT action was initiated.
|
372
480
|
# @option options [Hash<String,String>] :metadata
|
373
481
|
# A map of metadata to store with the object in S3.
|
374
482
|
# @option options [String] :server_side_encryption
|
375
|
-
# The
|
376
|
-
# S3 (
|
483
|
+
# The server-side encryption algorithm used when storing this object in
|
484
|
+
# Amazon S3 (for example, AES256, aws:kms).
|
377
485
|
# @option options [String] :storage_class
|
378
|
-
#
|
486
|
+
# By default, Amazon S3 uses the STANDARD Storage Class to store newly
|
487
|
+
# created objects. The STANDARD storage class provides high durability
|
488
|
+
# and high availability. Depending on performance needs, you can specify
|
489
|
+
# a different Storage Class. Amazon S3 on Outposts only uses the
|
490
|
+
# OUTPOSTS Storage Class. For more information, see [Storage Classes][1]
|
491
|
+
# in the *Amazon S3 User Guide*.
|
492
|
+
#
|
493
|
+
#
|
494
|
+
#
|
495
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html
|
379
496
|
# @option options [String] :website_redirect_location
|
380
497
|
# If the bucket is configured as a website, redirects requests for this
|
381
498
|
# object to another object in the same bucket or to an external URL.
|
382
|
-
# Amazon S3 stores the value of this header in the object metadata.
|
499
|
+
# Amazon S3 stores the value of this header in the object metadata. For
|
500
|
+
# information about object metadata, see [Object Key and Metadata][1].
|
501
|
+
#
|
502
|
+
# In the following example, the request header sets the redirect to an
|
503
|
+
# object (anotherPage.html) in the same bucket:
|
504
|
+
#
|
505
|
+
# `x-amz-website-redirect-location: /anotherPage.html`
|
506
|
+
#
|
507
|
+
# In the following example, the request header sets the object redirect
|
508
|
+
# to another website:
|
509
|
+
#
|
510
|
+
# `x-amz-website-redirect-location: http://www.example.com/`
|
511
|
+
#
|
512
|
+
# For more information about website hosting in Amazon S3, see [Hosting
|
513
|
+
# Websites on Amazon S3][2] and [How to Configure Website Page
|
514
|
+
# Redirects][3].
|
515
|
+
#
|
516
|
+
#
|
517
|
+
#
|
518
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
|
519
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
|
520
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
|
383
521
|
# @option options [String] :sse_customer_algorithm
|
384
|
-
# Specifies the algorithm to use to when encrypting the object (
|
385
|
-
# AES256).
|
522
|
+
# Specifies the algorithm to use to when encrypting the object (for
|
523
|
+
# example, AES256).
|
386
524
|
# @option options [String] :sse_customer_key
|
387
525
|
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
388
526
|
# encrypting data. This value is used to store the object and then it is
|
389
|
-
# discarded; Amazon does not store the encryption key. The key must
|
390
|
-
# appropriate for use with the algorithm specified in the
|
391
|
-
# x-amz-server-side
|
527
|
+
# discarded; Amazon S3 does not store the encryption key. The key must
|
528
|
+
# be appropriate for use with the algorithm specified in the
|
529
|
+
# `x-amz-server-side-encryption-customer-algorithm` header.
|
392
530
|
# @option options [String] :sse_customer_key_md5
|
393
531
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
394
532
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
395
|
-
# ensure the encryption key was transmitted without error.
|
533
|
+
# ensure that the encryption key was transmitted without error.
|
396
534
|
# @option options [String] :ssekms_key_id
|
397
|
-
#
|
398
|
-
#
|
399
|
-
#
|
400
|
-
#
|
401
|
-
#
|
535
|
+
# If `x-amz-server-side-encryption` is present and has the value of
|
536
|
+
# `aws:kms`, this header specifies the ID of the Amazon Web Services Key
|
537
|
+
# Management Service (Amazon Web Services KMS) symmetrical customer
|
538
|
+
# managed key that was used for the object. If you specify
|
539
|
+
# `x-amz-server-side-encryption:aws:kms`, but do not provide`
|
540
|
+
# x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
|
541
|
+
# Amazon Web Services managed key to protect the data. If the KMS key
|
542
|
+
# does not exist in the same account issuing the command, you must use
|
543
|
+
# the full ARN and not just the ID.
|
544
|
+
# @option options [String] :ssekms_encryption_context
|
545
|
+
# Specifies the Amazon Web Services KMS Encryption Context to use for
|
546
|
+
# object encryption. The value of this header is a base64-encoded UTF-8
|
547
|
+
# string holding JSON with the encryption context key-value pairs.
|
548
|
+
# @option options [Boolean] :bucket_key_enabled
|
549
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
550
|
+
# encryption with server-side encryption using AWS KMS (SSE-KMS).
|
551
|
+
# Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
|
552
|
+
# for object encryption with SSE-KMS.
|
553
|
+
#
|
554
|
+
# Specifying this header with a PUT action doesn’t affect bucket-level
|
555
|
+
# settings for S3 Bucket Key.
|
402
556
|
# @option options [String] :request_payer
|
403
|
-
# Confirms that the requester knows that
|
404
|
-
#
|
405
|
-
# requests.
|
406
|
-
# buckets
|
407
|
-
#
|
557
|
+
# Confirms that the requester knows that they will be charged for the
|
558
|
+
# request. Bucket owners need not specify this parameter in their
|
559
|
+
# requests. For information about downloading objects from requester
|
560
|
+
# pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
|
561
|
+
# in the *Amazon S3 User Guide*.
|
562
|
+
#
|
563
|
+
#
|
564
|
+
#
|
565
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
408
566
|
# @option options [String] :tagging
|
409
567
|
# The tag-set for the object. The tag-set must be encoded as URL Query
|
410
568
|
# parameters. (For example, "Key1=Value1")
|
@@ -412,12 +570,22 @@ module Aws::S3
|
|
412
570
|
# The Object Lock mode that you want to apply to this object.
|
413
571
|
# @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
|
414
572
|
# The date and time when you want this object's Object Lock to expire.
|
573
|
+
# Must be formatted as a timestamp parameter.
|
415
574
|
# @option options [String] :object_lock_legal_hold_status
|
416
|
-
#
|
575
|
+
# Specifies whether a legal hold will be applied to this object. For
|
576
|
+
# more information about S3 Object Lock, see [Object Lock][1].
|
577
|
+
#
|
578
|
+
#
|
579
|
+
#
|
580
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
|
581
|
+
# @option options [String] :expected_bucket_owner
|
582
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
583
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
584
|
+
# Denied)` error.
|
417
585
|
# @return [Object]
|
418
586
|
def put_object(options = {})
|
419
587
|
options = options.merge(bucket: @name)
|
420
|
-
|
588
|
+
@client.put_object(options)
|
421
589
|
Object.new(
|
422
590
|
bucket_name: @name,
|
423
591
|
key: options[:key],
|
@@ -475,10 +643,18 @@ module Aws::S3
|
|
475
643
|
# key_marker: "KeyMarker",
|
476
644
|
# prefix: "Prefix",
|
477
645
|
# upload_id_marker: "UploadIdMarker",
|
646
|
+
# expected_bucket_owner: "AccountId",
|
478
647
|
# })
|
479
648
|
# @param [Hash] options ({})
|
480
649
|
# @option options [String] :delimiter
|
481
650
|
# Character you use to group keys.
|
651
|
+
#
|
652
|
+
# All keys that contain the same string between the prefix, if
|
653
|
+
# specified, and the first occurrence of the delimiter after the prefix
|
654
|
+
# are grouped under a single result element, `CommonPrefixes`. If you
|
655
|
+
# don't specify the prefix parameter, then the substring starts at the
|
656
|
+
# beginning of the key. The keys that are grouped under `CommonPrefixes`
|
657
|
+
# result element are not returned elsewhere in the response.
|
482
658
|
# @option options [String] :encoding_type
|
483
659
|
# Requests Amazon S3 to encode the object keys in the response and
|
484
660
|
# specifies the encoding method to use. An object key may contain any
|
@@ -489,13 +665,31 @@ module Aws::S3
|
|
489
665
|
# @option options [String] :key_marker
|
490
666
|
# Together with upload-id-marker, this parameter specifies the multipart
|
491
667
|
# upload after which listing should begin.
|
668
|
+
#
|
669
|
+
# If `upload-id-marker` is not specified, only the keys
|
670
|
+
# lexicographically greater than the specified `key-marker` will be
|
671
|
+
# included in the list.
|
672
|
+
#
|
673
|
+
# If `upload-id-marker` is specified, any multipart uploads for a key
|
674
|
+
# equal to the `key-marker` might also be included, provided those
|
675
|
+
# multipart uploads have upload IDs lexicographically greater than the
|
676
|
+
# specified `upload-id-marker`.
|
492
677
|
# @option options [String] :prefix
|
493
678
|
# Lists in-progress uploads only for those keys that begin with the
|
494
|
-
# specified prefix.
|
679
|
+
# specified prefix. You can use prefixes to separate a bucket into
|
680
|
+
# different grouping of keys. (You can think of using prefix to make
|
681
|
+
# groups in the same way you'd use a folder in a file system.)
|
495
682
|
# @option options [String] :upload_id_marker
|
496
683
|
# Together with key-marker, specifies the multipart upload after which
|
497
684
|
# listing should begin. If key-marker is not specified, the
|
498
|
-
# upload-id-marker parameter is ignored.
|
685
|
+
# upload-id-marker parameter is ignored. Otherwise, any multipart
|
686
|
+
# uploads for a key equal to the key-marker might be included in the
|
687
|
+
# list only if they have an upload ID lexicographically greater than the
|
688
|
+
# specified `upload-id-marker`.
|
689
|
+
# @option options [String] :expected_bucket_owner
|
690
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
691
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
692
|
+
# Denied)` error.
|
499
693
|
# @return [MultipartUpload::Collection]
|
500
694
|
def multipart_uploads(options = {})
|
501
695
|
batches = Enumerator.new do |y|
|
@@ -544,10 +738,16 @@ module Aws::S3
|
|
544
738
|
# key_marker: "KeyMarker",
|
545
739
|
# prefix: "Prefix",
|
546
740
|
# version_id_marker: "VersionIdMarker",
|
741
|
+
# expected_bucket_owner: "AccountId",
|
547
742
|
# })
|
548
743
|
# @param [Hash] options ({})
|
549
744
|
# @option options [String] :delimiter
|
550
|
-
# A delimiter is a character you
|
745
|
+
# A delimiter is a character that you specify to group keys. All keys
|
746
|
+
# that contain the same string between the `prefix` and the first
|
747
|
+
# occurrence of the delimiter are grouped under a single result element
|
748
|
+
# in CommonPrefixes. These groups are counted as one result against the
|
749
|
+
# max-keys limitation. These keys are not returned elsewhere in the
|
750
|
+
# response.
|
551
751
|
# @option options [String] :encoding_type
|
552
752
|
# Requests Amazon S3 to encode the object keys in the response and
|
553
753
|
# specifies the encoding method to use. An object key may contain any
|
@@ -558,9 +758,18 @@ module Aws::S3
|
|
558
758
|
# @option options [String] :key_marker
|
559
759
|
# Specifies the key to start with when listing objects in a bucket.
|
560
760
|
# @option options [String] :prefix
|
561
|
-
#
|
761
|
+
# Use this parameter to select only those keys that begin with the
|
762
|
+
# specified prefix. You can use prefixes to separate a bucket into
|
763
|
+
# different groupings of keys. (You can think of using prefix to make
|
764
|
+
# groups in the same way you'd use a folder in a file system.) You can
|
765
|
+
# use prefix with delimiter to roll up numerous objects into a single
|
766
|
+
# result under CommonPrefixes.
|
562
767
|
# @option options [String] :version_id_marker
|
563
768
|
# Specifies the object version you want to start listing from.
|
769
|
+
# @option options [String] :expected_bucket_owner
|
770
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
771
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
772
|
+
# Denied)` error.
|
564
773
|
# @return [ObjectVersion::Collection]
|
565
774
|
def object_versions(options = {})
|
566
775
|
batches = Enumerator.new do |y|
|
@@ -589,29 +798,39 @@ module Aws::S3
|
|
589
798
|
# delimiter: "Delimiter",
|
590
799
|
# encoding_type: "url", # accepts url
|
591
800
|
# prefix: "Prefix",
|
801
|
+
# fetch_owner: false,
|
802
|
+
# start_after: "StartAfter",
|
592
803
|
# request_payer: "requester", # accepts requester
|
804
|
+
# expected_bucket_owner: "AccountId",
|
593
805
|
# })
|
594
806
|
# @param [Hash] options ({})
|
595
807
|
# @option options [String] :delimiter
|
596
808
|
# A delimiter is a character you use to group keys.
|
597
809
|
# @option options [String] :encoding_type
|
598
|
-
#
|
599
|
-
# specifies the encoding method to use. An object key may contain any
|
600
|
-
# Unicode character; however, XML 1.0 parser cannot parse some
|
601
|
-
# characters, such as characters with an ASCII value from 0 to 10. For
|
602
|
-
# characters that are not supported in XML 1.0, you can add this
|
603
|
-
# parameter to request that Amazon S3 encode the keys in the response.
|
810
|
+
# Encoding type used by Amazon S3 to encode object keys in the response.
|
604
811
|
# @option options [String] :prefix
|
605
812
|
# Limits the response to keys that begin with the specified prefix.
|
813
|
+
# @option options [Boolean] :fetch_owner
|
814
|
+
# The owner field is not present in listV2 by default, if you want to
|
815
|
+
# return owner field with each key in the result then set the fetch
|
816
|
+
# owner field to true.
|
817
|
+
# @option options [String] :start_after
|
818
|
+
# StartAfter is where you want Amazon S3 to start listing from. Amazon
|
819
|
+
# S3 starts listing after this specified key. StartAfter can be any key
|
820
|
+
# in the bucket.
|
606
821
|
# @option options [String] :request_payer
|
607
822
|
# Confirms that the requester knows that she or he will be charged for
|
608
|
-
# the list objects request. Bucket owners need not specify
|
609
|
-
# parameter in their requests.
|
823
|
+
# the list objects request in V2 style. Bucket owners need not specify
|
824
|
+
# this parameter in their requests.
|
825
|
+
# @option options [String] :expected_bucket_owner
|
826
|
+
# The account ID of the expected bucket owner. If the bucket is owned by
|
827
|
+
# a different account, the request will fail with an HTTP `403 (Access
|
828
|
+
# Denied)` error.
|
610
829
|
# @return [ObjectSummary::Collection]
|
611
830
|
def objects(options = {})
|
612
831
|
batches = Enumerator.new do |y|
|
613
832
|
options = options.merge(bucket: @name)
|
614
|
-
resp = @client.
|
833
|
+
resp = @client.list_objects_v2(options)
|
615
834
|
resp.each_page do |page|
|
616
835
|
batch = []
|
617
836
|
page.data.contents.each do |c|
|
@@ -690,8 +909,8 @@ module Aws::S3
|
|
690
909
|
|
691
910
|
def yield_waiter_and_warn(waiter, &block)
|
692
911
|
if !@waiter_block_warned
|
693
|
-
msg = "pass options to configure the waiter; "
|
694
|
-
|
912
|
+
msg = "pass options to configure the waiter; "\
|
913
|
+
"yielding the waiter is deprecated"
|
695
914
|
warn(msg)
|
696
915
|
@waiter_block_warned = true
|
697
916
|
end
|
@@ -699,7 +918,9 @@ module Aws::S3
|
|
699
918
|
end
|
700
919
|
|
701
920
|
def separate_params_and_options(options)
|
702
|
-
opts = Set.new(
|
921
|
+
opts = Set.new(
|
922
|
+
[:client, :max_attempts, :delay, :before_attempt, :before_wait]
|
923
|
+
)
|
703
924
|
waiter_opts = {}
|
704
925
|
waiter_params = {}
|
705
926
|
options.each_pair do |key, value|
|