aws-sdk-s3 1.48.0 → 1.53.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/lib/aws-sdk-s3/bucket.rb +14 -9
- data/lib/aws-sdk-s3/client.rb +155 -144
- data/lib/aws-sdk-s3/client_api.rb +8 -0
- data/lib/aws-sdk-s3/customizations/object.rb +65 -43
- data/lib/aws-sdk-s3/encryption/client.rb +4 -0
- data/lib/aws-sdk-s3/file_part.rb +9 -6
- data/lib/aws-sdk-s3/file_uploader.rb +13 -12
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +14 -11
- data/lib/aws-sdk-s3/plugins/md5s.rb +3 -4
- data/lib/aws-sdk-s3/types.rb +43 -3
- data/lib/aws-sdk-s3.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 472d63ee0f1295b056583a9cfd20ec585919238a
|
4
|
+
data.tar.gz: aed88e9a3d50ecedbedd0a59bee1dba169fc6ed5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa70fa374b7c9f497eda4d46ce5bd159f5c94b77e6979b961b2298f6614690b4ac9e32be1012099b2dfaa8ac7de065bcfc50692b236564fc7ffc3010859fb87a
|
7
|
+
data.tar.gz: b0ec5e0afc5b3d2f222b06f4906ad3d8ad3c7b5c5d740090c1b1375a102083e574d77209b933ef47b531636afe4a08793336f44db9e61655bdb0307fa62d2d38
|
data/lib/aws-sdk-s3/bucket.rb
CHANGED
@@ -596,29 +596,34 @@ module Aws::S3
|
|
596
596
|
# delimiter: "Delimiter",
|
597
597
|
# encoding_type: "url", # accepts url
|
598
598
|
# prefix: "Prefix",
|
599
|
+
# fetch_owner: false,
|
600
|
+
# start_after: "StartAfter",
|
599
601
|
# request_payer: "requester", # accepts requester
|
600
602
|
# })
|
601
603
|
# @param [Hash] options ({})
|
602
604
|
# @option options [String] :delimiter
|
603
605
|
# A delimiter is a character you use to group keys.
|
604
606
|
# @option options [String] :encoding_type
|
605
|
-
#
|
606
|
-
# specifies the encoding method to use. An object key may contain any
|
607
|
-
# Unicode character; however, XML 1.0 parser cannot parse some
|
608
|
-
# characters, such as characters with an ASCII value from 0 to 10. For
|
609
|
-
# characters that are not supported in XML 1.0, you can add this
|
610
|
-
# parameter to request that Amazon S3 encode the keys in the response.
|
607
|
+
# Encoding type used by Amazon S3 to encode object keys in the response.
|
611
608
|
# @option options [String] :prefix
|
612
609
|
# Limits the response to keys that begin with the specified prefix.
|
610
|
+
# @option options [Boolean] :fetch_owner
|
611
|
+
# The owner field is not present in listV2 by default, if you want to
|
612
|
+
# return owner field with each key in the result then set the fetch
|
613
|
+
# owner field to true
|
614
|
+
# @option options [String] :start_after
|
615
|
+
# StartAfter is where you want Amazon S3 to start listing from. Amazon
|
616
|
+
# S3 starts listing after this specified key. StartAfter can be any key
|
617
|
+
# in the bucket
|
613
618
|
# @option options [String] :request_payer
|
614
619
|
# Confirms that the requester knows that she or he will be charged for
|
615
|
-
# the list objects request. Bucket owners need not specify
|
616
|
-
# parameter in their requests.
|
620
|
+
# the list objects request in V2 style. Bucket owners need not specify
|
621
|
+
# this parameter in their requests.
|
617
622
|
# @return [ObjectSummary::Collection]
|
618
623
|
def objects(options = {})
|
619
624
|
batches = Enumerator.new do |y|
|
620
625
|
options = options.merge(bucket: @name)
|
621
|
-
resp = @client.
|
626
|
+
resp = @client.list_objects_v2(options)
|
622
627
|
resp.each_page do |page|
|
623
628
|
batch = []
|
624
629
|
page.data.contents.each do |c|
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -761,33 +761,33 @@ module Aws::S3
|
|
761
761
|
# * {Types::CreateBucketOutput#location #location} => String
|
762
762
|
#
|
763
763
|
#
|
764
|
-
# @example Example: To create a bucket
|
764
|
+
# @example Example: To create a bucket
|
765
765
|
#
|
766
|
-
# # The following example creates a bucket.
|
766
|
+
# # The following example creates a bucket.
|
767
767
|
#
|
768
768
|
# resp = client.create_bucket({
|
769
769
|
# bucket: "examplebucket",
|
770
|
-
# create_bucket_configuration: {
|
771
|
-
# location_constraint: "eu-west-1",
|
772
|
-
# },
|
773
770
|
# })
|
774
771
|
#
|
775
772
|
# resp.to_h outputs the following:
|
776
773
|
# {
|
777
|
-
# location: "
|
774
|
+
# location: "/examplebucket",
|
778
775
|
# }
|
779
776
|
#
|
780
|
-
# @example Example: To create a bucket
|
777
|
+
# @example Example: To create a bucket in a specific region
|
781
778
|
#
|
782
|
-
# # The following example creates a bucket.
|
779
|
+
# # The following example creates a bucket. The request specifies an AWS region where to create the bucket.
|
783
780
|
#
|
784
781
|
# resp = client.create_bucket({
|
785
782
|
# bucket: "examplebucket",
|
783
|
+
# create_bucket_configuration: {
|
784
|
+
# location_constraint: "eu-west-1",
|
785
|
+
# },
|
786
786
|
# })
|
787
787
|
#
|
788
788
|
# resp.to_h outputs the following:
|
789
789
|
# {
|
790
|
-
# location: "/
|
790
|
+
# location: "http://examplebucket.s3.amazonaws.com/",
|
791
791
|
# }
|
792
792
|
#
|
793
793
|
# @example Request syntax with placeholder values
|
@@ -1532,22 +1532,20 @@ module Aws::S3
|
|
1532
1532
|
# * {Types::DeleteObjectsOutput#errors #errors} => Array<Types::Error>
|
1533
1533
|
#
|
1534
1534
|
#
|
1535
|
-
# @example Example: To delete multiple
|
1535
|
+
# @example Example: To delete multiple objects from a versioned bucket
|
1536
1536
|
#
|
1537
|
-
# # The following example deletes objects from a bucket. The
|
1538
|
-
# #
|
1537
|
+
# # The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the
|
1538
|
+
# # object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker.
|
1539
1539
|
#
|
1540
1540
|
# resp = client.delete_objects({
|
1541
1541
|
# bucket: "examplebucket",
|
1542
1542
|
# delete: {
|
1543
1543
|
# objects: [
|
1544
1544
|
# {
|
1545
|
-
# key: "
|
1546
|
-
# version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b",
|
1545
|
+
# key: "objectkey1",
|
1547
1546
|
# },
|
1548
1547
|
# {
|
1549
|
-
# key: "
|
1550
|
-
# version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd",
|
1548
|
+
# key: "objectkey2",
|
1551
1549
|
# },
|
1552
1550
|
# ],
|
1553
1551
|
# quiet: false,
|
@@ -1558,30 +1556,34 @@ module Aws::S3
|
|
1558
1556
|
# {
|
1559
1557
|
# deleted: [
|
1560
1558
|
# {
|
1561
|
-
#
|
1562
|
-
#
|
1559
|
+
# delete_marker: true,
|
1560
|
+
# delete_marker_version_id: "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F",
|
1561
|
+
# key: "objectkey1",
|
1563
1562
|
# },
|
1564
1563
|
# {
|
1565
|
-
#
|
1566
|
-
#
|
1564
|
+
# delete_marker: true,
|
1565
|
+
# delete_marker_version_id: "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt",
|
1566
|
+
# key: "objectkey2",
|
1567
1567
|
# },
|
1568
1568
|
# ],
|
1569
1569
|
# }
|
1570
1570
|
#
|
1571
|
-
# @example Example: To delete multiple
|
1571
|
+
# @example Example: To delete multiple object versions from a versioned bucket
|
1572
1572
|
#
|
1573
|
-
# # The following example deletes objects from a bucket. The
|
1574
|
-
# #
|
1573
|
+
# # The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object
|
1574
|
+
# # versions and returns the key and versions of deleted objects in the response.
|
1575
1575
|
#
|
1576
1576
|
# resp = client.delete_objects({
|
1577
1577
|
# bucket: "examplebucket",
|
1578
1578
|
# delete: {
|
1579
1579
|
# objects: [
|
1580
1580
|
# {
|
1581
|
-
# key: "
|
1581
|
+
# key: "HappyFace.jpg",
|
1582
|
+
# version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b",
|
1582
1583
|
# },
|
1583
1584
|
# {
|
1584
|
-
# key: "
|
1585
|
+
# key: "HappyFace.jpg",
|
1586
|
+
# version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd",
|
1585
1587
|
# },
|
1586
1588
|
# ],
|
1587
1589
|
# quiet: false,
|
@@ -1592,14 +1594,12 @@ module Aws::S3
|
|
1592
1594
|
# {
|
1593
1595
|
# deleted: [
|
1594
1596
|
# {
|
1595
|
-
#
|
1596
|
-
#
|
1597
|
-
# key: "objectkey1",
|
1597
|
+
# key: "HappyFace.jpg",
|
1598
|
+
# version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd",
|
1598
1599
|
# },
|
1599
1600
|
# {
|
1600
|
-
#
|
1601
|
-
#
|
1602
|
-
# key: "objectkey2",
|
1601
|
+
# key: "HappyFace.jpg",
|
1602
|
+
# version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b",
|
1603
1603
|
# },
|
1604
1604
|
# ],
|
1605
1605
|
# }
|
@@ -1907,7 +1907,7 @@ module Aws::S3
|
|
1907
1907
|
# resp.inventory_configuration.id #=> String
|
1908
1908
|
# resp.inventory_configuration.included_object_versions #=> String, one of "All", "Current"
|
1909
1909
|
# resp.inventory_configuration.optional_fields #=> Array
|
1910
|
-
# resp.inventory_configuration.optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus"
|
1910
|
+
# resp.inventory_configuration.optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier"
|
1911
1911
|
# resp.inventory_configuration.schedule.frequency #=> String, one of "Daily", "Weekly"
|
1912
1912
|
#
|
1913
1913
|
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration AWS API Documentation
|
@@ -2793,49 +2793,49 @@ module Aws::S3
|
|
2793
2793
|
# * {Types::GetObjectOutput#object_lock_legal_hold_status #object_lock_legal_hold_status} => String
|
2794
2794
|
#
|
2795
2795
|
#
|
2796
|
-
# @example Example: To retrieve an object
|
2796
|
+
# @example Example: To retrieve a byte range of an object
|
2797
2797
|
#
|
2798
|
-
# # The following example retrieves an object for an S3 bucket.
|
2798
|
+
# # The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a
|
2799
|
+
# # specific byte range.
|
2799
2800
|
#
|
2800
2801
|
# resp = client.get_object({
|
2801
2802
|
# bucket: "examplebucket",
|
2802
|
-
# key: "
|
2803
|
+
# key: "SampleFile.txt",
|
2804
|
+
# range: "bytes=0-9",
|
2803
2805
|
# })
|
2804
2806
|
#
|
2805
2807
|
# resp.to_h outputs the following:
|
2806
2808
|
# {
|
2807
2809
|
# accept_ranges: "bytes",
|
2808
|
-
# content_length:
|
2809
|
-
#
|
2810
|
-
#
|
2811
|
-
#
|
2810
|
+
# content_length: 10,
|
2811
|
+
# content_range: "bytes 0-9/43",
|
2812
|
+
# content_type: "text/plain",
|
2813
|
+
# etag: "\"0d94420ffd0bc68cd3d152506b97a9cc\"",
|
2814
|
+
# last_modified: Time.parse("Thu, 09 Oct 2014 22:57:28 GMT"),
|
2812
2815
|
# metadata: {
|
2813
2816
|
# },
|
2814
|
-
# tag_count: 2,
|
2815
2817
|
# version_id: "null",
|
2816
2818
|
# }
|
2817
2819
|
#
|
2818
|
-
# @example Example: To retrieve
|
2820
|
+
# @example Example: To retrieve an object
|
2819
2821
|
#
|
2820
|
-
# # The following example retrieves an object for an S3 bucket.
|
2821
|
-
# # specific byte range.
|
2822
|
+
# # The following example retrieves an object for an S3 bucket.
|
2822
2823
|
#
|
2823
2824
|
# resp = client.get_object({
|
2824
2825
|
# bucket: "examplebucket",
|
2825
|
-
# key: "
|
2826
|
-
# range: "bytes=0-9",
|
2826
|
+
# key: "HappyFace.jpg",
|
2827
2827
|
# })
|
2828
2828
|
#
|
2829
2829
|
# resp.to_h outputs the following:
|
2830
2830
|
# {
|
2831
2831
|
# accept_ranges: "bytes",
|
2832
|
-
# content_length:
|
2833
|
-
#
|
2834
|
-
#
|
2835
|
-
#
|
2836
|
-
# last_modified: Time.parse("Thu, 09 Oct 2014 22:57:28 GMT"),
|
2832
|
+
# content_length: 3191,
|
2833
|
+
# content_type: "image/jpeg",
|
2834
|
+
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
2835
|
+
# last_modified: Time.parse("Thu, 15 Dec 2016 01:19:41 GMT"),
|
2837
2836
|
# metadata: {
|
2838
2837
|
# },
|
2838
|
+
# tag_count: 2,
|
2839
2839
|
# version_id: "null",
|
2840
2840
|
# }
|
2841
2841
|
#
|
@@ -3182,49 +3182,49 @@ module Aws::S3
|
|
3182
3182
|
# * {Types::GetObjectTaggingOutput#tag_set #tag_set} => Array<Types::Tag>
|
3183
3183
|
#
|
3184
3184
|
#
|
3185
|
-
# @example Example: To retrieve tag set of
|
3185
|
+
# @example Example: To retrieve tag set of an object
|
3186
3186
|
#
|
3187
|
-
# # The following example retrieves tag set of an object.
|
3187
|
+
# # The following example retrieves tag set of an object.
|
3188
3188
|
#
|
3189
3189
|
# resp = client.get_object_tagging({
|
3190
3190
|
# bucket: "examplebucket",
|
3191
|
-
# key: "
|
3192
|
-
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
3191
|
+
# key: "HappyFace.jpg",
|
3193
3192
|
# })
|
3194
3193
|
#
|
3195
3194
|
# resp.to_h outputs the following:
|
3196
3195
|
# {
|
3197
3196
|
# tag_set: [
|
3198
3197
|
# {
|
3199
|
-
# key: "
|
3200
|
-
# value: "
|
3198
|
+
# key: "Key4",
|
3199
|
+
# value: "Value4",
|
3200
|
+
# },
|
3201
|
+
# {
|
3202
|
+
# key: "Key3",
|
3203
|
+
# value: "Value3",
|
3201
3204
|
# },
|
3202
3205
|
# ],
|
3203
|
-
# version_id: "
|
3206
|
+
# version_id: "null",
|
3204
3207
|
# }
|
3205
3208
|
#
|
3206
|
-
# @example Example: To retrieve tag set of
|
3209
|
+
# @example Example: To retrieve tag set of a specific object version
|
3207
3210
|
#
|
3208
|
-
# # The following example retrieves tag set of an object.
|
3211
|
+
# # The following example retrieves tag set of an object. The request specifies object version.
|
3209
3212
|
#
|
3210
3213
|
# resp = client.get_object_tagging({
|
3211
3214
|
# bucket: "examplebucket",
|
3212
|
-
# key: "
|
3215
|
+
# key: "exampleobject",
|
3216
|
+
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
3213
3217
|
# })
|
3214
3218
|
#
|
3215
3219
|
# resp.to_h outputs the following:
|
3216
3220
|
# {
|
3217
3221
|
# tag_set: [
|
3218
3222
|
# {
|
3219
|
-
# key: "
|
3220
|
-
# value: "
|
3221
|
-
# },
|
3222
|
-
# {
|
3223
|
-
# key: "Key3",
|
3224
|
-
# value: "Value3",
|
3223
|
+
# key: "Key1",
|
3224
|
+
# value: "Value1",
|
3225
3225
|
# },
|
3226
3226
|
# ],
|
3227
|
-
# version_id: "
|
3227
|
+
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
3228
3228
|
# }
|
3229
3229
|
#
|
3230
3230
|
# @example Request syntax with placeholder values
|
@@ -3641,7 +3641,7 @@ module Aws::S3
|
|
3641
3641
|
# resp.inventory_configuration_list[0].id #=> String
|
3642
3642
|
# resp.inventory_configuration_list[0].included_object_versions #=> String, one of "All", "Current"
|
3643
3643
|
# resp.inventory_configuration_list[0].optional_fields #=> Array
|
3644
|
-
# resp.inventory_configuration_list[0].optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus"
|
3644
|
+
# resp.inventory_configuration_list[0].optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier"
|
3645
3645
|
# resp.inventory_configuration_list[0].schedule.frequency #=> String, one of "Daily", "Weekly"
|
3646
3646
|
# resp.is_truncated #=> Boolean
|
3647
3647
|
# resp.next_continuation_token #=> String
|
@@ -3811,97 +3811,97 @@ module Aws::S3
|
|
3811
3811
|
# * {Types::ListMultipartUploadsOutput#encoding_type #encoding_type} => String
|
3812
3812
|
#
|
3813
3813
|
#
|
3814
|
-
# @example Example:
|
3814
|
+
# @example Example: To list in-progress multipart uploads on a bucket
|
3815
3815
|
#
|
3816
|
-
# # The following example
|
3817
|
-
# # setup of multipart uploads.
|
3816
|
+
# # The following example lists in-progress multipart uploads on a specific bucket.
|
3818
3817
|
#
|
3819
3818
|
# resp = client.list_multipart_uploads({
|
3820
3819
|
# bucket: "examplebucket",
|
3821
|
-
# key_marker: "nextkeyfrompreviousresponse",
|
3822
|
-
# max_uploads: 2,
|
3823
|
-
# upload_id_marker: "valuefrompreviousresponse",
|
3824
3820
|
# })
|
3825
3821
|
#
|
3826
3822
|
# resp.to_h outputs the following:
|
3827
3823
|
# {
|
3828
|
-
# bucket: "acl1",
|
3829
|
-
# is_truncated: true,
|
3830
|
-
# key_marker: "",
|
3831
|
-
# max_uploads: 2,
|
3832
|
-
# next_key_marker: "someobjectkey",
|
3833
|
-
# next_upload_id_marker: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
3834
|
-
# upload_id_marker: "",
|
3835
3824
|
# uploads: [
|
3836
3825
|
# {
|
3837
3826
|
# initiated: Time.parse("2014-05-01T05:40:58.000Z"),
|
3838
3827
|
# initiator: {
|
3839
|
-
# display_name: "
|
3828
|
+
# display_name: "display-name",
|
3840
3829
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3841
3830
|
# },
|
3842
3831
|
# key: "JavaFile",
|
3843
3832
|
# owner: {
|
3844
|
-
# display_name: "
|
3845
|
-
# id: "
|
3833
|
+
# display_name: "display-name",
|
3834
|
+
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3846
3835
|
# },
|
3847
3836
|
# storage_class: "STANDARD",
|
3848
|
-
# upload_id: "
|
3837
|
+
# upload_id: "examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--",
|
3849
3838
|
# },
|
3850
3839
|
# {
|
3851
3840
|
# initiated: Time.parse("2014-05-01T05:41:27.000Z"),
|
3852
3841
|
# initiator: {
|
3853
|
-
# display_name: "
|
3842
|
+
# display_name: "display-name",
|
3854
3843
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3855
3844
|
# },
|
3856
3845
|
# key: "JavaFile",
|
3857
3846
|
# owner: {
|
3858
|
-
# display_name: "
|
3847
|
+
# display_name: "display-name",
|
3859
3848
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3860
3849
|
# },
|
3861
3850
|
# storage_class: "STANDARD",
|
3862
|
-
# upload_id: "
|
3851
|
+
# upload_id: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
3863
3852
|
# },
|
3864
3853
|
# ],
|
3865
3854
|
# }
|
3866
3855
|
#
|
3867
|
-
# @example Example:
|
3856
|
+
# @example Example: List next set of multipart uploads when previous result is truncated
|
3868
3857
|
#
|
3869
|
-
# # The following example
|
3858
|
+
# # The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next
|
3859
|
+
# # setup of multipart uploads.
|
3870
3860
|
#
|
3871
3861
|
# resp = client.list_multipart_uploads({
|
3872
3862
|
# bucket: "examplebucket",
|
3863
|
+
# key_marker: "nextkeyfrompreviousresponse",
|
3864
|
+
# max_uploads: 2,
|
3865
|
+
# upload_id_marker: "valuefrompreviousresponse",
|
3873
3866
|
# })
|
3874
3867
|
#
|
3875
3868
|
# resp.to_h outputs the following:
|
3876
3869
|
# {
|
3870
|
+
# bucket: "acl1",
|
3871
|
+
# is_truncated: true,
|
3872
|
+
# key_marker: "",
|
3873
|
+
# max_uploads: 2,
|
3874
|
+
# next_key_marker: "someobjectkey",
|
3875
|
+
# next_upload_id_marker: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
3876
|
+
# upload_id_marker: "",
|
3877
3877
|
# uploads: [
|
3878
3878
|
# {
|
3879
3879
|
# initiated: Time.parse("2014-05-01T05:40:58.000Z"),
|
3880
3880
|
# initiator: {
|
3881
|
-
# display_name: "display-name",
|
3881
|
+
# display_name: "ownder-display-name",
|
3882
3882
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3883
3883
|
# },
|
3884
3884
|
# key: "JavaFile",
|
3885
3885
|
# owner: {
|
3886
|
-
# display_name: "
|
3887
|
-
# id: "
|
3886
|
+
# display_name: "mohanataws",
|
3887
|
+
# id: "852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3888
3888
|
# },
|
3889
3889
|
# storage_class: "STANDARD",
|
3890
|
-
# upload_id: "
|
3890
|
+
# upload_id: "gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--",
|
3891
3891
|
# },
|
3892
3892
|
# {
|
3893
3893
|
# initiated: Time.parse("2014-05-01T05:41:27.000Z"),
|
3894
3894
|
# initiator: {
|
3895
|
-
# display_name: "display-name",
|
3895
|
+
# display_name: "ownder-display-name",
|
3896
3896
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3897
3897
|
# },
|
3898
3898
|
# key: "JavaFile",
|
3899
3899
|
# owner: {
|
3900
|
-
# display_name: "display-name",
|
3900
|
+
# display_name: "ownder-display-name",
|
3901
3901
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
3902
3902
|
# },
|
3903
3903
|
# storage_class: "STANDARD",
|
3904
|
-
# upload_id: "
|
3904
|
+
# upload_id: "b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
3905
3905
|
# },
|
3906
3906
|
# ],
|
3907
3907
|
# }
|
@@ -4828,7 +4828,7 @@ module Aws::S3
|
|
4828
4828
|
# },
|
4829
4829
|
# id: "InventoryId", # required
|
4830
4830
|
# included_object_versions: "All", # required, accepts All, Current
|
4831
|
-
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus
|
4831
|
+
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier
|
4832
4832
|
# schedule: { # required
|
4833
4833
|
# frequency: "Daily", # required, accepts Daily, Weekly
|
4834
4834
|
# },
|
@@ -5785,96 +5785,96 @@ module Aws::S3
|
|
5785
5785
|
# version_id: "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr",
|
5786
5786
|
# }
|
5787
5787
|
#
|
5788
|
-
# @example Example: To upload an object
|
5788
|
+
# @example Example: To upload an object
|
5789
5789
|
#
|
5790
|
-
# # The following example uploads an object
|
5791
|
-
# # S3 returns
|
5790
|
+
# # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
|
5791
|
+
# # syntax. S3 returns VersionId of the newly created object.
|
5792
5792
|
#
|
5793
5793
|
# resp = client.put_object({
|
5794
|
-
# body: "
|
5794
|
+
# body: "HappyFace.jpg",
|
5795
5795
|
# bucket: "examplebucket",
|
5796
5796
|
# key: "HappyFace.jpg",
|
5797
|
-
# tagging: "key1=value1&key2=value2",
|
5798
5797
|
# })
|
5799
5798
|
#
|
5800
5799
|
# resp.to_h outputs the following:
|
5801
5800
|
# {
|
5802
5801
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5803
|
-
# version_id: "
|
5802
|
+
# version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
|
5804
5803
|
# }
|
5805
5804
|
#
|
5806
|
-
# @example Example: To
|
5805
|
+
# @example Example: To create an object.
|
5807
5806
|
#
|
5808
|
-
# # The following example creates an object.
|
5809
|
-
# # enabled, S3 returns version ID in response.
|
5807
|
+
# # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
|
5810
5808
|
#
|
5811
5809
|
# resp = client.put_object({
|
5812
5810
|
# body: "filetoupload",
|
5813
5811
|
# bucket: "examplebucket",
|
5814
|
-
# key: "
|
5815
|
-
# metadata: {
|
5816
|
-
# "metadata1" => "value1",
|
5817
|
-
# "metadata2" => "value2",
|
5818
|
-
# },
|
5812
|
+
# key: "objectkey",
|
5819
5813
|
# })
|
5820
5814
|
#
|
5821
5815
|
# resp.to_h outputs the following:
|
5822
5816
|
# {
|
5823
5817
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5824
|
-
# version_id: "
|
5818
|
+
# version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
|
5825
5819
|
# }
|
5826
5820
|
#
|
5827
|
-
# @example Example: To upload
|
5821
|
+
# @example Example: To upload object and specify user-defined metadata
|
5828
5822
|
#
|
5829
|
-
# # The following example
|
5830
|
-
# #
|
5823
|
+
# # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning
|
5824
|
+
# # enabled, S3 returns version ID in response.
|
5831
5825
|
#
|
5832
5826
|
# resp = client.put_object({
|
5833
5827
|
# body: "filetoupload",
|
5834
5828
|
# bucket: "examplebucket",
|
5835
5829
|
# key: "exampleobject",
|
5836
|
-
#
|
5837
|
-
#
|
5830
|
+
# metadata: {
|
5831
|
+
# "metadata1" => "value1",
|
5832
|
+
# "metadata2" => "value2",
|
5833
|
+
# },
|
5838
5834
|
# })
|
5839
5835
|
#
|
5840
5836
|
# resp.to_h outputs the following:
|
5841
5837
|
# {
|
5842
5838
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5843
|
-
#
|
5844
|
-
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
5839
|
+
# version_id: "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0",
|
5845
5840
|
# }
|
5846
5841
|
#
|
5847
|
-
# @example Example: To
|
5842
|
+
# @example Example: To upload an object and specify optional tags
|
5848
5843
|
#
|
5849
|
-
# # The following example
|
5844
|
+
# # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
|
5845
|
+
# # S3 returns version ID of the newly created object.
|
5850
5846
|
#
|
5851
5847
|
# resp = client.put_object({
|
5852
|
-
# body: "
|
5848
|
+
# body: "c:\\HappyFace.jpg",
|
5853
5849
|
# bucket: "examplebucket",
|
5854
|
-
# key: "
|
5850
|
+
# key: "HappyFace.jpg",
|
5851
|
+
# tagging: "key1=value1&key2=value2",
|
5855
5852
|
# })
|
5856
5853
|
#
|
5857
5854
|
# resp.to_h outputs the following:
|
5858
5855
|
# {
|
5859
5856
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5860
|
-
# version_id: "
|
5857
|
+
# version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
|
5861
5858
|
# }
|
5862
5859
|
#
|
5863
|
-
# @example Example: To upload an object
|
5860
|
+
# @example Example: To upload an object and specify server-side encryption and object tags
|
5864
5861
|
#
|
5865
|
-
# # The following example uploads
|
5866
|
-
# #
|
5862
|
+
# # The following example uploads and object. The request specifies the optional server-side encryption option. The request
|
5863
|
+
# # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
|
5867
5864
|
#
|
5868
5865
|
# resp = client.put_object({
|
5869
|
-
# body: "
|
5866
|
+
# body: "filetoupload",
|
5870
5867
|
# bucket: "examplebucket",
|
5871
|
-
# key: "
|
5868
|
+
# key: "exampleobject",
|
5869
|
+
# server_side_encryption: "AES256",
|
5870
|
+
# tagging: "key1=value1&key2=value2",
|
5872
5871
|
# })
|
5873
5872
|
#
|
5874
5873
|
# resp.to_h outputs the following:
|
5875
5874
|
# {
|
5876
5875
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5877
|
-
#
|
5876
|
+
# server_side_encryption: "AES256",
|
5877
|
+
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
5878
5878
|
# }
|
5879
5879
|
#
|
5880
5880
|
# @example Example: To upload an object (specify optional headers)
|
@@ -6574,6 +6574,13 @@ module Aws::S3
|
|
6574
6574
|
# Describes the format of the data that you want Amazon S3 to return in
|
6575
6575
|
# response.
|
6576
6576
|
#
|
6577
|
+
# @option params [Types::ScanRange] :scan_range
|
6578
|
+
# Specifies the byte range of the object to get the records from. A
|
6579
|
+
# record is processed when its first byte is contained by the range.
|
6580
|
+
# This parameter is optional, but when specified, it must not be empty.
|
6581
|
+
# See RFC 2616, Section 14.35.1 about how to specify the start and end
|
6582
|
+
# of the range.
|
6583
|
+
#
|
6577
6584
|
# @return [Types::SelectObjectContentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
6578
6585
|
#
|
6579
6586
|
# * {Types::SelectObjectContentOutput#payload #payload} => Types::SelectObjectContentEventStream
|
@@ -6740,6 +6747,10 @@ module Aws::S3
|
|
6740
6747
|
# record_delimiter: "RecordDelimiter",
|
6741
6748
|
# },
|
6742
6749
|
# },
|
6750
|
+
# scan_range: {
|
6751
|
+
# start: 1,
|
6752
|
+
# end: 1,
|
6753
|
+
# },
|
6743
6754
|
# })
|
6744
6755
|
#
|
6745
6756
|
# @example Response structure
|
@@ -7002,45 +7013,45 @@ module Aws::S3
|
|
7002
7013
|
# * {Types::UploadPartCopyOutput#request_charged #request_charged} => String
|
7003
7014
|
#
|
7004
7015
|
#
|
7005
|
-
# @example Example: To upload a part by copying
|
7016
|
+
# @example Example: To upload a part by copying byte range from an existing object as data source
|
7006
7017
|
#
|
7007
|
-
# # The following example uploads a part of a multipart upload by copying
|
7018
|
+
# # The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as
|
7019
|
+
# # data source.
|
7008
7020
|
#
|
7009
7021
|
# resp = client.upload_part_copy({
|
7010
7022
|
# bucket: "examplebucket",
|
7011
7023
|
# copy_source: "/bucketname/sourceobjectkey",
|
7024
|
+
# copy_source_range: "bytes=1-100000",
|
7012
7025
|
# key: "examplelargeobject",
|
7013
|
-
# part_number:
|
7026
|
+
# part_number: 2,
|
7014
7027
|
# upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--",
|
7015
7028
|
# })
|
7016
7029
|
#
|
7017
7030
|
# resp.to_h outputs the following:
|
7018
7031
|
# {
|
7019
7032
|
# copy_part_result: {
|
7020
|
-
# etag: "\"
|
7021
|
-
# last_modified: Time.parse("2016-12-29T21:
|
7033
|
+
# etag: "\"65d16d19e65a7508a51f043180edcc36\"",
|
7034
|
+
# last_modified: Time.parse("2016-12-29T21:44:28.000Z"),
|
7022
7035
|
# },
|
7023
7036
|
# }
|
7024
7037
|
#
|
7025
|
-
# @example Example: To upload a part by copying
|
7038
|
+
# @example Example: To upload a part by copying data from an existing object as data source
|
7026
7039
|
#
|
7027
|
-
# # The following example uploads a part of a multipart upload by copying
|
7028
|
-
# # data source.
|
7040
|
+
# # The following example uploads a part of a multipart upload by copying data from an existing object as data source.
|
7029
7041
|
#
|
7030
7042
|
# resp = client.upload_part_copy({
|
7031
7043
|
# bucket: "examplebucket",
|
7032
7044
|
# copy_source: "/bucketname/sourceobjectkey",
|
7033
|
-
# copy_source_range: "bytes=1-100000",
|
7034
7045
|
# key: "examplelargeobject",
|
7035
|
-
# part_number:
|
7046
|
+
# part_number: 1,
|
7036
7047
|
# upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--",
|
7037
7048
|
# })
|
7038
7049
|
#
|
7039
7050
|
# resp.to_h outputs the following:
|
7040
7051
|
# {
|
7041
7052
|
# copy_part_result: {
|
7042
|
-
# etag: "\"
|
7043
|
-
# last_modified: Time.parse("2016-12-29T21:
|
7053
|
+
# etag: "\"b0c6f0e7e054ab8fa2536a2677f8734d\"",
|
7054
|
+
# last_modified: Time.parse("2016-12-29T21:24:43.000Z"),
|
7044
7055
|
# },
|
7045
7056
|
# }
|
7046
7057
|
#
|
@@ -7099,7 +7110,7 @@ module Aws::S3
|
|
7099
7110
|
params: params,
|
7100
7111
|
config: config)
|
7101
7112
|
context[:gem_name] = 'aws-sdk-s3'
|
7102
|
-
context[:gem_version] = '1.
|
7113
|
+
context[:gem_version] = '1.53.0'
|
7103
7114
|
Seahorse::Client::Request.new(handlers, context)
|
7104
7115
|
end
|
7105
7116
|
|
@@ -143,6 +143,7 @@ module Aws::S3
|
|
143
143
|
EncodingType = Shapes::StringShape.new(name: 'EncodingType')
|
144
144
|
Encryption = Shapes::StructureShape.new(name: 'Encryption')
|
145
145
|
EncryptionConfiguration = Shapes::StructureShape.new(name: 'EncryptionConfiguration')
|
146
|
+
End = Shapes::IntegerShape.new(name: 'End')
|
146
147
|
EndEvent = Shapes::StructureShape.new(name: 'EndEvent')
|
147
148
|
Error = Shapes::StructureShape.new(name: 'Error')
|
148
149
|
ErrorDocument = Shapes::StructureShape.new(name: 'ErrorDocument')
|
@@ -463,6 +464,7 @@ module Aws::S3
|
|
463
464
|
SSEKMSEncryptionContext = Shapes::StringShape.new(name: 'SSEKMSEncryptionContext')
|
464
465
|
SSEKMSKeyId = Shapes::StringShape.new(name: 'SSEKMSKeyId')
|
465
466
|
SSES3 = Shapes::StructureShape.new(name: 'SSES3')
|
467
|
+
ScanRange = Shapes::StructureShape.new(name: 'ScanRange')
|
466
468
|
SelectObjectContentEventStream = Shapes::StructureShape.new(name: 'SelectObjectContentEventStream')
|
467
469
|
SelectObjectContentOutput = Shapes::StructureShape.new(name: 'SelectObjectContentOutput')
|
468
470
|
SelectObjectContentRequest = Shapes::StructureShape.new(name: 'SelectObjectContentRequest')
|
@@ -477,6 +479,7 @@ module Aws::S3
|
|
477
479
|
SourceSelectionCriteria = Shapes::StructureShape.new(name: 'SourceSelectionCriteria')
|
478
480
|
SseKmsEncryptedObjects = Shapes::StructureShape.new(name: 'SseKmsEncryptedObjects')
|
479
481
|
SseKmsEncryptedObjectsStatus = Shapes::StringShape.new(name: 'SseKmsEncryptedObjectsStatus')
|
482
|
+
Start = Shapes::IntegerShape.new(name: 'Start')
|
480
483
|
StartAfter = Shapes::StringShape.new(name: 'StartAfter')
|
481
484
|
Stats = Shapes::StructureShape.new(name: 'Stats')
|
482
485
|
StatsEvent = Shapes::StructureShape.new(name: 'StatsEvent')
|
@@ -1997,6 +2000,10 @@ module Aws::S3
|
|
1997
2000
|
|
1998
2001
|
SSES3.struct_class = Types::SSES3
|
1999
2002
|
|
2003
|
+
ScanRange.add_member(:start, Shapes::ShapeRef.new(shape: Start, location_name: "Start"))
|
2004
|
+
ScanRange.add_member(:end, Shapes::ShapeRef.new(shape: End, location_name: "End"))
|
2005
|
+
ScanRange.struct_class = Types::ScanRange
|
2006
|
+
|
2000
2007
|
SelectObjectContentEventStream.add_member(:records, Shapes::ShapeRef.new(shape: RecordsEvent, event: true, location_name: "Records"))
|
2001
2008
|
SelectObjectContentEventStream.add_member(:stats, Shapes::ShapeRef.new(shape: StatsEvent, event: true, location_name: "Stats"))
|
2002
2009
|
SelectObjectContentEventStream.add_member(:progress, Shapes::ShapeRef.new(shape: ProgressEvent, event: true, location_name: "Progress"))
|
@@ -2019,6 +2026,7 @@ module Aws::S3
|
|
2019
2026
|
SelectObjectContentRequest.add_member(:request_progress, Shapes::ShapeRef.new(shape: RequestProgress, location_name: "RequestProgress"))
|
2020
2027
|
SelectObjectContentRequest.add_member(:input_serialization, Shapes::ShapeRef.new(shape: InputSerialization, required: true, location_name: "InputSerialization"))
|
2021
2028
|
SelectObjectContentRequest.add_member(:output_serialization, Shapes::ShapeRef.new(shape: OutputSerialization, required: true, location_name: "OutputSerialization"))
|
2029
|
+
SelectObjectContentRequest.add_member(:scan_range, Shapes::ShapeRef.new(shape: ScanRange, location_name: "ScanRange"))
|
2022
2030
|
SelectObjectContentRequest.struct_class = Types::SelectObjectContentRequest
|
2023
2031
|
|
2024
2032
|
SelectParameters.add_member(:input_serialization, Shapes::ShapeRef.new(shape: InputSerialization, required: true, location_name: "InputSerialization"))
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module Aws
|
2
2
|
module S3
|
3
3
|
class Object
|
4
|
-
|
5
4
|
alias size content_length
|
6
5
|
|
7
6
|
# Copies another object to this object. Use `multipart_copy: true`
|
8
7
|
# for large objects. This is required for objects that exceed 5GB.
|
9
8
|
#
|
10
|
-
# @param [S3::Object, S3::ObjectVersion, S3::ObjectSummary, String, Hash]
|
11
|
-
# Where to copy object data from. `source` must be one of the
|
9
|
+
# @param [S3::Object, S3::ObjectVersion, S3::ObjectSummary, String, Hash]
|
10
|
+
# source Where to copy object data from. `source` must be one of the
|
11
|
+
# following:
|
12
12
|
#
|
13
13
|
# * {Aws::S3::Object}
|
14
14
|
# * {Aws::S3::ObjectSummary}
|
@@ -103,8 +103,9 @@ module Aws
|
|
103
103
|
ObjectCopier.new(self, options).copy_to(target, options)
|
104
104
|
end
|
105
105
|
|
106
|
-
# Copies and deletes the current object. The object will only be
|
107
|
-
#
|
106
|
+
# Copies and deletes the current object. The object will only be deleted
|
107
|
+
# if the copy operation succeeds.
|
108
|
+
#
|
108
109
|
# @param (see Object#copy_to)
|
109
110
|
# @option (see Object#copy_to)
|
110
111
|
# @return [void]
|
@@ -129,10 +130,7 @@ module Aws
|
|
129
130
|
client.config.credentials,
|
130
131
|
client.config.region,
|
131
132
|
bucket_name,
|
132
|
-
{
|
133
|
-
key: key,
|
134
|
-
url: bucket.url,
|
135
|
-
}.merge(options)
|
133
|
+
{ key: key, url: bucket.url }.merge(options)
|
136
134
|
)
|
137
135
|
end
|
138
136
|
|
@@ -186,10 +184,10 @@ module Aws
|
|
186
184
|
#
|
187
185
|
def presigned_url(http_method, params = {})
|
188
186
|
presigner = Presigner.new(client: client)
|
189
|
-
presigner.presigned_url(
|
190
|
-
|
191
|
-
key: key
|
192
|
-
)
|
187
|
+
presigner.presigned_url(
|
188
|
+
"#{http_method.downcase}_object",
|
189
|
+
params.merge(bucket: bucket_name, key: key)
|
190
|
+
)
|
193
191
|
end
|
194
192
|
|
195
193
|
# Returns the public (un-signed) URL for this object.
|
@@ -199,7 +197,8 @@ module Aws
|
|
199
197
|
#
|
200
198
|
# To use virtual hosted bucket url (disables https):
|
201
199
|
#
|
202
|
-
# s3.bucket('my.bucket.com').object('key')
|
200
|
+
# s3.bucket('my.bucket.com').object('key')
|
201
|
+
# .public_url(virtual_host: true)
|
203
202
|
# #=> "http://my.bucket.com/key"
|
204
203
|
#
|
205
204
|
# @option options [Boolean] :virtual_host (false) When `true`, the bucket
|
@@ -216,11 +215,12 @@ module Aws
|
|
216
215
|
|
217
216
|
# Uploads a stream in a streaming fashion to the current object in S3.
|
218
217
|
#
|
219
|
-
#
|
220
|
-
#
|
221
|
-
#
|
218
|
+
# Passed chunks automatically split into multipart upload parts and the
|
219
|
+
# parts are uploaded in parallel. This allows for streaming uploads that
|
220
|
+
# never touch the disk.
|
222
221
|
#
|
223
|
-
#
|
222
|
+
# Note that this is known to have issues in JRuby until jruby-9.1.15.0,
|
223
|
+
# so avoid using this with older versions of JRuby.
|
224
224
|
#
|
225
225
|
# @example Streaming chunks of data
|
226
226
|
# obj.upload_stream do |write_stream|
|
@@ -235,17 +235,15 @@ module Aws
|
|
235
235
|
# IO.copy_stream(STDIN, write_stream)
|
236
236
|
# end
|
237
237
|
#
|
238
|
-
# @option options [Integer] :thread_count
|
239
|
-
#
|
240
|
-
# Default `:thread_count` is `10`.
|
238
|
+
# @option options [Integer] :thread_count (10) The number of parallel
|
239
|
+
# multipart uploads
|
241
240
|
#
|
242
|
-
# @option options [Boolean] :tempfile
|
243
|
-
#
|
244
|
-
#
|
241
|
+
# @option options [Boolean] :tempfile (false) Normally read data is stored
|
242
|
+
# in memory when building the parts in order to complete the underlying
|
243
|
+
# multipart upload. By passing `:tempfile => true` data read will be
|
245
244
|
# temporarily stored on disk reducing the memory footprint vastly.
|
246
|
-
# Default `:tempfile` is `false`.
|
247
245
|
#
|
248
|
-
# @option options [Integer] :part_size
|
246
|
+
# @option options [Integer] :part_size (5242880)
|
249
247
|
# Define how big each part size but the last should be.
|
250
248
|
# Default `:part_size` is `5 * 1024 * 1024`.
|
251
249
|
#
|
@@ -264,9 +262,12 @@ module Aws
|
|
264
262
|
client: client,
|
265
263
|
thread_count: uploading_options.delete(:thread_count),
|
266
264
|
tempfile: uploading_options.delete(:tempfile),
|
267
|
-
part_size: uploading_options.delete(:part_size)
|
265
|
+
part_size: uploading_options.delete(:part_size)
|
266
|
+
)
|
267
|
+
uploader.upload(
|
268
|
+
uploading_options.merge(bucket: bucket_name, key: key),
|
269
|
+
&block
|
268
270
|
)
|
269
|
-
uploader.upload(uploading_options.merge(bucket: bucket_name, key: key), &block)
|
270
271
|
true
|
271
272
|
end
|
272
273
|
|
@@ -282,15 +283,29 @@ module Aws
|
|
282
283
|
# # and the parts are uploaded in parallel
|
283
284
|
# obj.upload_file('/path/to/very_large_file')
|
284
285
|
#
|
285
|
-
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
#
|
286
|
+
# The response of the S3 upload API is yielded if a block given.
|
287
|
+
#
|
288
|
+
# # API response will have etag value of the file
|
289
|
+
# obj.upload_file('/path/to/file') do |response|
|
290
|
+
# etag = response.etag
|
291
|
+
# end
|
292
|
+
#
|
293
|
+
# @param [String, Pathname, File, Tempfile] source A file on the local
|
294
|
+
# file system that will be uploaded as this object. This can either be
|
295
|
+
# a String or Pathname to the file, an open File object, or an open
|
296
|
+
# Tempfile object. If you pass an open File or Tempfile object, then
|
297
|
+
# you are responsible for closing it after the upload completes. When
|
298
|
+
# using an open Tempfile, rewind it before uploading or else the object
|
299
|
+
# will be empty.
|
289
300
|
#
|
290
301
|
# @option options [Integer] :multipart_threshold (15728640) Files larger
|
291
302
|
# than `:multipart_threshold` are uploaded using the S3 multipart APIs.
|
292
303
|
# Default threshold is 15MB.
|
293
304
|
#
|
305
|
+
# @option options [Integer] :thread_count (10) The number of parallel
|
306
|
+
# multipart uploads. This option is not used if the file is smaller than
|
307
|
+
# `:multipart_threshold`.
|
308
|
+
#
|
294
309
|
# @raise [MultipartUploadError] If an object is being uploaded in
|
295
310
|
# parts, and the upload can not be completed, then the upload is
|
296
311
|
# aborted and this error is raised. The raised error has a `#errors`
|
@@ -304,8 +319,13 @@ module Aws
|
|
304
319
|
uploading_options = options.dup
|
305
320
|
uploader = FileUploader.new(
|
306
321
|
multipart_threshold: uploading_options.delete(:multipart_threshold),
|
307
|
-
client: client
|
308
|
-
|
322
|
+
client: client
|
323
|
+
)
|
324
|
+
response = uploader.upload(
|
325
|
+
source,
|
326
|
+
uploading_options.merge(bucket: bucket_name, key: key)
|
327
|
+
)
|
328
|
+
yield response if block_given?
|
309
329
|
true
|
310
330
|
end
|
311
331
|
|
@@ -320,7 +340,7 @@ module Aws
|
|
320
340
|
# # and the parts are downloaded in parallel
|
321
341
|
# obj.download_file('/path/to/very_large_file')
|
322
342
|
#
|
323
|
-
# @param [String] destination Where to download the file to
|
343
|
+
# @param [String] destination Where to download the file to.
|
324
344
|
#
|
325
345
|
# @option options [String] mode `auto`, `single_request`, `get_range`
|
326
346
|
# `single_request` mode forces only 1 GET request is made in download,
|
@@ -328,21 +348,23 @@ module Aws
|
|
328
348
|
# customizing each range size in multipart_download,
|
329
349
|
# By default, `auto` mode is enabled, which performs multipart_download
|
330
350
|
#
|
331
|
-
# @option options [String] chunk_size required in get_range mode
|
351
|
+
# @option options [String] chunk_size required in get_range mode.
|
332
352
|
#
|
333
|
-
# @option options [
|
334
|
-
#
|
353
|
+
# @option options [Integer] thread_count (10) Customize threads used in
|
354
|
+
# the multipart download.
|
335
355
|
#
|
336
|
-
# @option options [String] version_id The object version id used to
|
337
|
-
# the object
|
356
|
+
# @option options [String] version_id The object version id used to
|
357
|
+
# retrieve the object. For more about object versioning, see:
|
338
358
|
# https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectVersioning.html
|
339
359
|
#
|
340
|
-
# @return [Boolean] Returns `true` when the file is downloaded
|
341
|
-
#
|
360
|
+
# @return [Boolean] Returns `true` when the file is downloaded without
|
361
|
+
# any errors.
|
342
362
|
def download_file(destination, options = {})
|
343
363
|
downloader = FileDownloader.new(client: client)
|
344
364
|
downloader.download(
|
345
|
-
destination,
|
365
|
+
destination,
|
366
|
+
options.merge(bucket: bucket_name, key: key)
|
367
|
+
)
|
346
368
|
true
|
347
369
|
end
|
348
370
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
1
3
|
module Aws
|
2
4
|
module S3
|
3
5
|
|
@@ -178,6 +180,8 @@ module Aws
|
|
178
180
|
class Client
|
179
181
|
|
180
182
|
extend Deprecations
|
183
|
+
extend Forwardable
|
184
|
+
def_delegators :@client, :delete_object, :head_object
|
181
185
|
|
182
186
|
# Creates a new encryption client. You must provide one of the following
|
183
187
|
# options:
|
data/lib/aws-sdk-s3/file_part.rb
CHANGED
@@ -1,15 +1,18 @@
|
|
1
1
|
module Aws
|
2
2
|
module S3
|
3
3
|
|
4
|
-
# A utility class that provides an IO-like interface to a portion of
|
5
|
-
#
|
4
|
+
# A utility class that provides an IO-like interface to a portion of a file
|
5
|
+
# on disk.
|
6
6
|
# @api private
|
7
7
|
class FilePart
|
8
8
|
|
9
|
-
# @option options [required,String,Pathname,File,Tempfile] :source
|
10
|
-
#
|
9
|
+
# @option options [required, String, Pathname, File, Tempfile] :source
|
10
|
+
# The file to upload.
|
11
|
+
#
|
12
|
+
# @option options [required, Integer] :offset The file part will read
|
11
13
|
# starting at this byte offset.
|
12
|
-
#
|
14
|
+
#
|
15
|
+
# @option options [required, Integer] :size The maximum number of bytes to
|
13
16
|
# read from the `:offset`.
|
14
17
|
def initialize(options = {})
|
15
18
|
@source = options[:source]
|
@@ -19,7 +22,7 @@ module Aws
|
|
19
22
|
@file = nil
|
20
23
|
end
|
21
24
|
|
22
|
-
# @return [String,Pathname,File,Tempfile]
|
25
|
+
# @return [String, Pathname, File, Tempfile]
|
23
26
|
attr_reader :source
|
24
27
|
|
25
28
|
# @return [Integer]
|
@@ -7,13 +7,14 @@ module Aws
|
|
7
7
|
|
8
8
|
FIFTEEN_MEGABYTES = 15 * 1024 * 1024
|
9
9
|
|
10
|
+
# @param [Hash] options
|
10
11
|
# @option options [Client] :client
|
11
|
-
# @option options [Integer] :multipart_threshold
|
12
|
-
# `:multipart_threshold` bytes are uploaded using S3 multipart APIs.
|
12
|
+
# @option options [Integer] :multipart_threshold (15728640)
|
13
13
|
def initialize(options = {})
|
14
14
|
@options = options
|
15
15
|
@client = options[:client] || Client.new
|
16
|
-
@multipart_threshold = options[:multipart_threshold] ||
|
16
|
+
@multipart_threshold = options[:multipart_threshold] ||
|
17
|
+
FIFTEEN_MEGABYTES
|
17
18
|
end
|
18
19
|
|
19
20
|
# @return [Client]
|
@@ -23,9 +24,9 @@ module Aws
|
|
23
24
|
# using a {MultipartFileUploader}.
|
24
25
|
attr_reader :multipart_threshold
|
25
26
|
|
26
|
-
# @param [String,Pathname,File,Tempfile] source
|
27
|
-
# @option options [required,String] :bucket
|
28
|
-
# @option options [required,String] :key
|
27
|
+
# @param [String, Pathname, File, Tempfile] source The file to upload.
|
28
|
+
# @option options [required, String] :bucket The bucket to upload to.
|
29
|
+
# @option options [required, String] :key The key for the object.
|
29
30
|
# @return [void]
|
30
31
|
def upload(source, options = {})
|
31
32
|
if File.size(source) >= multipart_threshold
|
@@ -37,12 +38,6 @@ module Aws
|
|
37
38
|
|
38
39
|
private
|
39
40
|
|
40
|
-
def put_object(source, options)
|
41
|
-
open_file(source) do |file|
|
42
|
-
@client.put_object(options.merge(body: file))
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
41
|
def open_file(source)
|
47
42
|
if String === source || Pathname === source
|
48
43
|
File.open(source, 'rb') { |file| yield(file) }
|
@@ -51,6 +46,12 @@ module Aws
|
|
51
46
|
end
|
52
47
|
end
|
53
48
|
|
49
|
+
def put_object(source, options)
|
50
|
+
open_file(source) do |file|
|
51
|
+
@client.put_object(options.merge(body: file))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'pathname'
|
2
|
-
require 'thread'
|
3
2
|
require 'set'
|
4
3
|
|
5
4
|
module Aws
|
@@ -16,14 +15,17 @@ module Aws
|
|
16
15
|
THREAD_COUNT = 10
|
17
16
|
|
18
17
|
# @api private
|
19
|
-
CREATE_OPTIONS =
|
20
|
-
|
18
|
+
CREATE_OPTIONS = Set.new(
|
19
|
+
Client.api.operation(:create_multipart_upload).input.shape.member_names
|
20
|
+
)
|
21
21
|
|
22
22
|
# @api private
|
23
|
-
UPLOAD_PART_OPTIONS =
|
24
|
-
|
23
|
+
UPLOAD_PART_OPTIONS = Set.new(
|
24
|
+
Client.api.operation(:upload_part).input.shape.member_names
|
25
|
+
)
|
25
26
|
|
26
27
|
# @option options [Client] :client
|
28
|
+
# @option options [Integer] :thread_count (THREAD_COUNT)
|
27
29
|
def initialize(options = {})
|
28
30
|
@client = options[:client] || Client.new
|
29
31
|
@thread_count = options[:thread_count] || THREAD_COUNT
|
@@ -32,9 +34,9 @@ module Aws
|
|
32
34
|
# @return [Client]
|
33
35
|
attr_reader :client
|
34
36
|
|
35
|
-
# @param [String,Pathname,File,Tempfile] source
|
36
|
-
# @option options [required,String] :bucket
|
37
|
-
# @option options [required,String] :key
|
37
|
+
# @param [String, Pathname, File, Tempfile] source The file to upload.
|
38
|
+
# @option options [required, String] :bucket The bucket to upload to.
|
39
|
+
# @option options [required, String] :key The key for the object.
|
38
40
|
# @return [void]
|
39
41
|
def upload(source, options = {})
|
40
42
|
if File.size(source) < MIN_PART_SIZE
|
@@ -57,7 +59,8 @@ module Aws
|
|
57
59
|
bucket: options[:bucket],
|
58
60
|
key: options[:key],
|
59
61
|
upload_id: upload_id,
|
60
|
-
multipart_upload: { parts: parts }
|
62
|
+
multipart_upload: { parts: parts }
|
63
|
+
)
|
61
64
|
end
|
62
65
|
|
63
66
|
def upload_parts(upload_id, source, options)
|
@@ -93,7 +96,7 @@ module Aws
|
|
93
96
|
part_number = 1
|
94
97
|
parts = []
|
95
98
|
while offset < size
|
96
|
-
parts << upload_part_opts(options).merge(
|
99
|
+
parts << upload_part_opts(options).merge(
|
97
100
|
upload_id: upload_id,
|
98
101
|
part_number: part_number,
|
99
102
|
body: FilePart.new(
|
@@ -101,7 +104,7 @@ module Aws
|
|
101
104
|
offset: offset,
|
102
105
|
size: part_size(size, default_part_size, offset)
|
103
106
|
)
|
104
|
-
|
107
|
+
)
|
105
108
|
part_number += 1
|
106
109
|
offset += default_part_size
|
107
110
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'openssl'
|
2
|
-
require 'base64'
|
3
2
|
|
4
3
|
module Aws
|
5
4
|
module S3
|
@@ -37,13 +36,13 @@ module Aws
|
|
37
36
|
# @return [String<MD5>]
|
38
37
|
def md5(value)
|
39
38
|
if (File === value || Tempfile === value) && !value.path.nil? && File.exist?(value.path)
|
40
|
-
|
39
|
+
OpenSSL::Digest::MD5.file(value).base64digest
|
41
40
|
elsif value.respond_to?(:read)
|
42
41
|
md5 = OpenSSL::Digest::MD5.new
|
43
42
|
update_in_chunks(md5, value)
|
44
|
-
|
43
|
+
md5.base64digest
|
45
44
|
else
|
46
|
-
|
45
|
+
OpenSSL::Digest::MD5.digest(value).base64digest
|
47
46
|
end
|
48
47
|
end
|
49
48
|
|
data/lib/aws-sdk-s3/types.rb
CHANGED
@@ -4215,7 +4215,7 @@ module Aws::S3
|
|
4215
4215
|
# },
|
4216
4216
|
# id: "InventoryId", # required
|
4217
4217
|
# included_object_versions: "All", # required, accepts All, Current
|
4218
|
-
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus
|
4218
|
+
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier
|
4219
4219
|
# schedule: { # required
|
4220
4220
|
# frequency: "Daily", # required, accepts Daily, Weekly
|
4221
4221
|
# },
|
@@ -6855,7 +6855,7 @@ module Aws::S3
|
|
6855
6855
|
# },
|
6856
6856
|
# id: "InventoryId", # required
|
6857
6857
|
# included_object_versions: "All", # required, accepts All, Current
|
6858
|
-
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus
|
6858
|
+
# optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier
|
6859
6859
|
# schedule: { # required
|
6860
6860
|
# frequency: "Daily", # required, accepts Daily, Weekly
|
6861
6861
|
# },
|
@@ -9245,6 +9245,33 @@ module Aws::S3
|
|
9245
9245
|
#
|
9246
9246
|
class SSES3 < Aws::EmptyStructure; end
|
9247
9247
|
|
9248
|
+
# @note When making an API call, you may pass ScanRange
|
9249
|
+
# data as a hash:
|
9250
|
+
#
|
9251
|
+
# {
|
9252
|
+
# start: 1,
|
9253
|
+
# end: 1,
|
9254
|
+
# }
|
9255
|
+
#
|
9256
|
+
# @!attribute [rw] start
|
9257
|
+
# Specifies the start of the byte range. This parameter is optional.
|
9258
|
+
# Valid values: non-negative integers. The default value is 0.
|
9259
|
+
# @return [Integer]
|
9260
|
+
#
|
9261
|
+
# @!attribute [rw] end
|
9262
|
+
# Specifies the end of the byte range. This parameter is optional.
|
9263
|
+
# Valid values: non-negative integers. The default value is one less
|
9264
|
+
# than the size of the object being queried.
|
9265
|
+
# @return [Integer]
|
9266
|
+
#
|
9267
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ScanRange AWS API Documentation
|
9268
|
+
#
|
9269
|
+
class ScanRange < Struct.new(
|
9270
|
+
:start,
|
9271
|
+
:end)
|
9272
|
+
include Aws::Structure
|
9273
|
+
end
|
9274
|
+
|
9248
9275
|
# @!attribute [rw] payload
|
9249
9276
|
# @return [Types::SelectObjectContentEventStream]
|
9250
9277
|
#
|
@@ -9311,6 +9338,10 @@ module Aws::S3
|
|
9311
9338
|
# record_delimiter: "RecordDelimiter",
|
9312
9339
|
# },
|
9313
9340
|
# },
|
9341
|
+
# scan_range: {
|
9342
|
+
# start: 1,
|
9343
|
+
# end: 1,
|
9344
|
+
# },
|
9314
9345
|
# }
|
9315
9346
|
#
|
9316
9347
|
# @!attribute [rw] bucket
|
@@ -9372,6 +9403,14 @@ module Aws::S3
|
|
9372
9403
|
# in response.
|
9373
9404
|
# @return [Types::OutputSerialization]
|
9374
9405
|
#
|
9406
|
+
# @!attribute [rw] scan_range
|
9407
|
+
# Specifies the byte range of the object to get the records from. A
|
9408
|
+
# record is processed when its first byte is contained by the range.
|
9409
|
+
# This parameter is optional, but when specified, it must not be
|
9410
|
+
# empty. See RFC 2616, Section 14.35.1 about how to specify the start
|
9411
|
+
# and end of the range.
|
9412
|
+
# @return [Types::ScanRange]
|
9413
|
+
#
|
9375
9414
|
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContentRequest AWS API Documentation
|
9376
9415
|
#
|
9377
9416
|
class SelectObjectContentRequest < Struct.new(
|
@@ -9384,7 +9423,8 @@ module Aws::S3
|
|
9384
9423
|
:expression_type,
|
9385
9424
|
:request_progress,
|
9386
9425
|
:input_serialization,
|
9387
|
-
:output_serialization
|
9426
|
+
:output_serialization,
|
9427
|
+
:scan_range)
|
9388
9428
|
include Aws::Structure
|
9389
9429
|
end
|
9390
9430
|
|
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.53.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: 2019-
|
11
|
+
date: 2019-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: '3'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 3.
|
50
|
+
version: 3.71.0
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '3'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 3.
|
60
|
+
version: 3.71.0
|
61
61
|
description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
|
62
62
|
This gem is part of the AWS SDK for Ruby.
|
63
63
|
email:
|