aws-sdk-s3 1.128.0 → 1.130.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 +13 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/bucket.rb +1 -1
- data/lib/aws-sdk-s3/client.rb +94 -88
- data/lib/aws-sdk-s3/customizations/errors.rb +1 -1
- data/lib/aws-sdk-s3/customizations/object.rb +8 -0
- data/lib/aws-sdk-s3/object_multipart_copier.rb +33 -17
- data/lib/aws-sdk-s3/presigned_post.rb +52 -43
- data/lib/aws-sdk-s3/resource.rb +1 -1
- data/lib/aws-sdk-s3.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9170ab560df5828b8608754ee83facb83ccd4f09b425661c2f81bef05d45085c
|
4
|
+
data.tar.gz: 70f914ab9977fac81df71f9dd5ba0509a0d598f72cf1f988c491e37aa9db000c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ece1dd86bf6963b66f243289c3ca2d9e77ddee8f745dd9ea166464c96250de2377a8a2b7ce38e3d38bb66b02bc292884f9293b4aaa9d6b9a267b81b1b1fa2e06
|
7
|
+
data.tar.gz: e9cca71b4d710aad1af40c1dea6f06955480d6a8db748a61c66e8f41d49fb271def041fffce98c81f47fa5100c2375caa8492684ab7601d8fe45f712f07061f4
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.130.0 (2023-07-13)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - S3 Inventory now supports Object Access Control List and Object Owner as available object metadata fields in inventory reports.
|
8
|
+
|
9
|
+
* Feature - Allow Object multipart copy API to work when requiring a checksum algorithm.
|
10
|
+
* Feature - Allow Object multipart copy API to optionally copy parts as they exist on the source object if it has parts, instead of generating new part ranges, when specifying `use_source_parts: true`.
|
11
|
+
|
12
|
+
1.129.0 (2023-07-11)
|
13
|
+
------------------
|
14
|
+
|
15
|
+
* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
|
16
|
+
|
4
17
|
1.128.0 (2023-07-06)
|
5
18
|
------------------
|
6
19
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.130.0
|
data/lib/aws-sdk-s3/bucket.rb
CHANGED
@@ -229,7 +229,7 @@ module Aws::S3
|
|
229
229
|
# bucket.create({
|
230
230
|
# acl: "private", # accepts private, public-read, public-read-write, authenticated-read
|
231
231
|
# create_bucket_configuration: {
|
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-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-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, ap-south-2, eu-south-2
|
233
233
|
# },
|
234
234
|
# grant_full_control: "GrantFullControl",
|
235
235
|
# grant_read: "GrantRead",
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -272,6 +272,10 @@ module Aws::S3
|
|
272
272
|
# When set to `true`, the bucket name is always left in the
|
273
273
|
# request URI and never moved to the host as a sub-domain.
|
274
274
|
#
|
275
|
+
# @option options [Boolean] :ignore_configured_endpoint_urls
|
276
|
+
# Setting to true disables use of endpoint URLs provided via environment
|
277
|
+
# variables and the shared configuration file.
|
278
|
+
#
|
275
279
|
# @option options [Proc] :input_event_stream_handler
|
276
280
|
# When an EventStream or Proc object is provided, it can be used for sending events for the event stream.
|
277
281
|
#
|
@@ -964,8 +968,10 @@ module Aws::S3
|
|
964
968
|
# </note>
|
965
969
|
#
|
966
970
|
# The copy request charge is based on the storage class and Region that
|
967
|
-
# you specify for the destination object.
|
968
|
-
#
|
971
|
+
# you specify for the destination object. The request can also result in
|
972
|
+
# a data retrieval charge for the source if the source storage class
|
973
|
+
# bills for data retrieval. For pricing information, see [Amazon S3
|
974
|
+
# pricing][3].
|
969
975
|
#
|
970
976
|
# Amazon S3 transfer acceleration does not support cross-Region copies.
|
971
977
|
# If you request a cross-Region copy using a transfer acceleration
|
@@ -1691,33 +1697,33 @@ module Aws::S3
|
|
1691
1697
|
# * {Types::CreateBucketOutput#location #location} => String
|
1692
1698
|
#
|
1693
1699
|
#
|
1694
|
-
# @example Example: To create a bucket
|
1700
|
+
# @example Example: To create a bucket in a specific region
|
1695
1701
|
#
|
1696
|
-
# # The following example creates a bucket.
|
1702
|
+
# # The following example creates a bucket. The request specifies an AWS region where to create the bucket.
|
1697
1703
|
#
|
1698
1704
|
# resp = client.create_bucket({
|
1699
1705
|
# bucket: "examplebucket",
|
1706
|
+
# create_bucket_configuration: {
|
1707
|
+
# location_constraint: "eu-west-1",
|
1708
|
+
# },
|
1700
1709
|
# })
|
1701
1710
|
#
|
1702
1711
|
# resp.to_h outputs the following:
|
1703
1712
|
# {
|
1704
|
-
# location: "/
|
1713
|
+
# location: "http://examplebucket.<Region>.s3.amazonaws.com/",
|
1705
1714
|
# }
|
1706
1715
|
#
|
1707
|
-
# @example Example: To create a bucket
|
1716
|
+
# @example Example: To create a bucket
|
1708
1717
|
#
|
1709
|
-
# # The following example creates a bucket.
|
1718
|
+
# # The following example creates a bucket.
|
1710
1719
|
#
|
1711
1720
|
# resp = client.create_bucket({
|
1712
1721
|
# bucket: "examplebucket",
|
1713
|
-
# create_bucket_configuration: {
|
1714
|
-
# location_constraint: "eu-west-1",
|
1715
|
-
# },
|
1716
1722
|
# })
|
1717
1723
|
#
|
1718
1724
|
# resp.to_h outputs the following:
|
1719
1725
|
# {
|
1720
|
-
# location: "
|
1726
|
+
# location: "/examplebucket",
|
1721
1727
|
# }
|
1722
1728
|
#
|
1723
1729
|
# @example Request syntax with placeholder values
|
@@ -1726,7 +1732,7 @@ module Aws::S3
|
|
1726
1732
|
# acl: "private", # accepts private, public-read, public-read-write, authenticated-read
|
1727
1733
|
# bucket: "BucketName", # required
|
1728
1734
|
# create_bucket_configuration: {
|
1729
|
-
# 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
|
1735
|
+
# 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, ap-south-2, eu-south-2
|
1730
1736
|
# },
|
1731
1737
|
# grant_full_control: "GrantFullControl",
|
1732
1738
|
# grant_read: "GrantRead",
|
@@ -3169,6 +3175,15 @@ module Aws::S3
|
|
3169
3175
|
# * {Types::DeleteObjectOutput#request_charged #request_charged} => String
|
3170
3176
|
#
|
3171
3177
|
#
|
3178
|
+
# @example Example: To delete an object (from a non-versioned bucket)
|
3179
|
+
#
|
3180
|
+
# # The following example deletes an object from a non-versioned bucket.
|
3181
|
+
#
|
3182
|
+
# resp = client.delete_object({
|
3183
|
+
# bucket: "ExampleBucket",
|
3184
|
+
# key: "HappyFace.jpg",
|
3185
|
+
# })
|
3186
|
+
#
|
3172
3187
|
# @example Example: To delete an object
|
3173
3188
|
#
|
3174
3189
|
# # The following example deletes an object from an S3 bucket.
|
@@ -3182,15 +3197,6 @@ module Aws::S3
|
|
3182
3197
|
# {
|
3183
3198
|
# }
|
3184
3199
|
#
|
3185
|
-
# @example Example: To delete an object (from a non-versioned bucket)
|
3186
|
-
#
|
3187
|
-
# # The following example deletes an object from a non-versioned bucket.
|
3188
|
-
#
|
3189
|
-
# resp = client.delete_object({
|
3190
|
-
# bucket: "ExampleBucket",
|
3191
|
-
# key: "HappyFace.jpg",
|
3192
|
-
# })
|
3193
|
-
#
|
3194
3200
|
# @example Request syntax with placeholder values
|
3195
3201
|
#
|
3196
3202
|
# resp = client.delete_object({
|
@@ -3282,35 +3288,35 @@ module Aws::S3
|
|
3282
3288
|
# * {Types::DeleteObjectTaggingOutput#version_id #version_id} => String
|
3283
3289
|
#
|
3284
3290
|
#
|
3285
|
-
# @example Example: To remove tag set from an object
|
3291
|
+
# @example Example: To remove tag set from an object
|
3286
3292
|
#
|
3287
|
-
# # The following example removes tag set associated with the specified object
|
3288
|
-
# #
|
3293
|
+
# # The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the
|
3294
|
+
# # operation removes tag set from the latest object version.
|
3289
3295
|
#
|
3290
3296
|
# resp = client.delete_object_tagging({
|
3291
3297
|
# bucket: "examplebucket",
|
3292
3298
|
# key: "HappyFace.jpg",
|
3293
|
-
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
3294
3299
|
# })
|
3295
3300
|
#
|
3296
3301
|
# resp.to_h outputs the following:
|
3297
3302
|
# {
|
3298
|
-
# version_id: "
|
3303
|
+
# version_id: "null",
|
3299
3304
|
# }
|
3300
3305
|
#
|
3301
|
-
# @example Example: To remove tag set from an object
|
3306
|
+
# @example Example: To remove tag set from an object version
|
3302
3307
|
#
|
3303
|
-
# # The following example removes tag set associated with the specified object.
|
3304
|
-
# #
|
3308
|
+
# # The following example removes tag set associated with the specified object version. The request specifies both the
|
3309
|
+
# # object key and object version.
|
3305
3310
|
#
|
3306
3311
|
# resp = client.delete_object_tagging({
|
3307
3312
|
# bucket: "examplebucket",
|
3308
3313
|
# key: "HappyFace.jpg",
|
3314
|
+
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
3309
3315
|
# })
|
3310
3316
|
#
|
3311
3317
|
# resp.to_h outputs the following:
|
3312
3318
|
# {
|
3313
|
-
# version_id: "
|
3319
|
+
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
3314
3320
|
# }
|
3315
3321
|
#
|
3316
3322
|
# @example Request syntax with placeholder values
|
@@ -4223,7 +4229,7 @@ module Aws::S3
|
|
4223
4229
|
# resp.inventory_configuration.id #=> String
|
4224
4230
|
# resp.inventory_configuration.included_object_versions #=> String, one of "All", "Current"
|
4225
4231
|
# resp.inventory_configuration.optional_fields #=> Array
|
4226
|
-
# resp.inventory_configuration.optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm"
|
4232
|
+
# resp.inventory_configuration.optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm", "ObjectAccessControlList", "ObjectOwner"
|
4227
4233
|
# resp.inventory_configuration.schedule.frequency #=> String, one of "Daily", "Weekly"
|
4228
4234
|
#
|
4229
4235
|
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration AWS API Documentation
|
@@ -4567,7 +4573,7 @@ module Aws::S3
|
|
4567
4573
|
#
|
4568
4574
|
# @example Response structure
|
4569
4575
|
#
|
4570
|
-
# resp.location_constraint #=> String, one of "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"
|
4576
|
+
# resp.location_constraint #=> String, one of "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", "ap-south-2", "eu-south-2"
|
4571
4577
|
#
|
4572
4578
|
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation AWS API Documentation
|
4573
4579
|
#
|
@@ -7741,7 +7747,7 @@ module Aws::S3
|
|
7741
7747
|
# resp.inventory_configuration_list[0].id #=> String
|
7742
7748
|
# resp.inventory_configuration_list[0].included_object_versions #=> String, one of "All", "Current"
|
7743
7749
|
# resp.inventory_configuration_list[0].optional_fields #=> Array
|
7744
|
-
# resp.inventory_configuration_list[0].optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm"
|
7750
|
+
# resp.inventory_configuration_list[0].optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm", "ObjectAccessControlList", "ObjectOwner"
|
7745
7751
|
# resp.inventory_configuration_list[0].schedule.frequency #=> String, one of "Daily", "Weekly"
|
7746
7752
|
# resp.is_truncated #=> Boolean
|
7747
7753
|
# resp.next_continuation_token #=> String
|
@@ -10165,7 +10171,7 @@ module Aws::S3
|
|
10165
10171
|
# },
|
10166
10172
|
# id: "InventoryId", # required
|
10167
10173
|
# included_object_versions: "All", # required, accepts All, Current
|
10168
|
-
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier, BucketKeyStatus, ChecksumAlgorithm
|
10174
|
+
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier, BucketKeyStatus, ChecksumAlgorithm, ObjectAccessControlList, ObjectOwner
|
10169
10175
|
# schedule: { # required
|
10170
10176
|
# frequency: "Daily", # required, accepts Daily, Weekly
|
10171
10177
|
# },
|
@@ -12489,61 +12495,58 @@ module Aws::S3
|
|
12489
12495
|
# * {Types::PutObjectOutput#request_charged #request_charged} => String
|
12490
12496
|
#
|
12491
12497
|
#
|
12492
|
-
# @example Example: To
|
12498
|
+
# @example Example: To create an object.
|
12493
12499
|
#
|
12494
|
-
# # The following example creates an object.
|
12495
|
-
# # enabled, S3 returns version ID in response.
|
12500
|
+
# # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
|
12496
12501
|
#
|
12497
12502
|
# resp = client.put_object({
|
12498
12503
|
# body: "filetoupload",
|
12499
12504
|
# bucket: "examplebucket",
|
12500
|
-
# key: "
|
12501
|
-
# metadata: {
|
12502
|
-
# "metadata1" => "value1",
|
12503
|
-
# "metadata2" => "value2",
|
12504
|
-
# },
|
12505
|
+
# key: "objectkey",
|
12505
12506
|
# })
|
12506
12507
|
#
|
12507
12508
|
# resp.to_h outputs the following:
|
12508
12509
|
# {
|
12509
12510
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12510
|
-
# version_id: "
|
12511
|
+
# version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
|
12511
12512
|
# }
|
12512
12513
|
#
|
12513
|
-
# @example Example: To upload
|
12514
|
+
# @example Example: To upload object and specify user-defined metadata
|
12514
12515
|
#
|
12515
|
-
# # The following example
|
12516
|
-
# #
|
12516
|
+
# # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning
|
12517
|
+
# # enabled, S3 returns version ID in response.
|
12517
12518
|
#
|
12518
12519
|
# resp = client.put_object({
|
12519
|
-
# body: "
|
12520
|
+
# body: "filetoupload",
|
12520
12521
|
# bucket: "examplebucket",
|
12521
|
-
# key: "
|
12522
|
-
#
|
12523
|
-
#
|
12522
|
+
# key: "exampleobject",
|
12523
|
+
# metadata: {
|
12524
|
+
# "metadata1" => "value1",
|
12525
|
+
# "metadata2" => "value2",
|
12526
|
+
# },
|
12524
12527
|
# })
|
12525
12528
|
#
|
12526
12529
|
# resp.to_h outputs the following:
|
12527
12530
|
# {
|
12528
12531
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12529
|
-
#
|
12530
|
-
# version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp",
|
12532
|
+
# version_id: "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0",
|
12531
12533
|
# }
|
12532
12534
|
#
|
12533
|
-
# @example Example: To
|
12535
|
+
# @example Example: To upload an object
|
12534
12536
|
#
|
12535
|
-
# # The following example
|
12537
|
+
# # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
|
12538
|
+
# # syntax. S3 returns VersionId of the newly created object.
|
12536
12539
|
#
|
12537
12540
|
# resp = client.put_object({
|
12538
|
-
# body: "
|
12541
|
+
# body: "HappyFace.jpg",
|
12539
12542
|
# bucket: "examplebucket",
|
12540
|
-
# key: "
|
12543
|
+
# key: "HappyFace.jpg",
|
12541
12544
|
# })
|
12542
12545
|
#
|
12543
12546
|
# resp.to_h outputs the following:
|
12544
12547
|
# {
|
12545
12548
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12546
|
-
# version_id: "
|
12549
|
+
# version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
|
12547
12550
|
# }
|
12548
12551
|
#
|
12549
12552
|
# @example Example: To upload an object and specify canned ACL.
|
@@ -12564,59 +12567,62 @@ module Aws::S3
|
|
12564
12567
|
# version_id: "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr",
|
12565
12568
|
# }
|
12566
12569
|
#
|
12567
|
-
# @example Example: To upload an object
|
12570
|
+
# @example Example: To upload an object (specify optional headers)
|
12568
12571
|
#
|
12569
|
-
# # The following example uploads an object
|
12570
|
-
# #
|
12572
|
+
# # The following example uploads an object. The request specifies optional request headers to directs S3 to use specific
|
12573
|
+
# # storage class and use server-side encryption.
|
12571
12574
|
#
|
12572
12575
|
# resp = client.put_object({
|
12573
12576
|
# body: "HappyFace.jpg",
|
12574
12577
|
# bucket: "examplebucket",
|
12575
12578
|
# key: "HappyFace.jpg",
|
12579
|
+
# server_side_encryption: "AES256",
|
12580
|
+
# storage_class: "STANDARD_IA",
|
12576
12581
|
# })
|
12577
12582
|
#
|
12578
12583
|
# resp.to_h outputs the following:
|
12579
12584
|
# {
|
12580
12585
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12581
|
-
#
|
12586
|
+
# server_side_encryption: "AES256",
|
12587
|
+
# version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp",
|
12582
12588
|
# }
|
12583
12589
|
#
|
12584
|
-
# @example Example: To upload an object and specify
|
12590
|
+
# @example Example: To upload an object and specify optional tags
|
12585
12591
|
#
|
12586
|
-
# # The following example uploads an object. The request specifies
|
12587
|
-
# #
|
12592
|
+
# # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
|
12593
|
+
# # S3 returns version ID of the newly created object.
|
12588
12594
|
#
|
12589
12595
|
# resp = client.put_object({
|
12590
|
-
# body: "
|
12596
|
+
# body: "c:\\HappyFace.jpg",
|
12591
12597
|
# bucket: "examplebucket",
|
12592
|
-
# key: "
|
12593
|
-
# server_side_encryption: "AES256",
|
12598
|
+
# key: "HappyFace.jpg",
|
12594
12599
|
# tagging: "key1=value1&key2=value2",
|
12595
12600
|
# })
|
12596
12601
|
#
|
12597
12602
|
# resp.to_h outputs the following:
|
12598
12603
|
# {
|
12599
12604
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12600
|
-
#
|
12601
|
-
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
12605
|
+
# version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
|
12602
12606
|
# }
|
12603
12607
|
#
|
12604
|
-
# @example Example: To upload an object and specify
|
12608
|
+
# @example Example: To upload an object and specify server-side encryption and object tags
|
12605
12609
|
#
|
12606
|
-
# # The following example uploads an object. The request specifies optional
|
12607
|
-
# # S3 returns version ID
|
12610
|
+
# # The following example uploads an object. The request specifies the optional server-side encryption option. The request
|
12611
|
+
# # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
|
12608
12612
|
#
|
12609
12613
|
# resp = client.put_object({
|
12610
|
-
# body: "
|
12614
|
+
# body: "filetoupload",
|
12611
12615
|
# bucket: "examplebucket",
|
12612
|
-
# key: "
|
12616
|
+
# key: "exampleobject",
|
12617
|
+
# server_side_encryption: "AES256",
|
12613
12618
|
# tagging: "key1=value1&key2=value2",
|
12614
12619
|
# })
|
12615
12620
|
#
|
12616
12621
|
# resp.to_h outputs the following:
|
12617
12622
|
# {
|
12618
12623
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12619
|
-
#
|
12624
|
+
# server_side_encryption: "AES256",
|
12625
|
+
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
12620
12626
|
# }
|
12621
12627
|
#
|
12622
12628
|
# @example Streaming a file from disk
|
@@ -15161,45 +15167,45 @@ module Aws::S3
|
|
15161
15167
|
# * {Types::UploadPartCopyOutput#request_charged #request_charged} => String
|
15162
15168
|
#
|
15163
15169
|
#
|
15164
|
-
# @example Example: To upload a part by copying
|
15170
|
+
# @example Example: To upload a part by copying byte range from an existing object as data source
|
15165
15171
|
#
|
15166
|
-
# # The following example uploads a part of a multipart upload by copying
|
15172
|
+
# # The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as
|
15173
|
+
# # data source.
|
15167
15174
|
#
|
15168
15175
|
# resp = client.upload_part_copy({
|
15169
15176
|
# bucket: "examplebucket",
|
15170
15177
|
# copy_source: "/bucketname/sourceobjectkey",
|
15178
|
+
# copy_source_range: "bytes=1-100000",
|
15171
15179
|
# key: "examplelargeobject",
|
15172
|
-
# part_number:
|
15180
|
+
# part_number: 2,
|
15173
15181
|
# upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--",
|
15174
15182
|
# })
|
15175
15183
|
#
|
15176
15184
|
# resp.to_h outputs the following:
|
15177
15185
|
# {
|
15178
15186
|
# copy_part_result: {
|
15179
|
-
# etag: "\"
|
15180
|
-
# last_modified: Time.parse("2016-12-29T21:
|
15187
|
+
# etag: "\"65d16d19e65a7508a51f043180edcc36\"",
|
15188
|
+
# last_modified: Time.parse("2016-12-29T21:44:28.000Z"),
|
15181
15189
|
# },
|
15182
15190
|
# }
|
15183
15191
|
#
|
15184
|
-
# @example Example: To upload a part by copying
|
15192
|
+
# @example Example: To upload a part by copying data from an existing object as data source
|
15185
15193
|
#
|
15186
|
-
# # The following example uploads a part of a multipart upload by copying
|
15187
|
-
# # data source.
|
15194
|
+
# # The following example uploads a part of a multipart upload by copying data from an existing object as data source.
|
15188
15195
|
#
|
15189
15196
|
# resp = client.upload_part_copy({
|
15190
15197
|
# bucket: "examplebucket",
|
15191
15198
|
# copy_source: "/bucketname/sourceobjectkey",
|
15192
|
-
# copy_source_range: "bytes=1-100000",
|
15193
15199
|
# key: "examplelargeobject",
|
15194
|
-
# part_number:
|
15200
|
+
# part_number: 1,
|
15195
15201
|
# upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--",
|
15196
15202
|
# })
|
15197
15203
|
#
|
15198
15204
|
# resp.to_h outputs the following:
|
15199
15205
|
# {
|
15200
15206
|
# copy_part_result: {
|
15201
|
-
# etag: "\"
|
15202
|
-
# last_modified: Time.parse("2016-12-29T21:
|
15207
|
+
# etag: "\"b0c6f0e7e054ab8fa2536a2677f8734d\"",
|
15208
|
+
# last_modified: Time.parse("2016-12-29T21:24:43.000Z"),
|
15203
15209
|
# },
|
15204
15210
|
# }
|
15205
15211
|
#
|
@@ -15647,7 +15653,7 @@ module Aws::S3
|
|
15647
15653
|
params: params,
|
15648
15654
|
config: config)
|
15649
15655
|
context[:gem_name] = 'aws-sdk-s3'
|
15650
|
-
context[:gem_version] = '1.
|
15656
|
+
context[:gem_version] = '1.130.0'
|
15651
15657
|
Seahorse::Client::Request.new(handlers, context)
|
15652
15658
|
end
|
15653
15659
|
|
@@ -8,7 +8,7 @@ module Aws
|
|
8
8
|
class PermanentRedirect < ServiceError
|
9
9
|
# @param [Seahorse::Client::RequestContext] context
|
10
10
|
# @param [String] message
|
11
|
-
# @param [Aws::S3::Types::PermanentRedirect]
|
11
|
+
# @param [Aws::S3::Types::PermanentRedirect] _data
|
12
12
|
def initialize(context, message, _data = Aws::EmptyStructure.new)
|
13
13
|
data = Aws::S3::Types::PermanentRedirect.new(message: message)
|
14
14
|
body = context.http_response.body_contents
|
@@ -46,6 +46,14 @@ module Aws
|
|
46
46
|
# different region. You do not need to specify this option
|
47
47
|
# if you have provided a `:source_client` or a `:content_length`.
|
48
48
|
#
|
49
|
+
# @option options [Boolean] :use_source_parts (false) Only used when
|
50
|
+
# `:multipart_copy` is `true`. Use part sizes defined on the source
|
51
|
+
# object if any exist. If copying or moving an object that
|
52
|
+
# is already multipart, this does not re-part the object, instead
|
53
|
+
# re-using the part definitions on the original. That means the etag
|
54
|
+
# and any checksums will not change. This is especially useful if the
|
55
|
+
# source object has parts with varied sizes.
|
56
|
+
#
|
49
57
|
# @example Basic object copy
|
50
58
|
#
|
51
59
|
# bucket = Aws::S3::Bucket.new('target-bucket')
|
@@ -15,18 +15,21 @@ module Aws
|
|
15
15
|
MAX_PARTS = 10_000
|
16
16
|
|
17
17
|
# @option options [Client] :client
|
18
|
-
# @option [Integer] :min_part_size (52428800)
|
19
|
-
# Defaults to 50MB.
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
18
|
+
# @option options [Integer] :min_part_size (52428800)
|
19
|
+
# Size of copied parts. Defaults to 50MB.
|
20
|
+
# @option options [Integer] :thread_count (10) Number of concurrent
|
21
|
+
# threads to use for copying parts.
|
22
|
+
# @option options [Boolean] :use_source_parts (false) Use part sizes
|
23
|
+
# defined on the source object if any exist. If copying or moving an
|
24
|
+
# object that is already multipart, this does not re-part the object,
|
25
|
+
# instead re-using the part definitions on the original. That means
|
26
|
+
# the etag and any checksums will not change. This is especially
|
27
|
+
# useful if the source object has parts with varied sizes.
|
23
28
|
def initialize(options = {})
|
29
|
+
@use_source_parts = options.delete(:use_source_parts) || false
|
24
30
|
@thread_count = options.delete(:thread_count) || 10
|
25
31
|
@min_part_size = options.delete(:min_part_size) || (FIVE_MB * 10)
|
26
32
|
@client = options[:client] || Client.new
|
27
|
-
if options[:checksum_algorithm]
|
28
|
-
raise ArgumentError, 'Multipart Copy does not support setting :checksum_algorithm'
|
29
|
-
end
|
30
33
|
end
|
31
34
|
|
32
35
|
# @return [Client]
|
@@ -78,10 +81,9 @@ module Aws
|
|
78
81
|
end
|
79
82
|
|
80
83
|
def copy_part(part)
|
81
|
-
{
|
82
|
-
|
83
|
-
|
84
|
-
}
|
84
|
+
@client.upload_part_copy(part).copy_part_result.to_h.merge({
|
85
|
+
part_number: part[:part_number]
|
86
|
+
}).tap { |result| result.delete(:last_modified) }
|
85
87
|
end
|
86
88
|
|
87
89
|
def complete_upload(parts, options)
|
@@ -104,24 +106,37 @@ module Aws
|
|
104
106
|
parts = []
|
105
107
|
options = options_for(:upload_part_copy, options)
|
106
108
|
while offset < size
|
109
|
+
part_size = calculate_part_size(part_number, default_part_size, options)
|
107
110
|
parts << options.merge({
|
108
111
|
part_number: part_number,
|
109
|
-
copy_source_range: byte_range(offset,
|
112
|
+
copy_source_range: byte_range(offset, part_size, size),
|
110
113
|
})
|
111
114
|
part_number += 1
|
112
|
-
offset +=
|
115
|
+
offset += part_size
|
113
116
|
end
|
114
117
|
parts
|
115
118
|
end
|
116
119
|
|
117
|
-
def byte_range(offset,
|
118
|
-
if offset +
|
119
|
-
"bytes=#{offset}-#{offset +
|
120
|
+
def byte_range(offset, part_size, size)
|
121
|
+
if offset + part_size < size
|
122
|
+
"bytes=#{offset}-#{offset + part_size - 1}"
|
120
123
|
else
|
121
124
|
"bytes=#{offset}-#{size - 1}"
|
122
125
|
end
|
123
126
|
end
|
124
127
|
|
128
|
+
def calculate_part_size(part_number, default_part_size, options)
|
129
|
+
if @use_source_parts && source_has_parts(options)
|
130
|
+
source_metadata(options.merge({ part_number: part_number }))[:content_length]
|
131
|
+
else
|
132
|
+
default_part_size
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def source_has_parts(options)
|
137
|
+
@source_has_parts ||= source_metadata(options.merge({ part_number: 1 }))[:parts_count]
|
138
|
+
end
|
139
|
+
|
125
140
|
def source_metadata(options)
|
126
141
|
if options[:content_length]
|
127
142
|
return { content_length: options.delete(:content_length) }
|
@@ -138,6 +153,7 @@ module Aws
|
|
138
153
|
key = CGI.unescape(key)
|
139
154
|
opts = { bucket: bucket, key: key }
|
140
155
|
opts[:version_id] = version_id if version_id
|
156
|
+
opts[:part_number] = options[:part_number] if options[:part_number]
|
141
157
|
client.head_object(opts).to_h
|
142
158
|
end
|
143
159
|
|
@@ -315,26 +315,28 @@ module Aws
|
|
315
315
|
|
316
316
|
# @!group Fields
|
317
317
|
|
318
|
-
#
|
319
|
-
#
|
320
|
-
#
|
318
|
+
# @!method key(key)
|
319
|
+
# The key to use for the uploaded object. You can use `${filename}`
|
320
|
+
# as a variable in the key. This will be replaced with the name
|
321
|
+
# of the file as provided by the user.
|
321
322
|
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
#
|
323
|
+
# For example, if the key is given as `/user/betty/${filename}` and
|
324
|
+
# the file uploaded is named `lolcatz.jpg`, the resultant key will
|
325
|
+
# be `/user/betty/lolcatz.jpg`.
|
325
326
|
#
|
326
|
-
#
|
327
|
-
#
|
328
|
-
#
|
327
|
+
# @param [String] key
|
328
|
+
# @see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html)
|
329
|
+
# @return [self]
|
329
330
|
define_field(:key) do |key|
|
330
331
|
@key_set = true
|
331
332
|
with('key', key)
|
332
333
|
end
|
333
334
|
|
334
|
-
#
|
335
|
-
#
|
336
|
-
#
|
337
|
-
#
|
335
|
+
# @!method key_starts_with(prefix)
|
336
|
+
# Specify a prefix the uploaded
|
337
|
+
# @param [String] prefix
|
338
|
+
# @see #key
|
339
|
+
# @return [self]
|
338
340
|
define_field(:key_starts_with) do |prefix|
|
339
341
|
@key_set = true
|
340
342
|
starts_with('key', prefix)
|
@@ -412,26 +414,29 @@ module Aws
|
|
412
414
|
# @return [self]
|
413
415
|
define_field(:content_encoding, 'Content-Encoding', starts_with: true)
|
414
416
|
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
#
|
417
|
+
# @!method expires(time)
|
418
|
+
# The date and time at which the object is no longer cacheable.
|
419
|
+
# @note This does not affect the expiration of the presigned post
|
420
|
+
# signature.
|
421
|
+
# @param [Time] time
|
422
|
+
# @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
|
423
|
+
# @return [self]
|
421
424
|
define_field(:expires) do |time|
|
422
425
|
with('Expires', time.httpdate)
|
423
426
|
end
|
424
427
|
|
425
|
-
#
|
426
|
-
#
|
427
|
-
#
|
428
|
+
# @!method expires_starts_with(prefix)
|
429
|
+
# @param [String] prefix
|
430
|
+
# @see #expires
|
431
|
+
# @return [self]
|
428
432
|
define_field(:expires_starts_with) do |prefix|
|
429
433
|
starts_with('Expires', prefix)
|
430
434
|
end
|
431
435
|
|
432
|
-
#
|
433
|
-
#
|
434
|
-
#
|
436
|
+
# @!method content_length_range(byte_range)
|
437
|
+
# The minimum and maximum allowable size for the uploaded content.
|
438
|
+
# @param [Range<Integer>] byte_range
|
439
|
+
# @return [self]
|
435
440
|
define_field(:content_length_range) do |byte_range|
|
436
441
|
min = byte_range.begin
|
437
442
|
max = byte_range.end
|
@@ -507,10 +512,11 @@ module Aws
|
|
507
512
|
# @return [self]
|
508
513
|
define_field(:website_redirect_location, 'x-amz-website-redirect-location')
|
509
514
|
|
510
|
-
#
|
511
|
-
#
|
512
|
-
#
|
513
|
-
#
|
515
|
+
# @!method metadata(hash)
|
516
|
+
# Metadata hash to store with the uploaded object. Hash keys will be
|
517
|
+
# prefixed with "x-amz-meta-".
|
518
|
+
# @param [Hash<String,String>] hash
|
519
|
+
# @return [self]
|
514
520
|
define_field(:metadata) do |hash|
|
515
521
|
hash.each do |key, value|
|
516
522
|
with("x-amz-meta-#{key}", value)
|
@@ -518,10 +524,11 @@ module Aws
|
|
518
524
|
self
|
519
525
|
end
|
520
526
|
|
521
|
-
#
|
522
|
-
#
|
523
|
-
#
|
524
|
-
#
|
527
|
+
# @!method metadata_starts_with(hash)
|
528
|
+
# Specify allowable prefix for each key in the metadata hash.
|
529
|
+
# @param [Hash<String,String>] hash
|
530
|
+
# @see #metadata
|
531
|
+
# @return [self]
|
525
532
|
define_field(:metadata_starts_with) do |hash|
|
526
533
|
hash.each do |key, value|
|
527
534
|
starts_with("x-amz-meta-#{key}", value)
|
@@ -571,24 +578,26 @@ module Aws
|
|
571
578
|
'x-amz-server-side-encryption-customer-algorithm'
|
572
579
|
)
|
573
580
|
|
574
|
-
#
|
575
|
-
#
|
576
|
-
#
|
581
|
+
# @!method server_side_encryption_customer_key(value)
|
582
|
+
# Specifies the customer-provided encryption key for Amazon S3 to use
|
583
|
+
# in encrypting data. This value is used to store the object and then
|
584
|
+
# it is discarded; Amazon does not store the encryption key.
|
577
585
|
#
|
578
|
-
#
|
586
|
+
# You must also call {#server_side_encryption_customer_algorithm}.
|
579
587
|
#
|
580
|
-
#
|
581
|
-
#
|
582
|
-
#
|
588
|
+
# @param [String] value
|
589
|
+
# @see #server_side_encryption_customer_algorithm
|
590
|
+
# @return [self]
|
583
591
|
define_field(:server_side_encryption_customer_key) do |value|
|
584
592
|
field_name = 'x-amz-server-side-encryption-customer-key'
|
585
593
|
with(field_name, base64(value))
|
586
594
|
with(field_name + '-MD5', base64(OpenSSL::Digest::MD5.digest(value)))
|
587
595
|
end
|
588
596
|
|
589
|
-
#
|
590
|
-
#
|
591
|
-
#
|
597
|
+
# @!method server_side_encryption_customer_key_starts_with(prefix)
|
598
|
+
# @param [String] prefix
|
599
|
+
# @see #server_side_encryption_customer_key
|
600
|
+
# @return [self]
|
592
601
|
define_field(:server_side_encryption_customer_key_starts_with) do |prefix|
|
593
602
|
field_name = 'x-amz-server-side-encryption-customer-key'
|
594
603
|
starts_with(field_name, prefix)
|
data/lib/aws-sdk-s3/resource.rb
CHANGED
@@ -41,7 +41,7 @@ module Aws::S3
|
|
41
41
|
# acl: "private", # accepts private, public-read, public-read-write, authenticated-read
|
42
42
|
# bucket: "BucketName", # required
|
43
43
|
# create_bucket_configuration: {
|
44
|
-
# 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
|
44
|
+
# 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, ap-south-2, eu-south-2
|
45
45
|
# },
|
46
46
|
# grant_full_control: "GrantFullControl",
|
47
47
|
# grant_read: "GrantRead",
|
data/lib/aws-sdk-s3.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.130.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|