aws-sdk-s3 1.113.0 → 1.114.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/client.rb +139 -134
- data/lib/aws-sdk-s3/object_summary.rb +3 -1
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +6 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +23 -2
- data/lib/aws-sdk-s3/types.rb +8 -4
- 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: dc4ed3965895fd8f673f79e9c405d272cd281f2fee60e6f78a791a0743c981fe
|
4
|
+
data.tar.gz: 2328ddf1594b50e642acfb659edc07fe02f35ad383948363699333e63e3b57ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d35e6bd7c43c29a3bb8b31b4094a89608fac6ed9b3b13fd4da5fa37419f573215290346214d1c62747add1f352b43c405afb2c4b7e187ce267def725aa8b2ff1
|
7
|
+
data.tar.gz: b02f97001766edc02501290d135234ef99b45b54bf25560384887455a1f4dcec81b235aaa553e25e43cfe60c7cd8ef6a315ba44979b94fd0f6d2c2dc7a348404
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
Unreleased Changes
|
2
2
|
------------------
|
3
3
|
|
4
|
+
1.114.0 (2022-05-03)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Feature - Documentation only update for doc bug fixes for the S3 API docs.
|
8
|
+
|
9
|
+
1.113.2 (2022-04-26)
|
10
|
+
------------------
|
11
|
+
|
12
|
+
* Issue - Fix an issue where `ExpiredToken` errors were retried as if the request was from another region.
|
13
|
+
|
14
|
+
1.113.1 (2022-04-25)
|
15
|
+
------------------
|
16
|
+
|
17
|
+
* Issue - Rewind the underlying file on a streaming retry that is not a truncated body (#2692).
|
18
|
+
|
4
19
|
1.113.0 (2022-02-24)
|
5
20
|
------------------
|
6
21
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.114.0
|
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -1662,33 +1662,33 @@ module Aws::S3
|
|
1662
1662
|
# * {Types::CreateBucketOutput#location #location} => String
|
1663
1663
|
#
|
1664
1664
|
#
|
1665
|
-
# @example Example: To create a bucket
|
1665
|
+
# @example Example: To create a bucket in a specific region
|
1666
1666
|
#
|
1667
|
-
# # The following example creates a bucket.
|
1667
|
+
# # The following example creates a bucket. The request specifies an AWS region where to create the bucket.
|
1668
1668
|
#
|
1669
1669
|
# resp = client.create_bucket({
|
1670
1670
|
# bucket: "examplebucket",
|
1671
|
+
# create_bucket_configuration: {
|
1672
|
+
# location_constraint: "eu-west-1",
|
1673
|
+
# },
|
1671
1674
|
# })
|
1672
1675
|
#
|
1673
1676
|
# resp.to_h outputs the following:
|
1674
1677
|
# {
|
1675
|
-
# location: "/
|
1678
|
+
# location: "http://examplebucket.<Region>.s3.amazonaws.com/",
|
1676
1679
|
# }
|
1677
1680
|
#
|
1678
|
-
# @example Example: To create a bucket
|
1681
|
+
# @example Example: To create a bucket
|
1679
1682
|
#
|
1680
|
-
# # The following example creates a bucket.
|
1683
|
+
# # The following example creates a bucket.
|
1681
1684
|
#
|
1682
1685
|
# resp = client.create_bucket({
|
1683
1686
|
# bucket: "examplebucket",
|
1684
|
-
# create_bucket_configuration: {
|
1685
|
-
# location_constraint: "eu-west-1",
|
1686
|
-
# },
|
1687
1687
|
# })
|
1688
1688
|
#
|
1689
1689
|
# resp.to_h outputs the following:
|
1690
1690
|
# {
|
1691
|
-
# location: "
|
1691
|
+
# location: "/examplebucket",
|
1692
1692
|
# }
|
1693
1693
|
#
|
1694
1694
|
# @example Request syntax with placeholder values
|
@@ -3109,15 +3109,6 @@ module Aws::S3
|
|
3109
3109
|
# * {Types::DeleteObjectOutput#request_charged #request_charged} => String
|
3110
3110
|
#
|
3111
3111
|
#
|
3112
|
-
# @example Example: To delete an object (from a non-versioned bucket)
|
3113
|
-
#
|
3114
|
-
# # The following example deletes an object from a non-versioned bucket.
|
3115
|
-
#
|
3116
|
-
# resp = client.delete_object({
|
3117
|
-
# bucket: "ExampleBucket",
|
3118
|
-
# key: "HappyFace.jpg",
|
3119
|
-
# })
|
3120
|
-
#
|
3121
3112
|
# @example Example: To delete an object
|
3122
3113
|
#
|
3123
3114
|
# # The following example deletes an object from an S3 bucket.
|
@@ -3131,6 +3122,15 @@ module Aws::S3
|
|
3131
3122
|
# {
|
3132
3123
|
# }
|
3133
3124
|
#
|
3125
|
+
# @example Example: To delete an object (from a non-versioned bucket)
|
3126
|
+
#
|
3127
|
+
# # The following example deletes an object from a non-versioned bucket.
|
3128
|
+
#
|
3129
|
+
# resp = client.delete_object({
|
3130
|
+
# bucket: "ExampleBucket",
|
3131
|
+
# key: "HappyFace.jpg",
|
3132
|
+
# })
|
3133
|
+
#
|
3134
3134
|
# @example Request syntax with placeholder values
|
3135
3135
|
#
|
3136
3136
|
# resp = client.delete_object({
|
@@ -6582,49 +6582,49 @@ module Aws::S3
|
|
6582
6582
|
# * {Types::GetObjectTaggingOutput#tag_set #tag_set} => Array<Types::Tag>
|
6583
6583
|
#
|
6584
6584
|
#
|
6585
|
-
# @example Example: To retrieve tag set of
|
6585
|
+
# @example Example: To retrieve tag set of an object
|
6586
6586
|
#
|
6587
|
-
# # The following example retrieves tag set of an object.
|
6587
|
+
# # The following example retrieves tag set of an object.
|
6588
6588
|
#
|
6589
6589
|
# resp = client.get_object_tagging({
|
6590
6590
|
# bucket: "examplebucket",
|
6591
|
-
# key: "
|
6592
|
-
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
6591
|
+
# key: "HappyFace.jpg",
|
6593
6592
|
# })
|
6594
6593
|
#
|
6595
6594
|
# resp.to_h outputs the following:
|
6596
6595
|
# {
|
6597
6596
|
# tag_set: [
|
6598
6597
|
# {
|
6599
|
-
# key: "
|
6600
|
-
# value: "
|
6598
|
+
# key: "Key4",
|
6599
|
+
# value: "Value4",
|
6600
|
+
# },
|
6601
|
+
# {
|
6602
|
+
# key: "Key3",
|
6603
|
+
# value: "Value3",
|
6601
6604
|
# },
|
6602
6605
|
# ],
|
6603
|
-
# version_id: "
|
6606
|
+
# version_id: "null",
|
6604
6607
|
# }
|
6605
6608
|
#
|
6606
|
-
# @example Example: To retrieve tag set of
|
6609
|
+
# @example Example: To retrieve tag set of a specific object version
|
6607
6610
|
#
|
6608
|
-
# # The following example retrieves tag set of an object.
|
6611
|
+
# # The following example retrieves tag set of an object. The request specifies object version.
|
6609
6612
|
#
|
6610
6613
|
# resp = client.get_object_tagging({
|
6611
6614
|
# bucket: "examplebucket",
|
6612
|
-
# key: "
|
6615
|
+
# key: "exampleobject",
|
6616
|
+
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
6613
6617
|
# })
|
6614
6618
|
#
|
6615
6619
|
# resp.to_h outputs the following:
|
6616
6620
|
# {
|
6617
6621
|
# tag_set: [
|
6618
6622
|
# {
|
6619
|
-
# key: "
|
6620
|
-
# value: "
|
6621
|
-
# },
|
6622
|
-
# {
|
6623
|
-
# key: "Key3",
|
6624
|
-
# value: "Value3",
|
6623
|
+
# key: "Key1",
|
6624
|
+
# value: "Value1",
|
6625
6625
|
# },
|
6626
6626
|
# ],
|
6627
|
-
# version_id: "
|
6627
|
+
# version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
|
6628
6628
|
# }
|
6629
6629
|
#
|
6630
6630
|
# @example Request syntax with placeholder values
|
@@ -7817,97 +7817,97 @@ module Aws::S3
|
|
7817
7817
|
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
7818
7818
|
#
|
7819
7819
|
#
|
7820
|
-
# @example Example:
|
7820
|
+
# @example Example: List next set of multipart uploads when previous result is truncated
|
7821
7821
|
#
|
7822
|
-
# # The following example
|
7822
|
+
# # The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next
|
7823
|
+
# # setup of multipart uploads.
|
7823
7824
|
#
|
7824
7825
|
# resp = client.list_multipart_uploads({
|
7825
7826
|
# bucket: "examplebucket",
|
7827
|
+
# key_marker: "nextkeyfrompreviousresponse",
|
7828
|
+
# max_uploads: 2,
|
7829
|
+
# upload_id_marker: "valuefrompreviousresponse",
|
7826
7830
|
# })
|
7827
7831
|
#
|
7828
7832
|
# resp.to_h outputs the following:
|
7829
7833
|
# {
|
7834
|
+
# bucket: "acl1",
|
7835
|
+
# is_truncated: true,
|
7836
|
+
# key_marker: "",
|
7837
|
+
# max_uploads: 2,
|
7838
|
+
# next_key_marker: "someobjectkey",
|
7839
|
+
# next_upload_id_marker: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
7840
|
+
# upload_id_marker: "",
|
7830
7841
|
# uploads: [
|
7831
7842
|
# {
|
7832
7843
|
# initiated: Time.parse("2014-05-01T05:40:58.000Z"),
|
7833
7844
|
# initiator: {
|
7834
|
-
# display_name: "display-name",
|
7845
|
+
# display_name: "ownder-display-name",
|
7835
7846
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7836
7847
|
# },
|
7837
7848
|
# key: "JavaFile",
|
7838
7849
|
# owner: {
|
7839
|
-
# display_name: "
|
7840
|
-
# id: "
|
7850
|
+
# display_name: "mohanataws",
|
7851
|
+
# id: "852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7841
7852
|
# },
|
7842
7853
|
# storage_class: "STANDARD",
|
7843
|
-
# upload_id: "
|
7854
|
+
# upload_id: "gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--",
|
7844
7855
|
# },
|
7845
7856
|
# {
|
7846
7857
|
# initiated: Time.parse("2014-05-01T05:41:27.000Z"),
|
7847
7858
|
# initiator: {
|
7848
|
-
# display_name: "display-name",
|
7859
|
+
# display_name: "ownder-display-name",
|
7849
7860
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7850
7861
|
# },
|
7851
7862
|
# key: "JavaFile",
|
7852
7863
|
# owner: {
|
7853
|
-
# display_name: "display-name",
|
7864
|
+
# display_name: "ownder-display-name",
|
7854
7865
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7855
7866
|
# },
|
7856
7867
|
# storage_class: "STANDARD",
|
7857
|
-
# upload_id: "
|
7868
|
+
# upload_id: "b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
7858
7869
|
# },
|
7859
7870
|
# ],
|
7860
7871
|
# }
|
7861
7872
|
#
|
7862
|
-
# @example Example:
|
7873
|
+
# @example Example: To list in-progress multipart uploads on a bucket
|
7863
7874
|
#
|
7864
|
-
# # The following example
|
7865
|
-
# # setup of multipart uploads.
|
7875
|
+
# # The following example lists in-progress multipart uploads on a specific bucket.
|
7866
7876
|
#
|
7867
7877
|
# resp = client.list_multipart_uploads({
|
7868
7878
|
# bucket: "examplebucket",
|
7869
|
-
# key_marker: "nextkeyfrompreviousresponse",
|
7870
|
-
# max_uploads: 2,
|
7871
|
-
# upload_id_marker: "valuefrompreviousresponse",
|
7872
7879
|
# })
|
7873
7880
|
#
|
7874
7881
|
# resp.to_h outputs the following:
|
7875
7882
|
# {
|
7876
|
-
# bucket: "acl1",
|
7877
|
-
# is_truncated: true,
|
7878
|
-
# key_marker: "",
|
7879
|
-
# max_uploads: 2,
|
7880
|
-
# next_key_marker: "someobjectkey",
|
7881
|
-
# next_upload_id_marker: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
7882
|
-
# upload_id_marker: "",
|
7883
7883
|
# uploads: [
|
7884
7884
|
# {
|
7885
7885
|
# initiated: Time.parse("2014-05-01T05:40:58.000Z"),
|
7886
7886
|
# initiator: {
|
7887
|
-
# display_name: "
|
7887
|
+
# display_name: "display-name",
|
7888
7888
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7889
7889
|
# },
|
7890
7890
|
# key: "JavaFile",
|
7891
7891
|
# owner: {
|
7892
|
-
# display_name: "
|
7893
|
-
# id: "
|
7892
|
+
# display_name: "display-name",
|
7893
|
+
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7894
7894
|
# },
|
7895
7895
|
# storage_class: "STANDARD",
|
7896
|
-
# upload_id: "
|
7896
|
+
# upload_id: "examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--",
|
7897
7897
|
# },
|
7898
7898
|
# {
|
7899
7899
|
# initiated: Time.parse("2014-05-01T05:41:27.000Z"),
|
7900
7900
|
# initiator: {
|
7901
|
-
# display_name: "
|
7901
|
+
# display_name: "display-name",
|
7902
7902
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7903
7903
|
# },
|
7904
7904
|
# key: "JavaFile",
|
7905
7905
|
# owner: {
|
7906
|
-
# display_name: "
|
7906
|
+
# display_name: "display-name",
|
7907
7907
|
# id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc",
|
7908
7908
|
# },
|
7909
7909
|
# storage_class: "STANDARD",
|
7910
|
-
# upload_id: "
|
7910
|
+
# upload_id: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--",
|
7911
7911
|
# },
|
7912
7912
|
# ],
|
7913
7913
|
# }
|
@@ -10028,7 +10028,9 @@ module Aws::S3
|
|
10028
10028
|
#
|
10029
10029
|
# You specify the lifecycle configuration in your request body. The
|
10030
10030
|
# lifecycle configuration is specified as XML consisting of one or more
|
10031
|
-
# rules.
|
10031
|
+
# rules. An Amazon S3 Lifecycle configuration can have up to 1,000
|
10032
|
+
# rules. This limit is not adjustable. Each rule consists of the
|
10033
|
+
# following:
|
10032
10034
|
#
|
10033
10035
|
# * Filter identifying a subset of objects to which the rule applies.
|
10034
10036
|
# The filter can be based on a key name prefix, object tags, or a
|
@@ -12161,134 +12163,134 @@ module Aws::S3
|
|
12161
12163
|
# * {Types::PutObjectOutput#request_charged #request_charged} => String
|
12162
12164
|
#
|
12163
12165
|
#
|
12164
|
-
# @example Example: To
|
12166
|
+
# @example Example: To create an object.
|
12165
12167
|
#
|
12166
|
-
# # The following example
|
12167
|
-
# # S3 returns version ID of the newly created object.
|
12168
|
+
# # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
|
12168
12169
|
#
|
12169
12170
|
# resp = client.put_object({
|
12170
|
-
# body: "
|
12171
|
+
# body: "filetoupload",
|
12171
12172
|
# bucket: "examplebucket",
|
12172
|
-
# key: "
|
12173
|
-
# tagging: "key1=value1&key2=value2",
|
12173
|
+
# key: "objectkey",
|
12174
12174
|
# })
|
12175
12175
|
#
|
12176
12176
|
# resp.to_h outputs the following:
|
12177
12177
|
# {
|
12178
12178
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12179
|
-
# version_id: "
|
12179
|
+
# version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
|
12180
12180
|
# }
|
12181
12181
|
#
|
12182
|
-
# @example Example: To upload an object
|
12182
|
+
# @example Example: To upload an object
|
12183
12183
|
#
|
12184
|
-
# # The following example uploads
|
12185
|
-
# #
|
12184
|
+
# # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
|
12185
|
+
# # syntax. S3 returns VersionId of the newly created object.
|
12186
12186
|
#
|
12187
12187
|
# resp = client.put_object({
|
12188
|
-
#
|
12189
|
-
# body: "filetoupload",
|
12188
|
+
# body: "HappyFace.jpg",
|
12190
12189
|
# bucket: "examplebucket",
|
12191
|
-
# key: "
|
12190
|
+
# key: "HappyFace.jpg",
|
12192
12191
|
# })
|
12193
12192
|
#
|
12194
12193
|
# resp.to_h outputs the following:
|
12195
12194
|
# {
|
12196
12195
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12197
|
-
# version_id: "
|
12196
|
+
# version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
|
12198
12197
|
# }
|
12199
12198
|
#
|
12200
|
-
# @example Example: To upload
|
12199
|
+
# @example Example: To upload object and specify user-defined metadata
|
12201
12200
|
#
|
12202
|
-
# # The following example
|
12203
|
-
# #
|
12201
|
+
# # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning
|
12202
|
+
# # enabled, S3 returns version ID in response.
|
12204
12203
|
#
|
12205
12204
|
# resp = client.put_object({
|
12206
12205
|
# body: "filetoupload",
|
12207
12206
|
# bucket: "examplebucket",
|
12208
12207
|
# key: "exampleobject",
|
12209
|
-
#
|
12210
|
-
#
|
12208
|
+
# metadata: {
|
12209
|
+
# "metadata1" => "value1",
|
12210
|
+
# "metadata2" => "value2",
|
12211
|
+
# },
|
12211
12212
|
# })
|
12212
12213
|
#
|
12213
12214
|
# resp.to_h outputs the following:
|
12214
12215
|
# {
|
12215
12216
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12216
|
-
#
|
12217
|
-
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
12217
|
+
# version_id: "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0",
|
12218
12218
|
# }
|
12219
12219
|
#
|
12220
|
-
# @example Example: To
|
12220
|
+
# @example Example: To upload an object and specify optional tags
|
12221
12221
|
#
|
12222
|
-
# # The following example
|
12222
|
+
# # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
|
12223
|
+
# # S3 returns version ID of the newly created object.
|
12223
12224
|
#
|
12224
12225
|
# resp = client.put_object({
|
12225
|
-
# body: "
|
12226
|
+
# body: "c:\\HappyFace.jpg",
|
12226
12227
|
# bucket: "examplebucket",
|
12227
|
-
# key: "
|
12228
|
+
# key: "HappyFace.jpg",
|
12229
|
+
# tagging: "key1=value1&key2=value2",
|
12228
12230
|
# })
|
12229
12231
|
#
|
12230
12232
|
# resp.to_h outputs the following:
|
12231
12233
|
# {
|
12232
12234
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12233
|
-
# version_id: "
|
12235
|
+
# version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
|
12234
12236
|
# }
|
12235
12237
|
#
|
12236
|
-
# @example Example: To upload an object
|
12238
|
+
# @example Example: To upload an object (specify optional headers)
|
12237
12239
|
#
|
12238
|
-
# # The following example uploads an object
|
12239
|
-
# #
|
12240
|
+
# # The following example uploads an object. The request specifies optional request headers to directs S3 to use specific
|
12241
|
+
# # storage class and use server-side encryption.
|
12240
12242
|
#
|
12241
12243
|
# resp = client.put_object({
|
12242
12244
|
# body: "HappyFace.jpg",
|
12243
12245
|
# bucket: "examplebucket",
|
12244
12246
|
# key: "HappyFace.jpg",
|
12247
|
+
# server_side_encryption: "AES256",
|
12248
|
+
# storage_class: "STANDARD_IA",
|
12245
12249
|
# })
|
12246
12250
|
#
|
12247
12251
|
# resp.to_h outputs the following:
|
12248
12252
|
# {
|
12249
12253
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12250
|
-
#
|
12254
|
+
# server_side_encryption: "AES256",
|
12255
|
+
# version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp",
|
12251
12256
|
# }
|
12252
12257
|
#
|
12253
|
-
# @example Example: To upload an object
|
12258
|
+
# @example Example: To upload an object and specify server-side encryption and object tags
|
12254
12259
|
#
|
12255
|
-
# # The following example uploads
|
12256
|
-
# #
|
12260
|
+
# # The following example uploads and object. The request specifies the optional server-side encryption option. The request
|
12261
|
+
# # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
|
12257
12262
|
#
|
12258
12263
|
# resp = client.put_object({
|
12259
|
-
# body: "
|
12264
|
+
# body: "filetoupload",
|
12260
12265
|
# bucket: "examplebucket",
|
12261
|
-
# key: "
|
12266
|
+
# key: "exampleobject",
|
12262
12267
|
# server_side_encryption: "AES256",
|
12263
|
-
#
|
12268
|
+
# tagging: "key1=value1&key2=value2",
|
12264
12269
|
# })
|
12265
12270
|
#
|
12266
12271
|
# resp.to_h outputs the following:
|
12267
12272
|
# {
|
12268
12273
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12269
12274
|
# server_side_encryption: "AES256",
|
12270
|
-
# version_id: "
|
12275
|
+
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
12271
12276
|
# }
|
12272
12277
|
#
|
12273
|
-
# @example Example: To upload object and specify
|
12278
|
+
# @example Example: To upload an object and specify canned ACL.
|
12274
12279
|
#
|
12275
|
-
# # The following example
|
12276
|
-
# # enabled, S3 returns version ID in response.
|
12280
|
+
# # The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ
|
12281
|
+
# # access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.
|
12277
12282
|
#
|
12278
12283
|
# resp = client.put_object({
|
12284
|
+
# acl: "authenticated-read",
|
12279
12285
|
# body: "filetoupload",
|
12280
12286
|
# bucket: "examplebucket",
|
12281
12287
|
# key: "exampleobject",
|
12282
|
-
# metadata: {
|
12283
|
-
# "metadata1" => "value1",
|
12284
|
-
# "metadata2" => "value2",
|
12285
|
-
# },
|
12286
12288
|
# })
|
12287
12289
|
#
|
12288
12290
|
# resp.to_h outputs the following:
|
12289
12291
|
# {
|
12290
12292
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
12291
|
-
# version_id: "
|
12293
|
+
# version_id: "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr",
|
12292
12294
|
# }
|
12293
12295
|
#
|
12294
12296
|
# @example Streaming a file from disk
|
@@ -14230,9 +14232,11 @@ module Aws::S3
|
|
14230
14232
|
# number uniquely identifies a part and also defines its position within
|
14231
14233
|
# the object being created. If you upload a new part using the same part
|
14232
14234
|
# number that was used with a previous part, the previously uploaded
|
14233
|
-
# part is overwritten.
|
14234
|
-
#
|
14235
|
-
#
|
14235
|
+
# part is overwritten.
|
14236
|
+
#
|
14237
|
+
# For information about maximum and minimum part sizes and other
|
14238
|
+
# multipart upload specifications, see [Multipart upload limits][3] in
|
14239
|
+
# the *Amazon S3 User Guide*.
|
14236
14240
|
#
|
14237
14241
|
# To ensure that data is not corrupted when traversing the network,
|
14238
14242
|
# specify the `Content-MD5` header in the upload part request. Amazon S3
|
@@ -14243,7 +14247,7 @@ module Aws::S3
|
|
14243
14247
|
# Web Services S3 uses the `x-amz-content-sha256` header as a checksum
|
14244
14248
|
# instead of `Content-MD5`. For more information see [Authenticating
|
14245
14249
|
# Requests: Using the Authorization Header (Amazon Web Services
|
14246
|
-
# Signature Version 4)][
|
14250
|
+
# Signature Version 4)][4].
|
14247
14251
|
#
|
14248
14252
|
# **Note:** After you initiate multipart upload and upload one or more
|
14249
14253
|
# parts, you must either complete or abort multipart upload in order to
|
@@ -14252,10 +14256,10 @@ module Aws::S3
|
|
14252
14256
|
# parts storage and stops charging you for the parts storage.
|
14253
14257
|
#
|
14254
14258
|
# For more information on multipart uploads, go to [Multipart Upload
|
14255
|
-
# Overview][
|
14259
|
+
# Overview][5] in the <i>Amazon S3 User Guide </i>.
|
14256
14260
|
#
|
14257
14261
|
# For information on the permissions required to use the multipart
|
14258
|
-
# upload API, go to [Multipart Upload and Permissions][
|
14262
|
+
# upload API, go to [Multipart Upload and Permissions][6] in the *Amazon
|
14259
14263
|
# S3 User Guide*.
|
14260
14264
|
#
|
14261
14265
|
# You can optionally request server-side encryption where Amazon S3
|
@@ -14266,7 +14270,7 @@ module Aws::S3
|
|
14266
14270
|
# encryption key, the request headers you provide in the request must
|
14267
14271
|
# match the headers you used in the request to initiate the upload by
|
14268
14272
|
# using [CreateMultipartUpload][2]. For more information, go to [Using
|
14269
|
-
# Server-Side Encryption][
|
14273
|
+
# Server-Side Encryption][7] in the *Amazon S3 User Guide*.
|
14270
14274
|
#
|
14271
14275
|
# Server-side encryption is supported by the S3 Multipart Upload
|
14272
14276
|
# actions. Unless you are using a customer-provided encryption key, you
|
@@ -14302,26 +14306,27 @@ module Aws::S3
|
|
14302
14306
|
#
|
14303
14307
|
# * [CreateMultipartUpload][2]
|
14304
14308
|
#
|
14305
|
-
# * [CompleteMultipartUpload][
|
14309
|
+
# * [CompleteMultipartUpload][8]
|
14306
14310
|
#
|
14307
|
-
# * [AbortMultipartUpload][
|
14311
|
+
# * [AbortMultipartUpload][9]
|
14308
14312
|
#
|
14309
|
-
# * [ListParts][
|
14313
|
+
# * [ListParts][10]
|
14310
14314
|
#
|
14311
|
-
# * [ListMultipartUploads][
|
14315
|
+
# * [ListMultipartUploads][11]
|
14312
14316
|
#
|
14313
14317
|
#
|
14314
14318
|
#
|
14315
14319
|
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
|
14316
14320
|
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html
|
14317
|
-
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/
|
14318
|
-
# [4]: https://docs.aws.amazon.com/AmazonS3/latest/
|
14319
|
-
# [5]: https://docs.aws.amazon.com/AmazonS3/latest/dev/
|
14320
|
-
# [6]: https://docs.aws.amazon.com/AmazonS3/latest/dev/
|
14321
|
-
# [7]: https://docs.aws.amazon.com/AmazonS3/latest/
|
14322
|
-
# [8]: https://docs.aws.amazon.com/AmazonS3/latest/API/
|
14323
|
-
# [9]: https://docs.aws.amazon.com/AmazonS3/latest/API/
|
14324
|
-
# [10]: https://docs.aws.amazon.com/AmazonS3/latest/API/
|
14321
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html
|
14322
|
+
# [4]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html
|
14323
|
+
# [5]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html
|
14324
|
+
# [6]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html
|
14325
|
+
# [7]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html
|
14326
|
+
# [8]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html
|
14327
|
+
# [9]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html
|
14328
|
+
# [10]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html
|
14329
|
+
# [11]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html
|
14325
14330
|
#
|
14326
14331
|
# @option params [String, StringIO, File] :body
|
14327
14332
|
# Object data.
|
@@ -14551,9 +14556,9 @@ module Aws::S3
|
|
14551
14556
|
# `x-amz-copy-source` in your request and a byte range by adding the
|
14552
14557
|
# request header `x-amz-copy-source-range` in your request.
|
14553
14558
|
#
|
14554
|
-
#
|
14555
|
-
#
|
14556
|
-
#
|
14559
|
+
# For information about maximum and minimum part sizes and other
|
14560
|
+
# multipart upload specifications, see [Multipart upload limits][1] in
|
14561
|
+
# the *Amazon S3 User Guide*.
|
14557
14562
|
#
|
14558
14563
|
# <note markdown="1"> Instead of using an existing object as part data, you might use the
|
14559
14564
|
# [UploadPart][2] action and provide data in your request.
|
@@ -14664,7 +14669,7 @@ module Aws::S3
|
|
14664
14669
|
#
|
14665
14670
|
#
|
14666
14671
|
#
|
14667
|
-
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/
|
14672
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html
|
14668
14673
|
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html
|
14669
14674
|
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
|
14670
14675
|
# [4]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html
|
@@ -15332,7 +15337,7 @@ module Aws::S3
|
|
15332
15337
|
params: params,
|
15333
15338
|
config: config)
|
15334
15339
|
context[:gem_name] = 'aws-sdk-s3'
|
15335
|
-
context[:gem_version] = '1.
|
15340
|
+
context[:gem_version] = '1.114.0'
|
15336
15341
|
Seahorse::Client::Request.new(handlers, context)
|
15337
15342
|
end
|
15338
15343
|
|
@@ -66,7 +66,9 @@ module Aws::S3
|
|
66
66
|
#
|
67
67
|
# * If an object is created by either the Multipart Upload or Part Copy
|
68
68
|
# operation, the ETag is not an MD5 digest, regardless of the method
|
69
|
-
# of encryption.
|
69
|
+
# of encryption. If an object is larger than 16 MB, the Amazon Web
|
70
|
+
# Services Management Console will upload or copy that object as a
|
71
|
+
# Multipart Upload, and therefore the ETag will not be an MD5 digest.
|
70
72
|
# @return [String]
|
71
73
|
def etag
|
72
74
|
data[:etag]
|
@@ -138,7 +138,8 @@ module Aws
|
|
138
138
|
def handle_region_errors(response)
|
139
139
|
if wrong_sigv4_region?(response) &&
|
140
140
|
!fips_region?(response) &&
|
141
|
-
!custom_endpoint?(response)
|
141
|
+
!custom_endpoint?(response) &&
|
142
|
+
!expired_credentials?(response)
|
142
143
|
get_region_and_retry(response.context)
|
143
144
|
else
|
144
145
|
response
|
@@ -162,6 +163,10 @@ module Aws
|
|
162
163
|
resp.context.http_request.endpoint.host.include?('fips')
|
163
164
|
end
|
164
165
|
|
166
|
+
def expired_credentials?(resp)
|
167
|
+
resp.context.http_response.body_contents.match(/<Code>ExpiredToken<\/Code>/)
|
168
|
+
end
|
169
|
+
|
165
170
|
def custom_endpoint?(resp)
|
166
171
|
resolved_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(
|
167
172
|
resp.context.config.region,
|
@@ -36,6 +36,17 @@ module Aws
|
|
36
36
|
def rewind; end
|
37
37
|
end
|
38
38
|
|
39
|
+
class NonRetryableStreamingError < StandardError
|
40
|
+
|
41
|
+
def initialize(error)
|
42
|
+
super('Unable to retry request - retry could result in processing duplicated chunks.')
|
43
|
+
set_backtrace(error.backtrace)
|
44
|
+
@original_error = error
|
45
|
+
end
|
46
|
+
|
47
|
+
attr_reader :original_error
|
48
|
+
end
|
49
|
+
|
39
50
|
# This handler works with the ResponseTarget plugin to provide smart
|
40
51
|
# retries of S3 streaming operations that support the range parameter
|
41
52
|
# (currently only: get_object). When a 200 OK with a TruncatedBodyError
|
@@ -84,8 +95,18 @@ module Aws
|
|
84
95
|
end
|
85
96
|
|
86
97
|
context.http_response.on_error do |error|
|
87
|
-
if retryable_body?(context)
|
88
|
-
|
98
|
+
if retryable_body?(context)
|
99
|
+
if truncated_body?(error)
|
100
|
+
context.http_request.headers[:range] = "bytes=#{context.http_response.body.size}-"
|
101
|
+
else
|
102
|
+
case context.http_response.body
|
103
|
+
when RetryableManagedFile
|
104
|
+
# call rewind on the underlying file
|
105
|
+
context.http_response.body.instance_variable_get(:@file).rewind
|
106
|
+
else
|
107
|
+
raise NonRetryableStreamingError, error
|
108
|
+
end
|
109
|
+
end
|
89
110
|
end
|
90
111
|
end
|
91
112
|
end
|
data/lib/aws-sdk-s3/types.rb
CHANGED
@@ -10202,9 +10202,10 @@ module Aws::S3
|
|
10202
10202
|
#
|
10203
10203
|
# @!attribute [rw] noncurrent_days
|
10204
10204
|
# Specifies the number of days an object is noncurrent before Amazon
|
10205
|
-
# S3 can perform the associated action.
|
10206
|
-
#
|
10207
|
-
#
|
10205
|
+
# S3 can perform the associated action. The value must be a non-zero
|
10206
|
+
# positive integer. For information about the noncurrent days
|
10207
|
+
# calculations, see [How Amazon S3 Calculates When an Object Became
|
10208
|
+
# Noncurrent][1] in the *Amazon S3 User Guide*.
|
10208
10209
|
#
|
10209
10210
|
#
|
10210
10211
|
#
|
@@ -10497,7 +10498,10 @@ module Aws::S3
|
|
10497
10498
|
#
|
10498
10499
|
# * If an object is created by either the Multipart Upload or Part
|
10499
10500
|
# Copy operation, the ETag is not an MD5 digest, regardless of the
|
10500
|
-
# method of encryption.
|
10501
|
+
# method of encryption. If an object is larger than 16 MB, the
|
10502
|
+
# Amazon Web Services Management Console will upload or copy that
|
10503
|
+
# object as a Multipart Upload, and therefore the ETag will not be
|
10504
|
+
# an MD5 digest.
|
10501
10505
|
# @return [String]
|
10502
10506
|
#
|
10503
10507
|
# @!attribute [rw] checksum_algorithm
|
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.114.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: 2022-
|
11
|
+
date: 2022-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-kms
|