aws-sdk-s3 1.119.2 → 1.158.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 +4 -4
- data/CHANGELOG.md +263 -0
- data/VERSION +1 -1
- 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 +573 -133
- data/lib/aws-sdk-s3/bucket_acl.rb +18 -12
- data/lib/aws-sdk-s3/bucket_cors.rb +24 -16
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +24 -16
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +24 -16
- data/lib/aws-sdk-s3/bucket_logging.rb +25 -12
- data/lib/aws-sdk-s3/bucket_notification.rb +12 -6
- data/lib/aws-sdk-s3/bucket_policy.rb +70 -18
- data/lib/aws-sdk-s3/bucket_region_cache.rb +9 -5
- data/lib/aws-sdk-s3/bucket_request_payment.rb +18 -12
- data/lib/aws-sdk-s3/bucket_tagging.rb +24 -16
- data/lib/aws-sdk-s3/bucket_versioning.rb +42 -32
- data/lib/aws-sdk-s3/bucket_website.rb +24 -16
- data/lib/aws-sdk-s3/client.rb +6866 -3226
- data/lib/aws-sdk-s3/client_api.rb +162 -21
- data/lib/aws-sdk-s3/customizations/bucket.rb +3 -1
- data/lib/aws-sdk-s3/customizations/errors.rb +16 -3
- data/lib/aws-sdk-s3/customizations/object.rb +91 -18
- data/lib/aws-sdk-s3/customizations.rb +8 -0
- data/lib/aws-sdk-s3/encryption/client.rb +6 -2
- data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +13 -9
- data/lib/aws-sdk-s3/encryptionV2/client.rb +6 -2
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +1 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +10 -6
- data/lib/aws-sdk-s3/endpoint_parameters.rb +44 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +186 -327
- data/lib/aws-sdk-s3/endpoints.rb +540 -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 +169 -44
- data/lib/aws-sdk-s3/file_uploader.rb +8 -6
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +4 -4
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +10 -7
- data/lib/aws-sdk-s3/multipart_upload.rb +81 -20
- data/lib/aws-sdk-s3/multipart_upload_part.rb +169 -38
- data/lib/aws-sdk-s3/object.rb +1590 -275
- data/lib/aws-sdk-s3/object_acl.rb +38 -18
- data/lib/aws-sdk-s3/object_copier.rb +7 -5
- data/lib/aws-sdk-s3/object_multipart_copier.rb +42 -24
- data/lib/aws-sdk-s3/object_summary.rb +1437 -285
- data/lib/aws-sdk-s3/object_version.rb +350 -51
- data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
- data/lib/aws-sdk-s3/plugins/endpoints.rb +14 -2
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +97 -0
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +53 -16
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +3 -1
- data/lib/aws-sdk-s3/plugins/md5s.rb +2 -1
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +20 -13
- data/lib/aws-sdk-s3/presigned_post.rb +52 -43
- data/lib/aws-sdk-s3/presigner.rb +8 -4
- data/lib/aws-sdk-s3/resource.rb +99 -21
- data/lib/aws-sdk-s3/types.rb +5285 -1632
- data/lib/aws-sdk-s3.rb +1 -1
- data/sig/bucket.rbs +212 -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 +111 -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 +2385 -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 +34 -0
- data/sig/multipart_upload.rbs +110 -0
- data/sig/multipart_upload_part.rbs +105 -0
- data/sig/object.rbs +442 -0
- data/sig/object_acl.rbs +86 -0
- data/sig/object_summary.rbs +334 -0
- data/sig/object_version.rbs +137 -0
- data/sig/resource.rbs +128 -0
- data/sig/types.rbs +2575 -0
- data/sig/waiters.rbs +95 -0
- metadata +43 -11
data/lib/aws-sdk-s3/bucket.rb
CHANGED
@@ -95,7 +95,9 @@ module Aws::S3
|
|
95
95
|
options, params = separate_params_and_options(options)
|
96
96
|
waiter = Waiters::BucketExists.new(options)
|
97
97
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
98
|
-
|
98
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
99
|
+
waiter.wait(params.merge(bucket: @name))
|
100
|
+
end
|
99
101
|
Bucket.new({
|
100
102
|
name: @name,
|
101
103
|
client: @client
|
@@ -112,7 +114,9 @@ module Aws::S3
|
|
112
114
|
options, params = separate_params_and_options(options)
|
113
115
|
waiter = Waiters::BucketNotExists.new(options)
|
114
116
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
115
|
-
|
117
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
118
|
+
waiter.wait(params.merge(bucket: @name))
|
119
|
+
end
|
116
120
|
Bucket.new({
|
117
121
|
name: @name,
|
118
122
|
client: @client
|
@@ -213,7 +217,9 @@ module Aws::S3
|
|
213
217
|
:retry
|
214
218
|
end
|
215
219
|
end
|
216
|
-
Aws::
|
220
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
221
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
222
|
+
end
|
217
223
|
end
|
218
224
|
|
219
225
|
# @!group Actions
|
@@ -223,7 +229,15 @@ module Aws::S3
|
|
223
229
|
# bucket.create({
|
224
230
|
# acl: "private", # accepts private, public-read, public-read-write, authenticated-read
|
225
231
|
# create_bucket_configuration: {
|
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, ap-southeast-3, 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
|
232
|
+
# 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-south-2, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-south-2, 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
|
233
|
+
# location: {
|
234
|
+
# type: "AvailabilityZone", # accepts AvailabilityZone
|
235
|
+
# name: "LocationNameAsString",
|
236
|
+
# },
|
237
|
+
# bucket: {
|
238
|
+
# data_redundancy: "SingleAvailabilityZone", # accepts SingleAvailabilityZone
|
239
|
+
# type: "Directory", # accepts Directory
|
240
|
+
# },
|
227
241
|
# },
|
228
242
|
# grant_full_control: "GrantFullControl",
|
229
243
|
# grant_read: "GrantRead",
|
@@ -236,46 +250,93 @@ module Aws::S3
|
|
236
250
|
# @param [Hash] options ({})
|
237
251
|
# @option options [String] :acl
|
238
252
|
# The canned ACL to apply to the bucket.
|
253
|
+
#
|
254
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
255
|
+
#
|
256
|
+
# </note>
|
239
257
|
# @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
|
240
258
|
# The configuration information for the bucket.
|
241
259
|
# @option options [String] :grant_full_control
|
242
260
|
# Allows grantee the read, write, read ACP, and write ACP permissions on
|
243
261
|
# the bucket.
|
262
|
+
#
|
263
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
264
|
+
#
|
265
|
+
# </note>
|
244
266
|
# @option options [String] :grant_read
|
245
267
|
# Allows grantee to list the objects in the bucket.
|
268
|
+
#
|
269
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
270
|
+
#
|
271
|
+
# </note>
|
246
272
|
# @option options [String] :grant_read_acp
|
247
273
|
# Allows grantee to read the bucket ACL.
|
274
|
+
#
|
275
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
276
|
+
#
|
277
|
+
# </note>
|
248
278
|
# @option options [String] :grant_write
|
249
279
|
# Allows grantee to create new objects in the bucket.
|
250
280
|
#
|
251
281
|
# For the bucket and object owners of existing objects, also allows
|
252
282
|
# deletions and overwrites of those objects.
|
283
|
+
#
|
284
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
285
|
+
#
|
286
|
+
# </note>
|
253
287
|
# @option options [String] :grant_write_acp
|
254
288
|
# Allows grantee to write the ACL for the applicable bucket.
|
289
|
+
#
|
290
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
291
|
+
#
|
292
|
+
# </note>
|
255
293
|
# @option options [Boolean] :object_lock_enabled_for_bucket
|
256
294
|
# Specifies whether you want S3 Object Lock to be enabled for the new
|
257
295
|
# bucket.
|
296
|
+
#
|
297
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
298
|
+
#
|
299
|
+
# </note>
|
258
300
|
# @option options [String] :object_ownership
|
259
301
|
# The container element for object ownership for a bucket's ownership
|
260
302
|
# controls.
|
261
303
|
#
|
262
|
-
# BucketOwnerPreferred - Objects uploaded to the bucket change
|
263
|
-
# to the bucket owner if the objects are uploaded with the
|
304
|
+
# `BucketOwnerPreferred` - Objects uploaded to the bucket change
|
305
|
+
# ownership to the bucket owner if the objects are uploaded with the
|
264
306
|
# `bucket-owner-full-control` canned ACL.
|
265
307
|
#
|
266
|
-
# ObjectWriter - The uploading account will own the object if the
|
267
|
-
# is uploaded with the `bucket-owner-full-control` canned ACL.
|
308
|
+
# `ObjectWriter` - The uploading account will own the object if the
|
309
|
+
# object is uploaded with the `bucket-owner-full-control` canned ACL.
|
310
|
+
#
|
311
|
+
# `BucketOwnerEnforced` - Access control lists (ACLs) are disabled and
|
312
|
+
# no longer affect permissions. The bucket owner automatically owns and
|
313
|
+
# has full control over every object in the bucket. The bucket only
|
314
|
+
# accepts PUT requests that don't specify an ACL or specify bucket
|
315
|
+
# owner full control ACLs (such as the predefined
|
316
|
+
# `bucket-owner-full-control` canned ACL or a custom ACL in XML format
|
317
|
+
# that grants the same permissions).
|
318
|
+
#
|
319
|
+
# By default, `ObjectOwnership` is set to `BucketOwnerEnforced` and ACLs
|
320
|
+
# are disabled. We recommend keeping ACLs disabled, except in uncommon
|
321
|
+
# use cases where you must control access for each object individually.
|
322
|
+
# For more information about S3 Object Ownership, see [Controlling
|
323
|
+
# ownership of objects and disabling ACLs for your bucket][1] in the
|
324
|
+
# *Amazon S3 User Guide*.
|
268
325
|
#
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
326
|
+
# <note markdown="1"> This functionality is not supported for directory buckets. Directory
|
327
|
+
# buckets use the bucket owner enforced setting for S3 Object Ownership.
|
328
|
+
#
|
329
|
+
# </note>
|
330
|
+
#
|
331
|
+
#
|
332
|
+
#
|
333
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
|
275
334
|
# @return [Types::CreateBucketOutput]
|
276
335
|
def create(options = {})
|
277
336
|
options = options.merge(bucket: @name)
|
278
|
-
resp =
|
337
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
338
|
+
@client.create_bucket(options)
|
339
|
+
end
|
279
340
|
resp.data
|
280
341
|
end
|
281
342
|
|
@@ -286,13 +347,21 @@ module Aws::S3
|
|
286
347
|
# })
|
287
348
|
# @param [Hash] options ({})
|
288
349
|
# @option options [String] :expected_bucket_owner
|
289
|
-
# The account ID of the expected bucket owner. If the
|
290
|
-
#
|
291
|
-
# Forbidden` (access denied).
|
350
|
+
# The account ID of the expected bucket owner. If the account ID that
|
351
|
+
# you provide does not match the actual owner of the bucket, the request
|
352
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
353
|
+
#
|
354
|
+
# <note markdown="1"> For directory buckets, this header is not supported in this API
|
355
|
+
# operation. If you specify this header, the request fails with the HTTP
|
356
|
+
# status code `501 Not Implemented`.
|
357
|
+
#
|
358
|
+
# </note>
|
292
359
|
# @return [EmptyStructure]
|
293
360
|
def delete(options = {})
|
294
361
|
options = options.merge(bucket: @name)
|
295
|
-
resp =
|
362
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
363
|
+
@client.delete_bucket(options)
|
364
|
+
end
|
296
365
|
resp.data
|
297
366
|
end
|
298
367
|
|
@@ -322,13 +391,36 @@ module Aws::S3
|
|
322
391
|
# space, and the value that is displayed on your authentication device.
|
323
392
|
# Required to permanently delete a versioned object if versioning is
|
324
393
|
# configured with MFA delete enabled.
|
394
|
+
#
|
395
|
+
# When performing the `DeleteObjects` operation on an MFA delete enabled
|
396
|
+
# bucket, which attempts to delete the specified versioned objects, you
|
397
|
+
# must include an MFA token. If you don't provide an MFA token, the
|
398
|
+
# entire request will fail, even if there are non-versioned objects that
|
399
|
+
# you are trying to delete. If you provide an invalid token, whether
|
400
|
+
# there are versioned object keys in the request or not, the entire
|
401
|
+
# Multi-Object Delete request will fail. For information about MFA
|
402
|
+
# Delete, see [ MFA Delete][1] in the *Amazon S3 User Guide*.
|
403
|
+
#
|
404
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
405
|
+
#
|
406
|
+
# </note>
|
407
|
+
#
|
408
|
+
#
|
409
|
+
#
|
410
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete
|
325
411
|
# @option options [String] :request_payer
|
326
412
|
# Confirms that the requester knows that they will be charged for the
|
327
413
|
# request. Bucket owners need not specify this parameter in their
|
328
|
-
# requests.
|
414
|
+
# requests. If either the source or destination S3 bucket has Requester
|
415
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
416
|
+
# the object. For information about downloading objects from Requester
|
329
417
|
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
330
418
|
# in the *Amazon S3 User Guide*.
|
331
419
|
#
|
420
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
421
|
+
#
|
422
|
+
# </note>
|
423
|
+
#
|
332
424
|
#
|
333
425
|
#
|
334
426
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
@@ -336,32 +428,54 @@ module Aws::S3
|
|
336
428
|
# Specifies whether you want to delete this object even if it has a
|
337
429
|
# Governance-type Object Lock in place. To use this header, you must
|
338
430
|
# have the `s3:BypassGovernanceRetention` permission.
|
431
|
+
#
|
432
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
433
|
+
#
|
434
|
+
# </note>
|
339
435
|
# @option options [String] :expected_bucket_owner
|
340
|
-
# The account ID of the expected bucket owner. If the
|
341
|
-
#
|
342
|
-
# Forbidden` (access denied).
|
436
|
+
# The account ID of the expected bucket owner. If the account ID that
|
437
|
+
# you provide does not match the actual owner of the bucket, the request
|
438
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
343
439
|
# @option options [String] :checksum_algorithm
|
344
440
|
# Indicates the algorithm used to create the checksum for the object
|
345
|
-
# when
|
346
|
-
# functionality if
|
347
|
-
# must be a corresponding `x-amz-checksum` or
|
348
|
-
# sent. Otherwise, Amazon S3 fails the request
|
349
|
-
# `400 Bad Request`.
|
350
|
-
#
|
441
|
+
# when you use the SDK. This header will not provide any additional
|
442
|
+
# functionality if you don't use the SDK. When you send this header,
|
443
|
+
# there must be a corresponding `x-amz-checksum-algorithm ` or
|
444
|
+
# `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
|
445
|
+
# with the HTTP status code `400 Bad Request`.
|
446
|
+
#
|
447
|
+
# For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
|
448
|
+
# the supported algorithm from the following list:
|
449
|
+
#
|
450
|
+
# * CRC32
|
451
|
+
#
|
452
|
+
# * CRC32C
|
453
|
+
#
|
454
|
+
# * SHA1
|
455
|
+
#
|
456
|
+
# * SHA256
|
457
|
+
#
|
458
|
+
# For more information, see [Checking object integrity][1] in the
|
459
|
+
# *Amazon S3 User Guide*.
|
460
|
+
#
|
461
|
+
# If the individual checksum value you provide through
|
462
|
+
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
463
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any
|
464
|
+
# provided `ChecksumAlgorithm` parameter and uses the checksum algorithm
|
465
|
+
# that matches the provided value in `x-amz-checksum-algorithm `.
|
351
466
|
#
|
352
467
|
# If you provide an individual checksum, Amazon S3 ignores any provided
|
353
468
|
# `ChecksumAlgorithm` parameter.
|
354
469
|
#
|
355
|
-
# This checksum algorithm must be the same for all parts and it match
|
356
|
-
# the checksum value supplied in the `CreateMultipartUpload` request.
|
357
|
-
#
|
358
470
|
#
|
359
471
|
#
|
360
472
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
361
473
|
# @return [Types::DeleteObjectsOutput]
|
362
474
|
def delete_objects(options = {})
|
363
475
|
options = options.merge(bucket: @name)
|
364
|
-
resp =
|
476
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
477
|
+
@client.delete_objects(options)
|
478
|
+
end
|
365
479
|
resp.data
|
366
480
|
end
|
367
481
|
|
@@ -391,8 +505,8 @@ module Aws::S3
|
|
391
505
|
# metadata: {
|
392
506
|
# "MetadataKey" => "MetadataValue",
|
393
507
|
# },
|
394
|
-
# server_side_encryption: "AES256", # accepts AES256, aws:kms
|
395
|
-
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR
|
508
|
+
# server_side_encryption: "AES256", # accepts AES256, aws:kms, aws:kms:dsse
|
509
|
+
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE
|
396
510
|
# website_redirect_location: "WebsiteRedirectLocation",
|
397
511
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
398
512
|
# sse_customer_key: "SSECustomerKey",
|
@@ -410,13 +524,41 @@ module Aws::S3
|
|
410
524
|
# @param [Hash] options ({})
|
411
525
|
# @option options [String] :acl
|
412
526
|
# The canned ACL to apply to the object. For more information, see
|
413
|
-
# [Canned ACL][1]
|
527
|
+
# [Canned ACL][1] in the *Amazon S3 User Guide*.
|
528
|
+
#
|
529
|
+
# When adding a new object, you can use headers to grant ACL-based
|
530
|
+
# permissions to individual Amazon Web Services accounts or to
|
531
|
+
# predefined groups defined by Amazon S3. These permissions are then
|
532
|
+
# added to the ACL on the object. By default, all objects are private.
|
533
|
+
# Only the owner has full access control. For more information, see
|
534
|
+
# [Access Control List (ACL) Overview][2] and [Managing ACLs Using the
|
535
|
+
# REST API][3] in the *Amazon S3 User Guide*.
|
536
|
+
#
|
537
|
+
# If the bucket that you're uploading objects to uses the bucket owner
|
538
|
+
# enforced setting for S3 Object Ownership, ACLs are disabled and no
|
539
|
+
# longer affect permissions. Buckets that use this setting only accept
|
540
|
+
# PUT requests that don't specify an ACL or PUT requests that specify
|
541
|
+
# bucket owner full control ACLs, such as the
|
542
|
+
# `bucket-owner-full-control` canned ACL or an equivalent form of this
|
543
|
+
# ACL expressed in the XML format. PUT requests that contain other ACLs
|
544
|
+
# (for example, custom grants to certain Amazon Web Services accounts)
|
545
|
+
# fail and return a `400` error with the error code
|
546
|
+
# `AccessControlListNotSupported`. For more information, see [
|
547
|
+
# Controlling ownership of objects and disabling ACLs][4] in the *Amazon
|
548
|
+
# S3 User Guide*.
|
549
|
+
#
|
550
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
551
|
+
#
|
552
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
414
553
|
#
|
415
|
-
#
|
554
|
+
# </note>
|
416
555
|
#
|
417
556
|
#
|
418
557
|
#
|
419
558
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL
|
559
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
|
560
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html
|
561
|
+
# [4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
|
420
562
|
# @option options [String, StringIO, File] :body
|
421
563
|
# Object data.
|
422
564
|
# @option options [String] :cache_control
|
@@ -430,30 +572,30 @@ module Aws::S3
|
|
430
572
|
# @option options [String] :content_disposition
|
431
573
|
# Specifies presentational information for the object. For more
|
432
574
|
# information, see
|
433
|
-
# [
|
575
|
+
# [https://www.rfc-editor.org/rfc/rfc6266#section-4][1].
|
434
576
|
#
|
435
577
|
#
|
436
578
|
#
|
437
|
-
# [1]:
|
579
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc6266#section-4
|
438
580
|
# @option options [String] :content_encoding
|
439
581
|
# Specifies what content encodings have been applied to the object and
|
440
582
|
# thus what decoding mechanisms must be applied to obtain the media-type
|
441
583
|
# referenced by the Content-Type header field. For more information, see
|
442
|
-
# [
|
584
|
+
# [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding][1].
|
443
585
|
#
|
444
586
|
#
|
445
587
|
#
|
446
|
-
# [1]:
|
588
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding
|
447
589
|
# @option options [String] :content_language
|
448
590
|
# The language the content is in.
|
449
591
|
# @option options [Integer] :content_length
|
450
592
|
# Size of the body in bytes. This parameter is useful when the size of
|
451
593
|
# the body cannot be determined automatically. For more information, see
|
452
|
-
# [
|
594
|
+
# [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length][1].
|
453
595
|
#
|
454
596
|
#
|
455
597
|
#
|
456
|
-
# [1]:
|
598
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
|
457
599
|
# @option options [String] :content_md5
|
458
600
|
# The base64-encoded 128-bit MD5 digest of the message (without the
|
459
601
|
# headers) according to RFC 1864. This header can be used as a message
|
@@ -463,28 +605,61 @@ module Aws::S3
|
|
463
605
|
# information about REST request authentication, see [REST
|
464
606
|
# Authentication][1].
|
465
607
|
#
|
608
|
+
# <note markdown="1"> The `Content-MD5` header is required for any request to upload an
|
609
|
+
# object with a retention period configured using Amazon S3 Object Lock.
|
610
|
+
# For more information about Amazon S3 Object Lock, see [Amazon S3
|
611
|
+
# Object Lock Overview][2] in the *Amazon S3 User Guide*.
|
612
|
+
#
|
613
|
+
# </note>
|
614
|
+
#
|
615
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
616
|
+
#
|
617
|
+
# </note>
|
618
|
+
#
|
466
619
|
#
|
467
620
|
#
|
468
621
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
|
622
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html
|
469
623
|
# @option options [String] :content_type
|
470
624
|
# A standard MIME type describing the format of the contents. For more
|
471
625
|
# information, see
|
472
|
-
# [
|
626
|
+
# [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type][1].
|
473
627
|
#
|
474
628
|
#
|
475
629
|
#
|
476
|
-
# [1]:
|
630
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type
|
477
631
|
# @option options [String] :checksum_algorithm
|
478
632
|
# Indicates the algorithm used to create the checksum for the object
|
479
|
-
# when
|
480
|
-
# functionality if
|
481
|
-
# must be a corresponding `x-amz-checksum` or
|
482
|
-
# sent. Otherwise, Amazon S3 fails the request
|
483
|
-
# `400 Bad Request`.
|
484
|
-
# integrity][1] in the *Amazon S3 User Guide*.
|
633
|
+
# when you use the SDK. This header will not provide any additional
|
634
|
+
# functionality if you don't use the SDK. When you send this header,
|
635
|
+
# there must be a corresponding `x-amz-checksum-algorithm ` or
|
636
|
+
# `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
|
637
|
+
# with the HTTP status code `400 Bad Request`.
|
485
638
|
#
|
486
|
-
#
|
487
|
-
#
|
639
|
+
# For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
|
640
|
+
# the supported algorithm from the following list:
|
641
|
+
#
|
642
|
+
# * CRC32
|
643
|
+
#
|
644
|
+
# * CRC32C
|
645
|
+
#
|
646
|
+
# * SHA1
|
647
|
+
#
|
648
|
+
# * SHA256
|
649
|
+
#
|
650
|
+
# For more information, see [Checking object integrity][1] in the
|
651
|
+
# *Amazon S3 User Guide*.
|
652
|
+
#
|
653
|
+
# If the individual checksum value you provide through
|
654
|
+
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
655
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any
|
656
|
+
# provided `ChecksumAlgorithm` parameter and uses the checksum algorithm
|
657
|
+
# that matches the provided value in `x-amz-checksum-algorithm `.
|
658
|
+
#
|
659
|
+
# <note markdown="1"> For directory buckets, when you use Amazon Web Services SDKs, `CRC32`
|
660
|
+
# is the default checksum algorithm that's used for performance.
|
661
|
+
#
|
662
|
+
# </note>
|
488
663
|
#
|
489
664
|
#
|
490
665
|
#
|
@@ -532,42 +707,85 @@ module Aws::S3
|
|
532
707
|
# @option options [Time,DateTime,Date,Integer,String] :expires
|
533
708
|
# The date and time at which the object is no longer cacheable. For more
|
534
709
|
# information, see
|
535
|
-
# [
|
710
|
+
# [https://www.rfc-editor.org/rfc/rfc7234#section-5.3][1].
|
536
711
|
#
|
537
712
|
#
|
538
713
|
#
|
539
|
-
# [1]:
|
714
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3
|
540
715
|
# @option options [String] :grant_full_control
|
541
716
|
# Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
|
542
717
|
# object.
|
543
718
|
#
|
544
|
-
# This
|
719
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
720
|
+
#
|
721
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
722
|
+
#
|
723
|
+
# </note>
|
545
724
|
# @option options [String] :grant_read
|
546
725
|
# Allows grantee to read the object data and its metadata.
|
547
726
|
#
|
548
|
-
# This
|
727
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
728
|
+
#
|
729
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
730
|
+
#
|
731
|
+
# </note>
|
549
732
|
# @option options [String] :grant_read_acp
|
550
733
|
# Allows grantee to read the object ACL.
|
551
734
|
#
|
552
|
-
# This
|
735
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
736
|
+
#
|
737
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
738
|
+
#
|
739
|
+
# </note>
|
553
740
|
# @option options [String] :grant_write_acp
|
554
741
|
# Allows grantee to write the ACL for the applicable object.
|
555
742
|
#
|
556
|
-
# This
|
743
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
744
|
+
#
|
745
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
746
|
+
#
|
747
|
+
# </note>
|
557
748
|
# @option options [required, String] :key
|
558
749
|
# Object key for which the PUT action was initiated.
|
559
750
|
# @option options [Hash<String,String>] :metadata
|
560
751
|
# A map of metadata to store with the object in S3.
|
561
752
|
# @option options [String] :server_side_encryption
|
562
|
-
# The server-side encryption algorithm used when
|
563
|
-
# Amazon S3 (for example, AES256
|
753
|
+
# The server-side encryption algorithm that was used when you store this
|
754
|
+
# object in Amazon S3 (for example, `AES256`, `aws:kms`,
|
755
|
+
# `aws:kms:dsse`).
|
756
|
+
#
|
757
|
+
# <b>General purpose buckets </b> - You have four mutually exclusive
|
758
|
+
# options to protect data using server-side encryption in Amazon S3,
|
759
|
+
# depending on how you choose to manage the encryption keys.
|
760
|
+
# Specifically, the encryption key options are Amazon S3 managed keys
|
761
|
+
# (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and
|
762
|
+
# customer-provided keys (SSE-C). Amazon S3 encrypts data with
|
763
|
+
# server-side encryption by using Amazon S3 managed keys (SSE-S3) by
|
764
|
+
# default. You can optionally tell Amazon S3 to encrypt data at rest by
|
765
|
+
# using server-side encryption with other key options. For more
|
766
|
+
# information, see [Using Server-Side Encryption][1] in the *Amazon S3
|
767
|
+
# User Guide*.
|
768
|
+
#
|
769
|
+
# <b>Directory buckets </b> - For directory buckets, only the
|
770
|
+
# server-side encryption with Amazon S3 managed keys (SSE-S3) (`AES256`)
|
771
|
+
# value is supported.
|
772
|
+
#
|
773
|
+
#
|
774
|
+
#
|
775
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html
|
564
776
|
# @option options [String] :storage_class
|
565
777
|
# By default, Amazon S3 uses the STANDARD Storage Class to store newly
|
566
778
|
# created objects. The STANDARD storage class provides high durability
|
567
779
|
# and high availability. Depending on performance needs, you can specify
|
568
|
-
# a different Storage Class.
|
569
|
-
#
|
570
|
-
#
|
780
|
+
# a different Storage Class. For more information, see [Storage
|
781
|
+
# Classes][1] in the *Amazon S3 User Guide*.
|
782
|
+
#
|
783
|
+
# <note markdown="1"> * For directory buckets, only the S3 Express One Zone storage class is
|
784
|
+
# supported to store newly created objects.
|
785
|
+
#
|
786
|
+
# * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.
|
787
|
+
#
|
788
|
+
# </note>
|
571
789
|
#
|
572
790
|
#
|
573
791
|
#
|
@@ -576,7 +794,8 @@ module Aws::S3
|
|
576
794
|
# If the bucket is configured as a website, redirects requests for this
|
577
795
|
# object to another object in the same bucket or to an external URL.
|
578
796
|
# Amazon S3 stores the value of this header in the object metadata. For
|
579
|
-
# information about object metadata, see [Object Key and Metadata][1]
|
797
|
+
# information about object metadata, see [Object Key and Metadata][1] in
|
798
|
+
# the *Amazon S3 User Guide*.
|
580
799
|
#
|
581
800
|
# In the following example, the request header sets the redirect to an
|
582
801
|
# object (anotherPage.html) in the same bucket:
|
@@ -590,7 +809,11 @@ module Aws::S3
|
|
590
809
|
#
|
591
810
|
# For more information about website hosting in Amazon S3, see [Hosting
|
592
811
|
# Websites on Amazon S3][2] and [How to Configure Website Page
|
593
|
-
# Redirects][3]
|
812
|
+
# Redirects][3] in the *Amazon S3 User Guide*.
|
813
|
+
#
|
814
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
815
|
+
#
|
816
|
+
# </note>
|
594
817
|
#
|
595
818
|
#
|
596
819
|
#
|
@@ -598,73 +821,127 @@ module Aws::S3
|
|
598
821
|
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
|
599
822
|
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
|
600
823
|
# @option options [String] :sse_customer_algorithm
|
601
|
-
# Specifies the algorithm to use
|
602
|
-
# example, AES256).
|
824
|
+
# Specifies the algorithm to use when encrypting the object (for
|
825
|
+
# example, `AES256`).
|
826
|
+
#
|
827
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
828
|
+
#
|
829
|
+
# </note>
|
603
830
|
# @option options [String] :sse_customer_key
|
604
831
|
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
605
832
|
# encrypting data. This value is used to store the object and then it is
|
606
833
|
# discarded; Amazon S3 does not store the encryption key. The key must
|
607
834
|
# be appropriate for use with the algorithm specified in the
|
608
835
|
# `x-amz-server-side-encryption-customer-algorithm` header.
|
836
|
+
#
|
837
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
838
|
+
#
|
839
|
+
# </note>
|
609
840
|
# @option options [String] :sse_customer_key_md5
|
610
841
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
611
842
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
612
843
|
# ensure that the encryption key was transmitted without error.
|
844
|
+
#
|
845
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
846
|
+
#
|
847
|
+
# </note>
|
613
848
|
# @option options [String] :ssekms_key_id
|
614
|
-
# If `x-amz-server-side-encryption`
|
615
|
-
# `aws:kms`, this header specifies the ID
|
616
|
-
# Management Service (
|
617
|
-
# managed key that was used for the object. If you specify
|
618
|
-
# `x-amz-server-side-encryption:aws:kms
|
849
|
+
# If `x-amz-server-side-encryption` has a valid value of `aws:kms` or
|
850
|
+
# `aws:kms:dsse`, this header specifies the ID (Key ID, Key ARN, or Key
|
851
|
+
# Alias) of the Key Management Service (KMS) symmetric encryption
|
852
|
+
# customer managed key that was used for the object. If you specify
|
853
|
+
# `x-amz-server-side-encryption:aws:kms` or
|
854
|
+
# `x-amz-server-side-encryption:aws:kms:dsse`, but do not provide`
|
619
855
|
# x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
|
620
|
-
# Amazon Web Services managed key to protect the data. If the
|
621
|
-
# does not exist in the same account issuing the
|
622
|
-
# the full ARN and not just the ID.
|
856
|
+
# Amazon Web Services managed key (`aws/s3`) to protect the data. If the
|
857
|
+
# KMS key does not exist in the same account that's issuing the
|
858
|
+
# command, you must use the full ARN and not just the ID.
|
859
|
+
#
|
860
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
861
|
+
#
|
862
|
+
# </note>
|
623
863
|
# @option options [String] :ssekms_encryption_context
|
624
864
|
# Specifies the Amazon Web Services KMS Encryption Context to use for
|
625
865
|
# object encryption. The value of this header is a base64-encoded UTF-8
|
626
|
-
# string holding JSON with the encryption context key-value pairs.
|
866
|
+
# string holding JSON with the encryption context key-value pairs. This
|
867
|
+
# value is stored as object metadata and automatically gets passed on to
|
868
|
+
# Amazon Web Services KMS for future `GetObject` or `CopyObject`
|
869
|
+
# operations on this object. This value must be explicitly added during
|
870
|
+
# `CopyObject` operations.
|
871
|
+
#
|
872
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
873
|
+
#
|
874
|
+
# </note>
|
627
875
|
# @option options [Boolean] :bucket_key_enabled
|
628
876
|
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
629
|
-
# encryption with server-side encryption using
|
630
|
-
# Setting this header to `true` causes Amazon S3
|
631
|
-
# for object encryption with SSE-KMS.
|
877
|
+
# encryption with server-side encryption using Key Management Service
|
878
|
+
# (KMS) keys (SSE-KMS). Setting this header to `true` causes Amazon S3
|
879
|
+
# to use an S3 Bucket Key for object encryption with SSE-KMS.
|
632
880
|
#
|
633
881
|
# Specifying this header with a PUT action doesn’t affect bucket-level
|
634
882
|
# settings for S3 Bucket Key.
|
883
|
+
#
|
884
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
885
|
+
#
|
886
|
+
# </note>
|
635
887
|
# @option options [String] :request_payer
|
636
888
|
# Confirms that the requester knows that they will be charged for the
|
637
889
|
# request. Bucket owners need not specify this parameter in their
|
638
|
-
# requests.
|
890
|
+
# requests. If either the source or destination S3 bucket has Requester
|
891
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
892
|
+
# the object. For information about downloading objects from Requester
|
639
893
|
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
640
894
|
# in the *Amazon S3 User Guide*.
|
641
895
|
#
|
896
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
897
|
+
#
|
898
|
+
# </note>
|
899
|
+
#
|
642
900
|
#
|
643
901
|
#
|
644
902
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
645
903
|
# @option options [String] :tagging
|
646
904
|
# The tag-set for the object. The tag-set must be encoded as URL Query
|
647
905
|
# parameters. (For example, "Key1=Value1")
|
906
|
+
#
|
907
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
908
|
+
#
|
909
|
+
# </note>
|
648
910
|
# @option options [String] :object_lock_mode
|
649
911
|
# The Object Lock mode that you want to apply to this object.
|
912
|
+
#
|
913
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
914
|
+
#
|
915
|
+
# </note>
|
650
916
|
# @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
|
651
917
|
# The date and time when you want this object's Object Lock to expire.
|
652
918
|
# Must be formatted as a timestamp parameter.
|
919
|
+
#
|
920
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
921
|
+
#
|
922
|
+
# </note>
|
653
923
|
# @option options [String] :object_lock_legal_hold_status
|
654
924
|
# Specifies whether a legal hold will be applied to this object. For
|
655
|
-
# more information about S3 Object Lock, see [Object Lock][1]
|
925
|
+
# more information about S3 Object Lock, see [Object Lock][1] in the
|
926
|
+
# *Amazon S3 User Guide*.
|
927
|
+
#
|
928
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
929
|
+
#
|
930
|
+
# </note>
|
656
931
|
#
|
657
932
|
#
|
658
933
|
#
|
659
934
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
|
660
935
|
# @option options [String] :expected_bucket_owner
|
661
|
-
# The account ID of the expected bucket owner. If the
|
662
|
-
#
|
663
|
-
# Forbidden` (access denied).
|
936
|
+
# The account ID of the expected bucket owner. If the account ID that
|
937
|
+
# you provide does not match the actual owner of the bucket, the request
|
938
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
664
939
|
# @return [Object]
|
665
940
|
def put_object(options = {})
|
666
941
|
options = options.merge(bucket: @name)
|
667
|
-
|
942
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
943
|
+
@client.put_object(options)
|
944
|
+
end
|
668
945
|
Object.new(
|
669
946
|
bucket_name: @name,
|
670
947
|
key: options[:key],
|
@@ -723,6 +1000,7 @@ module Aws::S3
|
|
723
1000
|
# prefix: "Prefix",
|
724
1001
|
# upload_id_marker: "UploadIdMarker",
|
725
1002
|
# expected_bucket_owner: "AccountId",
|
1003
|
+
# request_payer: "requester", # accepts requester
|
726
1004
|
# })
|
727
1005
|
# @param [Hash] options ({})
|
728
1006
|
# @option options [String] :delimiter
|
@@ -734,30 +1012,70 @@ module Aws::S3
|
|
734
1012
|
# don't specify the prefix parameter, then the substring starts at the
|
735
1013
|
# beginning of the key. The keys that are grouped under `CommonPrefixes`
|
736
1014
|
# result element are not returned elsewhere in the response.
|
1015
|
+
#
|
1016
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, `/` is the only
|
1017
|
+
# supported delimiter.
|
1018
|
+
#
|
1019
|
+
# </note>
|
737
1020
|
# @option options [String] :encoding_type
|
738
|
-
#
|
739
|
-
#
|
740
|
-
# Unicode character
|
741
|
-
# characters, such as characters with an ASCII value from
|
742
|
-
# characters that
|
743
|
-
# parameter to request that Amazon S3 encode the keys in the
|
1021
|
+
# Encoding type used by Amazon S3 to encode the [object keys][1] in the
|
1022
|
+
# response. Responses are encoded only in UTF-8. An object key can
|
1023
|
+
# contain any Unicode character. However, the XML 1.0 parser can't
|
1024
|
+
# parse certain characters, such as characters with an ASCII value from
|
1025
|
+
# 0 to 10. For characters that aren't supported in XML 1.0, you can add
|
1026
|
+
# this parameter to request that Amazon S3 encode the keys in the
|
1027
|
+
# response. For more information about characters to avoid in object key
|
1028
|
+
# names, see [Object key naming guidelines][2].
|
1029
|
+
#
|
1030
|
+
# <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
|
1031
|
+
# in an object's key name will be percent-encoded according to UTF-8
|
1032
|
+
# code values. For example, the object `test_file(3).png` will appear as
|
1033
|
+
# `test_file%283%29.png`.
|
1034
|
+
#
|
1035
|
+
# </note>
|
1036
|
+
#
|
1037
|
+
#
|
1038
|
+
#
|
1039
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
|
1040
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
|
744
1041
|
# @option options [String] :key_marker
|
745
|
-
#
|
746
|
-
# upload after which listing should begin.
|
1042
|
+
# Specifies the multipart upload after which listing should begin.
|
747
1043
|
#
|
748
|
-
#
|
749
|
-
#
|
750
|
-
#
|
1044
|
+
# <note markdown="1"> * **General purpose buckets** - For general purpose buckets,
|
1045
|
+
# `key-marker` is an object key. Together with `upload-id-marker`,
|
1046
|
+
# this parameter specifies the multipart upload after which listing
|
1047
|
+
# should begin.
|
751
1048
|
#
|
752
|
-
#
|
753
|
-
#
|
754
|
-
#
|
755
|
-
#
|
1049
|
+
# If `upload-id-marker` is not specified, only the keys
|
1050
|
+
# lexicographically greater than the specified `key-marker` will be
|
1051
|
+
# included in the list.
|
1052
|
+
#
|
1053
|
+
# If `upload-id-marker` is specified, any multipart uploads for a key
|
1054
|
+
# equal to the `key-marker` might also be included, provided those
|
1055
|
+
# multipart uploads have upload IDs lexicographically greater than the
|
1056
|
+
# specified `upload-id-marker`.
|
1057
|
+
#
|
1058
|
+
# * **Directory buckets** - For directory buckets, `key-marker` is
|
1059
|
+
# obfuscated and isn't a real object key. The `upload-id-marker`
|
1060
|
+
# parameter isn't supported by directory buckets. To list the
|
1061
|
+
# additional multipart uploads, you only need to set the value of
|
1062
|
+
# `key-marker` to the `NextKeyMarker` value from the previous
|
1063
|
+
# response.
|
1064
|
+
#
|
1065
|
+
# In the `ListMultipartUploads` response, the multipart uploads
|
1066
|
+
# aren't sorted lexicographically based on the object keys.
|
1067
|
+
#
|
1068
|
+
# </note>
|
756
1069
|
# @option options [String] :prefix
|
757
1070
|
# Lists in-progress uploads only for those keys that begin with the
|
758
1071
|
# specified prefix. You can use prefixes to separate a bucket into
|
759
|
-
# different grouping of keys. (You can think of using prefix to make
|
760
|
-
# groups in the same way you'd use a folder in a file system.)
|
1072
|
+
# different grouping of keys. (You can think of using `prefix` to make
|
1073
|
+
# groups in the same way that you'd use a folder in a file system.)
|
1074
|
+
#
|
1075
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
|
1076
|
+
# in a delimiter (`/`) are supported.
|
1077
|
+
#
|
1078
|
+
# </note>
|
761
1079
|
# @option options [String] :upload_id_marker
|
762
1080
|
# Together with key-marker, specifies the multipart upload after which
|
763
1081
|
# listing should begin. If key-marker is not specified, the
|
@@ -765,15 +1083,37 @@ module Aws::S3
|
|
765
1083
|
# uploads for a key equal to the key-marker might be included in the
|
766
1084
|
# list only if they have an upload ID lexicographically greater than the
|
767
1085
|
# specified `upload-id-marker`.
|
1086
|
+
#
|
1087
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1088
|
+
#
|
1089
|
+
# </note>
|
768
1090
|
# @option options [String] :expected_bucket_owner
|
769
|
-
# The account ID of the expected bucket owner. If the
|
770
|
-
#
|
771
|
-
# Forbidden` (access denied).
|
1091
|
+
# The account ID of the expected bucket owner. If the account ID that
|
1092
|
+
# you provide does not match the actual owner of the bucket, the request
|
1093
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1094
|
+
# @option options [String] :request_payer
|
1095
|
+
# Confirms that the requester knows that they will be charged for the
|
1096
|
+
# request. Bucket owners need not specify this parameter in their
|
1097
|
+
# requests. If either the source or destination S3 bucket has Requester
|
1098
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
1099
|
+
# the object. For information about downloading objects from Requester
|
1100
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
1101
|
+
# in the *Amazon S3 User Guide*.
|
1102
|
+
#
|
1103
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1104
|
+
#
|
1105
|
+
# </note>
|
1106
|
+
#
|
1107
|
+
#
|
1108
|
+
#
|
1109
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
772
1110
|
# @return [MultipartUpload::Collection]
|
773
1111
|
def multipart_uploads(options = {})
|
774
1112
|
batches = Enumerator.new do |y|
|
775
1113
|
options = options.merge(bucket: @name)
|
776
|
-
resp =
|
1114
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1115
|
+
@client.list_multipart_uploads(options)
|
1116
|
+
end
|
777
1117
|
resp.each_page do |page|
|
778
1118
|
batch = []
|
779
1119
|
page.data.uploads.each do |u|
|
@@ -818,42 +1158,79 @@ module Aws::S3
|
|
818
1158
|
# prefix: "Prefix",
|
819
1159
|
# version_id_marker: "VersionIdMarker",
|
820
1160
|
# expected_bucket_owner: "AccountId",
|
1161
|
+
# request_payer: "requester", # accepts requester
|
1162
|
+
# optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
|
821
1163
|
# })
|
822
1164
|
# @param [Hash] options ({})
|
823
1165
|
# @option options [String] :delimiter
|
824
1166
|
# A delimiter is a character that you specify to group keys. All keys
|
825
1167
|
# that contain the same string between the `prefix` and the first
|
826
1168
|
# occurrence of the delimiter are grouped under a single result element
|
827
|
-
# in CommonPrefixes
|
828
|
-
# max-keys limitation. These keys are not returned elsewhere in
|
829
|
-
# response.
|
1169
|
+
# in `CommonPrefixes`. These groups are counted as one result against
|
1170
|
+
# the `max-keys` limitation. These keys are not returned elsewhere in
|
1171
|
+
# the response.
|
830
1172
|
# @option options [String] :encoding_type
|
831
|
-
#
|
832
|
-
#
|
833
|
-
# Unicode character
|
834
|
-
# characters, such as characters with an ASCII value from
|
835
|
-
# characters that
|
836
|
-
# parameter to request that Amazon S3 encode the keys in the
|
1173
|
+
# Encoding type used by Amazon S3 to encode the [object keys][1] in the
|
1174
|
+
# response. Responses are encoded only in UTF-8. An object key can
|
1175
|
+
# contain any Unicode character. However, the XML 1.0 parser can't
|
1176
|
+
# parse certain characters, such as characters with an ASCII value from
|
1177
|
+
# 0 to 10. For characters that aren't supported in XML 1.0, you can add
|
1178
|
+
# this parameter to request that Amazon S3 encode the keys in the
|
1179
|
+
# response. For more information about characters to avoid in object key
|
1180
|
+
# names, see [Object key naming guidelines][2].
|
1181
|
+
#
|
1182
|
+
# <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
|
1183
|
+
# in an object's key name will be percent-encoded according to UTF-8
|
1184
|
+
# code values. For example, the object `test_file(3).png` will appear as
|
1185
|
+
# `test_file%283%29.png`.
|
1186
|
+
#
|
1187
|
+
# </note>
|
1188
|
+
#
|
1189
|
+
#
|
1190
|
+
#
|
1191
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
|
1192
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
|
837
1193
|
# @option options [String] :key_marker
|
838
1194
|
# Specifies the key to start with when listing objects in a bucket.
|
839
1195
|
# @option options [String] :prefix
|
840
1196
|
# Use this parameter to select only those keys that begin with the
|
841
1197
|
# specified prefix. You can use prefixes to separate a bucket into
|
842
|
-
# different groupings of keys. (You can think of using prefix to make
|
843
|
-
# groups in the same way you'd use a folder in a file system.) You
|
844
|
-
# use prefix with delimiter to roll up numerous objects into a
|
845
|
-
# result under CommonPrefixes
|
1198
|
+
# different groupings of keys. (You can think of using `prefix` to make
|
1199
|
+
# groups in the same way that you'd use a folder in a file system.) You
|
1200
|
+
# can use `prefix` with `delimiter` to roll up numerous objects into a
|
1201
|
+
# single result under `CommonPrefixes`.
|
846
1202
|
# @option options [String] :version_id_marker
|
847
1203
|
# Specifies the object version you want to start listing from.
|
848
1204
|
# @option options [String] :expected_bucket_owner
|
849
|
-
# The account ID of the expected bucket owner. If the
|
850
|
-
#
|
851
|
-
# Forbidden` (access denied).
|
1205
|
+
# The account ID of the expected bucket owner. If the account ID that
|
1206
|
+
# you provide does not match the actual owner of the bucket, the request
|
1207
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1208
|
+
# @option options [String] :request_payer
|
1209
|
+
# Confirms that the requester knows that they will be charged for the
|
1210
|
+
# request. Bucket owners need not specify this parameter in their
|
1211
|
+
# requests. If either the source or destination S3 bucket has Requester
|
1212
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
1213
|
+
# the object. For information about downloading objects from Requester
|
1214
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
1215
|
+
# in the *Amazon S3 User Guide*.
|
1216
|
+
#
|
1217
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1218
|
+
#
|
1219
|
+
# </note>
|
1220
|
+
#
|
1221
|
+
#
|
1222
|
+
#
|
1223
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
1224
|
+
# @option options [Array<String>] :optional_object_attributes
|
1225
|
+
# Specifies the optional fields that you want returned in the response.
|
1226
|
+
# Fields that you do not specify are not returned.
|
852
1227
|
# @return [ObjectVersion::Collection]
|
853
1228
|
def object_versions(options = {})
|
854
1229
|
batches = Enumerator.new do |y|
|
855
1230
|
options = options.merge(bucket: @name)
|
856
|
-
resp =
|
1231
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1232
|
+
@client.list_object_versions(options)
|
1233
|
+
end
|
857
1234
|
resp.each_page do |page|
|
858
1235
|
batch = []
|
859
1236
|
page.data.versions_delete_markers.each do |v|
|
@@ -881,35 +1258,98 @@ module Aws::S3
|
|
881
1258
|
# start_after: "StartAfter",
|
882
1259
|
# request_payer: "requester", # accepts requester
|
883
1260
|
# expected_bucket_owner: "AccountId",
|
1261
|
+
# optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
|
884
1262
|
# })
|
885
1263
|
# @param [Hash] options ({})
|
886
1264
|
# @option options [String] :delimiter
|
887
|
-
# A delimiter is a character you use to group keys.
|
1265
|
+
# A delimiter is a character that you use to group keys.
|
1266
|
+
#
|
1267
|
+
# <note markdown="1"> * **Directory buckets** - For directory buckets, `/` is the only
|
1268
|
+
# supported delimiter.
|
1269
|
+
#
|
1270
|
+
# * <b>Directory buckets </b> - When you query `ListObjectsV2` with a
|
1271
|
+
# delimiter during in-progress multipart uploads, the `CommonPrefixes`
|
1272
|
+
# response parameter contains the prefixes that are associated with
|
1273
|
+
# the in-progress multipart uploads. For more information about
|
1274
|
+
# multipart uploads, see [Multipart Upload Overview][1] in the *Amazon
|
1275
|
+
# S3 User Guide*.
|
1276
|
+
#
|
1277
|
+
# </note>
|
1278
|
+
#
|
1279
|
+
#
|
1280
|
+
#
|
1281
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html
|
888
1282
|
# @option options [String] :encoding_type
|
889
|
-
# Encoding type used by Amazon S3 to encode object keys in the
|
1283
|
+
# Encoding type used by Amazon S3 to encode the [object keys][1] in the
|
1284
|
+
# response. Responses are encoded only in UTF-8. An object key can
|
1285
|
+
# contain any Unicode character. However, the XML 1.0 parser can't
|
1286
|
+
# parse certain characters, such as characters with an ASCII value from
|
1287
|
+
# 0 to 10. For characters that aren't supported in XML 1.0, you can add
|
1288
|
+
# this parameter to request that Amazon S3 encode the keys in the
|
1289
|
+
# response. For more information about characters to avoid in object key
|
1290
|
+
# names, see [Object key naming guidelines][2].
|
1291
|
+
#
|
1292
|
+
# <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
|
1293
|
+
# in an object's key name will be percent-encoded according to UTF-8
|
1294
|
+
# code values. For example, the object `test_file(3).png` will appear as
|
1295
|
+
# `test_file%283%29.png`.
|
1296
|
+
#
|
1297
|
+
# </note>
|
1298
|
+
#
|
1299
|
+
#
|
1300
|
+
#
|
1301
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
|
1302
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
|
890
1303
|
# @option options [String] :prefix
|
891
1304
|
# Limits the response to keys that begin with the specified prefix.
|
1305
|
+
#
|
1306
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
|
1307
|
+
# in a delimiter (`/`) are supported.
|
1308
|
+
#
|
1309
|
+
# </note>
|
892
1310
|
# @option options [Boolean] :fetch_owner
|
893
|
-
# The owner field is not present in
|
894
|
-
# return owner field with each key in the result then set
|
895
|
-
#
|
1311
|
+
# The owner field is not present in `ListObjectsV2` by default. If you
|
1312
|
+
# want to return the owner field with each key in the result, then set
|
1313
|
+
# the `FetchOwner` field to `true`.
|
1314
|
+
#
|
1315
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, the bucket owner is
|
1316
|
+
# returned as the object owner for all objects.
|
1317
|
+
#
|
1318
|
+
# </note>
|
896
1319
|
# @option options [String] :start_after
|
897
1320
|
# StartAfter is where you want Amazon S3 to start listing from. Amazon
|
898
1321
|
# S3 starts listing after this specified key. StartAfter can be any key
|
899
1322
|
# in the bucket.
|
1323
|
+
#
|
1324
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1325
|
+
#
|
1326
|
+
# </note>
|
900
1327
|
# @option options [String] :request_payer
|
901
1328
|
# Confirms that the requester knows that she or he will be charged for
|
902
1329
|
# the list objects request in V2 style. Bucket owners need not specify
|
903
1330
|
# this parameter in their requests.
|
1331
|
+
#
|
1332
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1333
|
+
#
|
1334
|
+
# </note>
|
904
1335
|
# @option options [String] :expected_bucket_owner
|
905
|
-
# The account ID of the expected bucket owner. If the
|
906
|
-
#
|
907
|
-
# Forbidden` (access denied).
|
1336
|
+
# The account ID of the expected bucket owner. If the account ID that
|
1337
|
+
# you provide does not match the actual owner of the bucket, the request
|
1338
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1339
|
+
# @option options [Array<String>] :optional_object_attributes
|
1340
|
+
# Specifies the optional fields that you want returned in the response.
|
1341
|
+
# Fields that you do not specify are not returned.
|
1342
|
+
#
|
1343
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1344
|
+
#
|
1345
|
+
# </note>
|
908
1346
|
# @return [ObjectSummary::Collection]
|
909
1347
|
def objects(options = {})
|
910
1348
|
batches = Enumerator.new do |y|
|
911
1349
|
options = options.merge(bucket: @name)
|
912
|
-
resp =
|
1350
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1351
|
+
@client.list_objects_v2(options)
|
1352
|
+
end
|
913
1353
|
resp.each_page do |page|
|
914
1354
|
batch = []
|
915
1355
|
page.data.contents.each do |c|
|