aws-sdk-s3 1.48.0 → 1.169.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1270 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
- data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
- data/lib/aws-sdk-s3/bucket.rb +959 -106
- data/lib/aws-sdk-s3/bucket_acl.rb +64 -18
- data/lib/aws-sdk-s3/bucket_cors.rb +79 -18
- data/lib/aws-sdk-s3/bucket_lifecycle.rb +66 -20
- data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +106 -21
- data/lib/aws-sdk-s3/bucket_logging.rb +68 -16
- data/lib/aws-sdk-s3/bucket_notification.rb +52 -20
- data/lib/aws-sdk-s3/bucket_policy.rb +107 -17
- data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
- data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
- data/lib/aws-sdk-s3/bucket_tagging.rb +71 -18
- data/lib/aws-sdk-s3/bucket_versioning.rb +133 -17
- data/lib/aws-sdk-s3/bucket_website.rb +78 -21
- data/lib/aws-sdk-s3/client.rb +13765 -1019
- data/lib/aws-sdk-s3/client_api.rb +1137 -197
- data/lib/aws-sdk-s3/customizations/bucket.rb +56 -37
- data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
- data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
- data/lib/aws-sdk-s3/customizations/object.rb +288 -68
- data/lib/aws-sdk-s3/customizations/object_summary.rb +10 -0
- data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
- data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
- data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
- data/lib/aws-sdk-s3/customizations.rb +27 -28
- data/lib/aws-sdk-s3/encryption/client.rb +28 -7
- data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
- data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
- data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
- data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
- data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
- data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
- data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +46 -11
- data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
- data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
- data/lib/aws-sdk-s3/encryption.rb +4 -0
- data/lib/aws-sdk-s3/encryptionV2/client.rb +570 -0
- data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +223 -0
- data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
- data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
- data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
- data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
- data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
- data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
- data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
- data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +173 -0
- data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
- data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
- data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
- data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
- data/lib/aws-sdk-s3/endpoint_provider.rb +592 -0
- data/lib/aws-sdk-s3/endpoints.rb +1392 -0
- data/lib/aws-sdk-s3/errors.rb +126 -1
- data/lib/aws-sdk-s3/event_streams.rb +8 -1
- data/lib/aws-sdk-s3/express_credentials.rb +55 -0
- data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
- data/lib/aws-sdk-s3/file_downloader.rb +176 -44
- data/lib/aws-sdk-s3/file_part.rb +11 -6
- data/lib/aws-sdk-s3/file_uploader.rb +39 -18
- data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
- data/lib/aws-sdk-s3/multipart_file_uploader.rb +82 -23
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +61 -21
- data/lib/aws-sdk-s3/multipart_upload.rb +265 -32
- data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +367 -45
- data/lib/aws-sdk-s3/object.rb +2475 -228
- data/lib/aws-sdk-s3/object_acl.rb +103 -25
- data/lib/aws-sdk-s3/object_copier.rb +9 -5
- data/lib/aws-sdk-s3/object_multipart_copier.rb +48 -22
- data/lib/aws-sdk-s3/object_summary.rb +2075 -203
- data/lib/aws-sdk-s3/object_version.rb +492 -80
- data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
- data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
- data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
- data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
- data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
- data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
- data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
- data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
- data/lib/aws-sdk-s3/plugins/express_session_auth.rb +97 -0
- data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
- data/lib/aws-sdk-s3/plugins/http_200_errors.rb +60 -15
- data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
- data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
- data/lib/aws-sdk-s3/plugins/md5s.rb +35 -30
- data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +63 -94
- data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
- data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
- data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
- data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
- data/lib/aws-sdk-s3/presigned_post.rb +160 -99
- data/lib/aws-sdk-s3/presigner.rb +138 -59
- data/lib/aws-sdk-s3/resource.rb +155 -17
- data/lib/aws-sdk-s3/types.rb +12229 -4377
- data/lib/aws-sdk-s3/waiters.rb +67 -1
- data/lib/aws-sdk-s3.rb +46 -32
- data/sig/bucket.rbs +216 -0
- data/sig/bucket_acl.rbs +78 -0
- data/sig/bucket_cors.rbs +69 -0
- data/sig/bucket_lifecycle.rbs +88 -0
- data/sig/bucket_lifecycle_configuration.rbs +115 -0
- data/sig/bucket_logging.rbs +76 -0
- data/sig/bucket_notification.rbs +114 -0
- data/sig/bucket_policy.rbs +59 -0
- data/sig/bucket_request_payment.rbs +54 -0
- data/sig/bucket_tagging.rbs +65 -0
- data/sig/bucket_versioning.rbs +77 -0
- data/sig/bucket_website.rbs +93 -0
- data/sig/client.rbs +2406 -0
- data/sig/customizations/bucket.rbs +19 -0
- data/sig/customizations/object.rbs +38 -0
- data/sig/customizations/object_summary.rbs +35 -0
- data/sig/errors.rbs +34 -0
- data/sig/multipart_upload.rbs +111 -0
- data/sig/multipart_upload_part.rbs +105 -0
- data/sig/object.rbs +443 -0
- data/sig/object_acl.rbs +86 -0
- data/sig/object_summary.rbs +335 -0
- data/sig/object_version.rbs +137 -0
- data/sig/resource.rbs +132 -0
- data/sig/types.rbs +2596 -0
- data/sig/waiters.rbs +95 -0
- metadata +74 -15
data/lib/aws-sdk-s3/bucket.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
8
10
|
module Aws::S3
|
11
|
+
|
9
12
|
class Bucket
|
10
13
|
|
11
14
|
extend Aws::Deprecations
|
@@ -21,6 +24,7 @@ module Aws::S3
|
|
21
24
|
@name = extract_name(args, options)
|
22
25
|
@data = options.delete(:data)
|
23
26
|
@client = options.delete(:client) || Client.new(options)
|
27
|
+
@waiter_block_warned = false
|
24
28
|
end
|
25
29
|
|
26
30
|
# @!group Read-Only Attributes
|
@@ -30,12 +34,21 @@ module Aws::S3
|
|
30
34
|
@name
|
31
35
|
end
|
32
36
|
|
33
|
-
# Date the bucket was created.
|
37
|
+
# Date the bucket was created. This date can change when making changes
|
38
|
+
# to your bucket, such as editing its bucket policy.
|
34
39
|
# @return [Time]
|
35
40
|
def creation_date
|
36
41
|
data[:creation_date]
|
37
42
|
end
|
38
43
|
|
44
|
+
# `BucketRegion` indicates the Amazon Web Services region where the
|
45
|
+
# bucket is located. If the request contains at least one valid
|
46
|
+
# parameter, it is included in the response.
|
47
|
+
# @return [String]
|
48
|
+
def bucket_region
|
49
|
+
data[:bucket_region]
|
50
|
+
end
|
51
|
+
|
39
52
|
# @!endgroup
|
40
53
|
|
41
54
|
# @return [Client]
|
@@ -90,7 +103,9 @@ module Aws::S3
|
|
90
103
|
options, params = separate_params_and_options(options)
|
91
104
|
waiter = Waiters::BucketExists.new(options)
|
92
105
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
93
|
-
|
106
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
107
|
+
waiter.wait(params.merge(bucket: @name))
|
108
|
+
end
|
94
109
|
Bucket.new({
|
95
110
|
name: @name,
|
96
111
|
client: @client
|
@@ -107,7 +122,9 @@ module Aws::S3
|
|
107
122
|
options, params = separate_params_and_options(options)
|
108
123
|
waiter = Waiters::BucketNotExists.new(options)
|
109
124
|
yield_waiter_and_warn(waiter, &block) if block_given?
|
110
|
-
|
125
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
126
|
+
waiter.wait(params.merge(bucket: @name))
|
127
|
+
end
|
111
128
|
Bucket.new({
|
112
129
|
name: @name,
|
113
130
|
client: @client
|
@@ -119,7 +136,8 @@ module Aws::S3
|
|
119
136
|
# Waiter polls an API operation until a resource enters a desired
|
120
137
|
# state.
|
121
138
|
#
|
122
|
-
# @note The waiting operation is performed on a copy. The original resource
|
139
|
+
# @note The waiting operation is performed on a copy. The original resource
|
140
|
+
# remains unchanged.
|
123
141
|
#
|
124
142
|
# ## Basic Usage
|
125
143
|
#
|
@@ -132,13 +150,15 @@ module Aws::S3
|
|
132
150
|
#
|
133
151
|
# ## Example
|
134
152
|
#
|
135
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
153
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
154
|
+
# instance.state.name == 'running'
|
155
|
+
# end
|
136
156
|
#
|
137
157
|
# ## Configuration
|
138
158
|
#
|
139
159
|
# You can configure the maximum number of polling attempts, and the
|
140
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
141
|
-
# by passing a block to {#wait_until}:
|
160
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
161
|
+
# set by passing a block to {#wait_until}:
|
142
162
|
#
|
143
163
|
# # poll for ~25 seconds
|
144
164
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -169,17 +189,16 @@ module Aws::S3
|
|
169
189
|
# # resource did not enter the desired state in time
|
170
190
|
# end
|
171
191
|
#
|
192
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
172
193
|
#
|
173
|
-
# @
|
174
|
-
#
|
175
|
-
#
|
176
|
-
# because the waiter has entered a state that it will not transition
|
177
|
-
# out of, preventing success.
|
194
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
195
|
+
# terminates because the waiter has entered a state that it will not
|
196
|
+
# transition out of, preventing success.
|
178
197
|
#
|
179
198
|
# yet successful.
|
180
199
|
#
|
181
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
182
|
-
# while polling for a resource that is not expected.
|
200
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
201
|
+
# encountered while polling for a resource that is not expected.
|
183
202
|
#
|
184
203
|
# @raise [NotImplementedError] Raised when the resource does not
|
185
204
|
#
|
@@ -206,7 +225,9 @@ module Aws::S3
|
|
206
225
|
:retry
|
207
226
|
end
|
208
227
|
end
|
209
|
-
Aws::
|
228
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
229
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
230
|
+
end
|
210
231
|
end
|
211
232
|
|
212
233
|
# @!group Actions
|
@@ -216,7 +237,15 @@ module Aws::S3
|
|
216
237
|
# bucket.create({
|
217
238
|
# acl: "private", # accepts private, public-read, public-read-write, authenticated-read
|
218
239
|
# create_bucket_configuration: {
|
219
|
-
# location_constraint: "
|
240
|
+
# location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-south-2, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-south-2, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
|
241
|
+
# location: {
|
242
|
+
# type: "AvailabilityZone", # accepts AvailabilityZone
|
243
|
+
# name: "LocationNameAsString",
|
244
|
+
# },
|
245
|
+
# bucket: {
|
246
|
+
# data_redundancy: "SingleAvailabilityZone", # accepts SingleAvailabilityZone
|
247
|
+
# type: "Directory", # accepts Directory
|
248
|
+
# },
|
220
249
|
# },
|
221
250
|
# grant_full_control: "GrantFullControl",
|
222
251
|
# grant_read: "GrantRead",
|
@@ -224,41 +253,123 @@ module Aws::S3
|
|
224
253
|
# grant_write: "GrantWrite",
|
225
254
|
# grant_write_acp: "GrantWriteACP",
|
226
255
|
# object_lock_enabled_for_bucket: false,
|
256
|
+
# object_ownership: "BucketOwnerPreferred", # accepts BucketOwnerPreferred, ObjectWriter, BucketOwnerEnforced
|
227
257
|
# })
|
228
258
|
# @param [Hash] options ({})
|
229
259
|
# @option options [String] :acl
|
230
260
|
# The canned ACL to apply to the bucket.
|
261
|
+
#
|
262
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
263
|
+
#
|
264
|
+
# </note>
|
231
265
|
# @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
|
266
|
+
# The configuration information for the bucket.
|
232
267
|
# @option options [String] :grant_full_control
|
233
268
|
# Allows grantee the read, write, read ACP, and write ACP permissions on
|
234
269
|
# the bucket.
|
270
|
+
#
|
271
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
272
|
+
#
|
273
|
+
# </note>
|
235
274
|
# @option options [String] :grant_read
|
236
275
|
# Allows grantee to list the objects in the bucket.
|
276
|
+
#
|
277
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
278
|
+
#
|
279
|
+
# </note>
|
237
280
|
# @option options [String] :grant_read_acp
|
238
281
|
# Allows grantee to read the bucket ACL.
|
282
|
+
#
|
283
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
284
|
+
#
|
285
|
+
# </note>
|
239
286
|
# @option options [String] :grant_write
|
240
|
-
# Allows grantee to create
|
241
|
-
#
|
287
|
+
# Allows grantee to create new objects in the bucket.
|
288
|
+
#
|
289
|
+
# For the bucket and object owners of existing objects, also allows
|
290
|
+
# deletions and overwrites of those objects.
|
291
|
+
#
|
292
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
293
|
+
#
|
294
|
+
# </note>
|
242
295
|
# @option options [String] :grant_write_acp
|
243
296
|
# Allows grantee to write the ACL for the applicable bucket.
|
297
|
+
#
|
298
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
299
|
+
#
|
300
|
+
# </note>
|
244
301
|
# @option options [Boolean] :object_lock_enabled_for_bucket
|
245
|
-
# Specifies whether you want
|
246
|
-
#
|
302
|
+
# Specifies whether you want S3 Object Lock to be enabled for the new
|
303
|
+
# bucket.
|
304
|
+
#
|
305
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
306
|
+
#
|
307
|
+
# </note>
|
308
|
+
# @option options [String] :object_ownership
|
309
|
+
# The container element for object ownership for a bucket's ownership
|
310
|
+
# controls.
|
311
|
+
#
|
312
|
+
# `BucketOwnerPreferred` - Objects uploaded to the bucket change
|
313
|
+
# ownership to the bucket owner if the objects are uploaded with the
|
314
|
+
# `bucket-owner-full-control` canned ACL.
|
315
|
+
#
|
316
|
+
# `ObjectWriter` - The uploading account will own the object if the
|
317
|
+
# object is uploaded with the `bucket-owner-full-control` canned ACL.
|
318
|
+
#
|
319
|
+
# `BucketOwnerEnforced` - Access control lists (ACLs) are disabled and
|
320
|
+
# no longer affect permissions. The bucket owner automatically owns and
|
321
|
+
# has full control over every object in the bucket. The bucket only
|
322
|
+
# accepts PUT requests that don't specify an ACL or specify bucket
|
323
|
+
# owner full control ACLs (such as the predefined
|
324
|
+
# `bucket-owner-full-control` canned ACL or a custom ACL in XML format
|
325
|
+
# that grants the same permissions).
|
326
|
+
#
|
327
|
+
# By default, `ObjectOwnership` is set to `BucketOwnerEnforced` and ACLs
|
328
|
+
# are disabled. We recommend keeping ACLs disabled, except in uncommon
|
329
|
+
# use cases where you must control access for each object individually.
|
330
|
+
# For more information about S3 Object Ownership, see [Controlling
|
331
|
+
# ownership of objects and disabling ACLs for your bucket][1] in the
|
332
|
+
# *Amazon S3 User Guide*.
|
333
|
+
#
|
334
|
+
# <note markdown="1"> This functionality is not supported for directory buckets. Directory
|
335
|
+
# buckets use the bucket owner enforced setting for S3 Object Ownership.
|
336
|
+
#
|
337
|
+
# </note>
|
338
|
+
#
|
339
|
+
#
|
340
|
+
#
|
341
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
|
247
342
|
# @return [Types::CreateBucketOutput]
|
248
343
|
def create(options = {})
|
249
344
|
options = options.merge(bucket: @name)
|
250
|
-
resp =
|
345
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
346
|
+
@client.create_bucket(options)
|
347
|
+
end
|
251
348
|
resp.data
|
252
349
|
end
|
253
350
|
|
254
351
|
# @example Request syntax with placeholder values
|
255
352
|
#
|
256
|
-
# bucket.delete(
|
353
|
+
# bucket.delete({
|
354
|
+
# expected_bucket_owner: "AccountId",
|
355
|
+
# })
|
257
356
|
# @param [Hash] options ({})
|
357
|
+
# @option options [String] :expected_bucket_owner
|
358
|
+
# The account ID of the expected bucket owner. If the account ID that
|
359
|
+
# you provide does not match the actual owner of the bucket, the request
|
360
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
361
|
+
#
|
362
|
+
# <note markdown="1"> For directory buckets, this header is not supported in this API
|
363
|
+
# operation. If you specify this header, the request fails with the HTTP
|
364
|
+
# status code `501 Not Implemented`.
|
365
|
+
#
|
366
|
+
# </note>
|
258
367
|
# @return [EmptyStructure]
|
259
368
|
def delete(options = {})
|
260
369
|
options = options.merge(bucket: @name)
|
261
|
-
resp =
|
370
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
371
|
+
@client.delete_bucket(options)
|
372
|
+
end
|
262
373
|
resp.data
|
263
374
|
end
|
264
375
|
|
@@ -277,26 +388,102 @@ module Aws::S3
|
|
277
388
|
# mfa: "MFA",
|
278
389
|
# request_payer: "requester", # accepts requester
|
279
390
|
# bypass_governance_retention: false,
|
391
|
+
# expected_bucket_owner: "AccountId",
|
392
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
280
393
|
# })
|
281
394
|
# @param [Hash] options ({})
|
282
395
|
# @option options [required, Types::Delete] :delete
|
396
|
+
# Container for the request.
|
283
397
|
# @option options [String] :mfa
|
284
398
|
# The concatenation of the authentication device's serial number, a
|
285
399
|
# space, and the value that is displayed on your authentication device.
|
400
|
+
# Required to permanently delete a versioned object if versioning is
|
401
|
+
# configured with MFA delete enabled.
|
402
|
+
#
|
403
|
+
# When performing the `DeleteObjects` operation on an MFA delete enabled
|
404
|
+
# bucket, which attempts to delete the specified versioned objects, you
|
405
|
+
# must include an MFA token. If you don't provide an MFA token, the
|
406
|
+
# entire request will fail, even if there are non-versioned objects that
|
407
|
+
# you are trying to delete. If you provide an invalid token, whether
|
408
|
+
# there are versioned object keys in the request or not, the entire
|
409
|
+
# Multi-Object Delete request will fail. For information about MFA
|
410
|
+
# Delete, see [ MFA Delete][1] in the *Amazon S3 User Guide*.
|
411
|
+
#
|
412
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
413
|
+
#
|
414
|
+
# </note>
|
415
|
+
#
|
416
|
+
#
|
417
|
+
#
|
418
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete
|
286
419
|
# @option options [String] :request_payer
|
287
|
-
# Confirms that the requester knows that
|
288
|
-
#
|
289
|
-
# requests.
|
290
|
-
#
|
291
|
-
#
|
420
|
+
# Confirms that the requester knows that they will be charged for the
|
421
|
+
# request. Bucket owners need not specify this parameter in their
|
422
|
+
# requests. If either the source or destination S3 bucket has Requester
|
423
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
424
|
+
# the object. For information about downloading objects from Requester
|
425
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
426
|
+
# in the *Amazon S3 User Guide*.
|
427
|
+
#
|
428
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
429
|
+
#
|
430
|
+
# </note>
|
431
|
+
#
|
432
|
+
#
|
433
|
+
#
|
434
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
292
435
|
# @option options [Boolean] :bypass_governance_retention
|
293
436
|
# Specifies whether you want to delete this object even if it has a
|
294
|
-
# Governance-type
|
295
|
-
#
|
437
|
+
# Governance-type Object Lock in place. To use this header, you must
|
438
|
+
# have the `s3:BypassGovernanceRetention` permission.
|
439
|
+
#
|
440
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
441
|
+
#
|
442
|
+
# </note>
|
443
|
+
# @option options [String] :expected_bucket_owner
|
444
|
+
# The account ID of the expected bucket owner. If the account ID that
|
445
|
+
# you provide does not match the actual owner of the bucket, the request
|
446
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
447
|
+
# @option options [String] :checksum_algorithm
|
448
|
+
# Indicates the algorithm used to create the checksum for the object
|
449
|
+
# when you use the SDK. This header will not provide any additional
|
450
|
+
# functionality if you don't use the SDK. When you send this header,
|
451
|
+
# there must be a corresponding `x-amz-checksum-algorithm ` or
|
452
|
+
# `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
|
453
|
+
# with the HTTP status code `400 Bad Request`.
|
454
|
+
#
|
455
|
+
# For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
|
456
|
+
# the supported algorithm from the following list:
|
457
|
+
#
|
458
|
+
# * `CRC32`
|
459
|
+
#
|
460
|
+
# * `CRC32C`
|
461
|
+
#
|
462
|
+
# * `SHA1`
|
463
|
+
#
|
464
|
+
# * `SHA256`
|
465
|
+
#
|
466
|
+
# For more information, see [Checking object integrity][1] in the
|
467
|
+
# *Amazon S3 User Guide*.
|
468
|
+
#
|
469
|
+
# If the individual checksum value you provide through
|
470
|
+
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
471
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any
|
472
|
+
# provided `ChecksumAlgorithm` parameter and uses the checksum algorithm
|
473
|
+
# that matches the provided value in `x-amz-checksum-algorithm `.
|
474
|
+
#
|
475
|
+
# If you provide an individual checksum, Amazon S3 ignores any provided
|
476
|
+
# `ChecksumAlgorithm` parameter.
|
477
|
+
#
|
478
|
+
#
|
479
|
+
#
|
480
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
296
481
|
# @return [Types::DeleteObjectsOutput]
|
297
482
|
def delete_objects(options = {})
|
298
483
|
options = options.merge(bucket: @name)
|
299
|
-
resp =
|
484
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
485
|
+
@client.delete_objects(options)
|
486
|
+
end
|
300
487
|
resp.data
|
301
488
|
end
|
302
489
|
|
@@ -312,7 +499,13 @@ module Aws::S3
|
|
312
499
|
# content_length: 1,
|
313
500
|
# content_md5: "ContentMD5",
|
314
501
|
# content_type: "ContentType",
|
502
|
+
# checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
|
503
|
+
# checksum_crc32: "ChecksumCRC32",
|
504
|
+
# checksum_crc32c: "ChecksumCRC32C",
|
505
|
+
# checksum_sha1: "ChecksumSHA1",
|
506
|
+
# checksum_sha256: "ChecksumSHA256",
|
315
507
|
# expires: Time.now,
|
508
|
+
# if_none_match: "IfNoneMatch",
|
316
509
|
# grant_full_control: "GrantFullControl",
|
317
510
|
# grant_read: "GrantRead",
|
318
511
|
# grant_read_acp: "GrantReadACP",
|
@@ -321,110 +514,551 @@ module Aws::S3
|
|
321
514
|
# metadata: {
|
322
515
|
# "MetadataKey" => "MetadataValue",
|
323
516
|
# },
|
324
|
-
# server_side_encryption: "AES256", # accepts AES256, aws:kms
|
325
|
-
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE
|
517
|
+
# server_side_encryption: "AES256", # accepts AES256, aws:kms, aws:kms:dsse
|
518
|
+
# storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE
|
326
519
|
# website_redirect_location: "WebsiteRedirectLocation",
|
327
520
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
328
521
|
# sse_customer_key: "SSECustomerKey",
|
329
522
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
330
523
|
# ssekms_key_id: "SSEKMSKeyId",
|
331
524
|
# ssekms_encryption_context: "SSEKMSEncryptionContext",
|
525
|
+
# bucket_key_enabled: false,
|
332
526
|
# request_payer: "requester", # accepts requester
|
333
527
|
# tagging: "TaggingHeader",
|
334
528
|
# object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
|
335
529
|
# object_lock_retain_until_date: Time.now,
|
336
530
|
# object_lock_legal_hold_status: "ON", # accepts ON, OFF
|
531
|
+
# expected_bucket_owner: "AccountId",
|
337
532
|
# })
|
338
533
|
# @param [Hash] options ({})
|
339
534
|
# @option options [String] :acl
|
340
|
-
# The canned ACL to apply to the object.
|
341
|
-
#
|
535
|
+
# The canned ACL to apply to the object. For more information, see
|
536
|
+
# [Canned ACL][1] in the *Amazon S3 User Guide*.
|
537
|
+
#
|
538
|
+
# When adding a new object, you can use headers to grant ACL-based
|
539
|
+
# permissions to individual Amazon Web Services accounts or to
|
540
|
+
# predefined groups defined by Amazon S3. These permissions are then
|
541
|
+
# added to the ACL on the object. By default, all objects are private.
|
542
|
+
# Only the owner has full access control. For more information, see
|
543
|
+
# [Access Control List (ACL) Overview][2] and [Managing ACLs Using the
|
544
|
+
# REST API][3] in the *Amazon S3 User Guide*.
|
545
|
+
#
|
546
|
+
# If the bucket that you're uploading objects to uses the bucket owner
|
547
|
+
# enforced setting for S3 Object Ownership, ACLs are disabled and no
|
548
|
+
# longer affect permissions. Buckets that use this setting only accept
|
549
|
+
# PUT requests that don't specify an ACL or PUT requests that specify
|
550
|
+
# bucket owner full control ACLs, such as the
|
551
|
+
# `bucket-owner-full-control` canned ACL or an equivalent form of this
|
552
|
+
# ACL expressed in the XML format. PUT requests that contain other ACLs
|
553
|
+
# (for example, custom grants to certain Amazon Web Services accounts)
|
554
|
+
# fail and return a `400` error with the error code
|
555
|
+
# `AccessControlListNotSupported`. For more information, see [
|
556
|
+
# Controlling ownership of objects and disabling ACLs][4] in the *Amazon
|
557
|
+
# S3 User Guide*.
|
558
|
+
#
|
559
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
560
|
+
#
|
561
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
562
|
+
#
|
563
|
+
# </note>
|
564
|
+
#
|
565
|
+
#
|
566
|
+
#
|
567
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL
|
568
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
|
569
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html
|
570
|
+
# [4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
|
571
|
+
# @option options [String, StringIO, File] :body
|
342
572
|
# Object data.
|
343
573
|
# @option options [String] :cache_control
|
344
|
-
#
|
574
|
+
# Can be used to specify caching behavior along the request/reply chain.
|
575
|
+
# For more information, see
|
576
|
+
# [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9][1].
|
577
|
+
#
|
578
|
+
#
|
579
|
+
#
|
580
|
+
# [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
|
345
581
|
# @option options [String] :content_disposition
|
346
|
-
# Specifies presentational information for the object.
|
582
|
+
# Specifies presentational information for the object. For more
|
583
|
+
# information, see
|
584
|
+
# [https://www.rfc-editor.org/rfc/rfc6266#section-4][1].
|
585
|
+
#
|
586
|
+
#
|
587
|
+
#
|
588
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc6266#section-4
|
347
589
|
# @option options [String] :content_encoding
|
348
590
|
# Specifies what content encodings have been applied to the object and
|
349
591
|
# thus what decoding mechanisms must be applied to obtain the media-type
|
350
|
-
# referenced by the Content-Type header field.
|
592
|
+
# referenced by the Content-Type header field. For more information, see
|
593
|
+
# [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding][1].
|
594
|
+
#
|
595
|
+
#
|
596
|
+
#
|
597
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding
|
351
598
|
# @option options [String] :content_language
|
352
599
|
# The language the content is in.
|
353
600
|
# @option options [Integer] :content_length
|
354
601
|
# Size of the body in bytes. This parameter is useful when the size of
|
355
|
-
# the body cannot be determined automatically.
|
602
|
+
# the body cannot be determined automatically. For more information, see
|
603
|
+
# [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length][1].
|
604
|
+
#
|
605
|
+
#
|
606
|
+
#
|
607
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
|
356
608
|
# @option options [String] :content_md5
|
357
|
-
# The base64-encoded 128-bit MD5 digest of the
|
358
|
-
#
|
359
|
-
#
|
609
|
+
# The base64-encoded 128-bit MD5 digest of the message (without the
|
610
|
+
# headers) according to RFC 1864. This header can be used as a message
|
611
|
+
# integrity check to verify that the data is the same data that was
|
612
|
+
# originally sent. Although it is optional, we recommend using the
|
613
|
+
# Content-MD5 mechanism as an end-to-end integrity check. For more
|
614
|
+
# information about REST request authentication, see [REST
|
615
|
+
# Authentication][1].
|
616
|
+
#
|
617
|
+
# <note markdown="1"> The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required
|
618
|
+
# for any request to upload an object with a retention period configured
|
619
|
+
# using Amazon S3 Object Lock. For more information, see [Uploading
|
620
|
+
# objects to an Object Lock enabled bucket ][2] in the *Amazon S3 User
|
621
|
+
# Guide*.
|
622
|
+
#
|
623
|
+
# </note>
|
624
|
+
#
|
625
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
626
|
+
#
|
627
|
+
# </note>
|
628
|
+
#
|
629
|
+
#
|
630
|
+
#
|
631
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
|
632
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
|
360
633
|
# @option options [String] :content_type
|
361
|
-
# A standard MIME type describing the format of the
|
634
|
+
# A standard MIME type describing the format of the contents. For more
|
635
|
+
# information, see
|
636
|
+
# [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type][1].
|
637
|
+
#
|
638
|
+
#
|
639
|
+
#
|
640
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type
|
641
|
+
# @option options [String] :checksum_algorithm
|
642
|
+
# Indicates the algorithm used to create the checksum for the object
|
643
|
+
# when you use the SDK. This header will not provide any additional
|
644
|
+
# functionality if you don't use the SDK. When you send this header,
|
645
|
+
# there must be a corresponding `x-amz-checksum-algorithm ` or
|
646
|
+
# `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
|
647
|
+
# with the HTTP status code `400 Bad Request`.
|
648
|
+
#
|
649
|
+
# For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
|
650
|
+
# the supported algorithm from the following list:
|
651
|
+
#
|
652
|
+
# * `CRC32`
|
653
|
+
#
|
654
|
+
# * `CRC32C`
|
655
|
+
#
|
656
|
+
# * `SHA1`
|
657
|
+
#
|
658
|
+
# * `SHA256`
|
659
|
+
#
|
660
|
+
# For more information, see [Checking object integrity][1] in the
|
661
|
+
# *Amazon S3 User Guide*.
|
662
|
+
#
|
663
|
+
# If the individual checksum value you provide through
|
664
|
+
# `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
|
665
|
+
# set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any
|
666
|
+
# provided `ChecksumAlgorithm` parameter and uses the checksum algorithm
|
667
|
+
# that matches the provided value in `x-amz-checksum-algorithm `.
|
668
|
+
#
|
669
|
+
# <note markdown="1"> The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required
|
670
|
+
# for any request to upload an object with a retention period configured
|
671
|
+
# using Amazon S3 Object Lock. For more information, see [Uploading
|
672
|
+
# objects to an Object Lock enabled bucket ][2] in the *Amazon S3 User
|
673
|
+
# Guide*.
|
674
|
+
#
|
675
|
+
# </note>
|
676
|
+
#
|
677
|
+
# For directory buckets, when you use Amazon Web Services SDKs, `CRC32`
|
678
|
+
# is the default checksum algorithm that's used for performance.
|
679
|
+
#
|
680
|
+
#
|
681
|
+
#
|
682
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
683
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
|
684
|
+
# @option options [String] :checksum_crc32
|
685
|
+
# This header can be used as a data integrity check to verify that the
|
686
|
+
# data received is the same data that was originally sent. This header
|
687
|
+
# specifies the base64-encoded, 32-bit CRC-32 checksum of the object.
|
688
|
+
# For more information, see [Checking object integrity][1] in the
|
689
|
+
# *Amazon S3 User Guide*.
|
690
|
+
#
|
691
|
+
#
|
692
|
+
#
|
693
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
694
|
+
# @option options [String] :checksum_crc32c
|
695
|
+
# This header can be used as a data integrity check to verify that the
|
696
|
+
# data received is the same data that was originally sent. This header
|
697
|
+
# specifies the base64-encoded, 32-bit CRC-32C checksum of the object.
|
698
|
+
# For more information, see [Checking object integrity][1] in the
|
699
|
+
# *Amazon S3 User Guide*.
|
700
|
+
#
|
701
|
+
#
|
702
|
+
#
|
703
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
704
|
+
# @option options [String] :checksum_sha1
|
705
|
+
# This header can be used as a data integrity check to verify that the
|
706
|
+
# data received is the same data that was originally sent. This header
|
707
|
+
# specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
|
708
|
+
# more information, see [Checking object integrity][1] in the *Amazon S3
|
709
|
+
# User Guide*.
|
710
|
+
#
|
711
|
+
#
|
712
|
+
#
|
713
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
714
|
+
# @option options [String] :checksum_sha256
|
715
|
+
# This header can be used as a data integrity check to verify that the
|
716
|
+
# data received is the same data that was originally sent. This header
|
717
|
+
# specifies the base64-encoded, 256-bit SHA-256 digest of the object.
|
718
|
+
# For more information, see [Checking object integrity][1] in the
|
719
|
+
# *Amazon S3 User Guide*.
|
720
|
+
#
|
721
|
+
#
|
722
|
+
#
|
723
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
|
362
724
|
# @option options [Time,DateTime,Date,Integer,String] :expires
|
363
|
-
# The date and time at which the object is no longer cacheable.
|
725
|
+
# The date and time at which the object is no longer cacheable. For more
|
726
|
+
# information, see
|
727
|
+
# [https://www.rfc-editor.org/rfc/rfc7234#section-5.3][1].
|
728
|
+
#
|
729
|
+
#
|
730
|
+
#
|
731
|
+
# [1]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3
|
732
|
+
# @option options [String] :if_none_match
|
733
|
+
# Uploads the object only if the object key name does not already exist
|
734
|
+
# in the bucket specified. Otherwise, Amazon S3 returns a `412
|
735
|
+
# Precondition Failed` error.
|
736
|
+
#
|
737
|
+
# If a conflicting operation occurs during the upload S3 returns a `409
|
738
|
+
# ConditionalRequestConflict` response. On a 409 failure you should
|
739
|
+
# retry the upload.
|
740
|
+
#
|
741
|
+
# Expects the '*' (asterisk) character.
|
742
|
+
#
|
743
|
+
# For more information about conditional requests, see [RFC 7232][1], or
|
744
|
+
# [Conditional requests][2] in the *Amazon S3 User Guide*.
|
745
|
+
#
|
746
|
+
#
|
747
|
+
#
|
748
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
749
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
|
364
750
|
# @option options [String] :grant_full_control
|
365
751
|
# Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
|
366
752
|
# object.
|
753
|
+
#
|
754
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
755
|
+
#
|
756
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
757
|
+
#
|
758
|
+
# </note>
|
367
759
|
# @option options [String] :grant_read
|
368
760
|
# Allows grantee to read the object data and its metadata.
|
761
|
+
#
|
762
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
763
|
+
#
|
764
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
765
|
+
#
|
766
|
+
# </note>
|
369
767
|
# @option options [String] :grant_read_acp
|
370
768
|
# Allows grantee to read the object ACL.
|
769
|
+
#
|
770
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
771
|
+
#
|
772
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
773
|
+
#
|
774
|
+
# </note>
|
371
775
|
# @option options [String] :grant_write_acp
|
372
776
|
# Allows grantee to write the ACL for the applicable object.
|
777
|
+
#
|
778
|
+
# <note markdown="1"> * This functionality is not supported for directory buckets.
|
779
|
+
#
|
780
|
+
# * This functionality is not supported for Amazon S3 on Outposts.
|
781
|
+
#
|
782
|
+
# </note>
|
373
783
|
# @option options [required, String] :key
|
374
|
-
# Object key for which the PUT
|
784
|
+
# Object key for which the PUT action was initiated.
|
375
785
|
# @option options [Hash<String,String>] :metadata
|
376
786
|
# A map of metadata to store with the object in S3.
|
377
787
|
# @option options [String] :server_side_encryption
|
378
|
-
# The
|
379
|
-
# S3 (
|
788
|
+
# The server-side encryption algorithm that was used when you store this
|
789
|
+
# object in Amazon S3 (for example, `AES256`, `aws:kms`,
|
790
|
+
# `aws:kms:dsse`).
|
791
|
+
#
|
792
|
+
# * <b>General purpose buckets </b> - You have four mutually exclusive
|
793
|
+
# options to protect data using server-side encryption in Amazon S3,
|
794
|
+
# depending on how you choose to manage the encryption keys.
|
795
|
+
# Specifically, the encryption key options are Amazon S3 managed keys
|
796
|
+
# (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and
|
797
|
+
# customer-provided keys (SSE-C). Amazon S3 encrypts data with
|
798
|
+
# server-side encryption by using Amazon S3 managed keys (SSE-S3) by
|
799
|
+
# default. You can optionally tell Amazon S3 to encrypt data at rest
|
800
|
+
# by using server-side encryption with other key options. For more
|
801
|
+
# information, see [Using Server-Side Encryption][1] in the *Amazon S3
|
802
|
+
# User Guide*.
|
803
|
+
#
|
804
|
+
# * <b>Directory buckets </b> - For directory buckets, there are only
|
805
|
+
# two supported options for server-side encryption: server-side
|
806
|
+
# encryption with Amazon S3 managed keys (SSE-S3) (`AES256`) and
|
807
|
+
# server-side encryption with KMS keys (SSE-KMS) (`aws:kms`). We
|
808
|
+
# recommend that the bucket's default encryption uses the desired
|
809
|
+
# encryption configuration and you don't override the bucket default
|
810
|
+
# encryption in your `CreateSession` requests or `PUT` object
|
811
|
+
# requests. Then, new objects are automatically encrypted with the
|
812
|
+
# desired encryption settings. For more information, see [Protecting
|
813
|
+
# data with server-side encryption][2] in the *Amazon S3 User Guide*.
|
814
|
+
# For more information about the encryption overriding behaviors in
|
815
|
+
# directory buckets, see [Specifying server-side encryption with KMS
|
816
|
+
# for new object uploads][3].
|
817
|
+
#
|
818
|
+
# In the Zonal endpoint API calls (except [CopyObject][4] and
|
819
|
+
# [UploadPartCopy][5]) using the REST API, the encryption request
|
820
|
+
# headers must match the encryption settings that are specified in the
|
821
|
+
# `CreateSession` request. You can't override the values of the
|
822
|
+
# encryption settings (`x-amz-server-side-encryption`,
|
823
|
+
# `x-amz-server-side-encryption-aws-kms-key-id`,
|
824
|
+
# `x-amz-server-side-encryption-context`, and
|
825
|
+
# `x-amz-server-side-encryption-bucket-key-enabled`) that are
|
826
|
+
# specified in the `CreateSession` request. You don't need to
|
827
|
+
# explicitly specify these encryption settings values in Zonal
|
828
|
+
# endpoint API calls, and Amazon S3 will use the encryption settings
|
829
|
+
# values from the `CreateSession` request to protect new objects in
|
830
|
+
# the directory bucket.
|
831
|
+
#
|
832
|
+
# <note markdown="1"> When you use the CLI or the Amazon Web Services SDKs, for
|
833
|
+
# `CreateSession`, the session token refreshes automatically to avoid
|
834
|
+
# service interruptions when a session expires. The CLI or the Amazon
|
835
|
+
# Web Services SDKs use the bucket's default encryption configuration
|
836
|
+
# for the `CreateSession` request. It's not supported to override the
|
837
|
+
# encryption settings values in the `CreateSession` request. So in the
|
838
|
+
# Zonal endpoint API calls (except [CopyObject][4] and
|
839
|
+
# [UploadPartCopy][5]), the encryption request headers must match the
|
840
|
+
# default encryption configuration of the directory bucket.
|
841
|
+
#
|
842
|
+
# </note>
|
843
|
+
#
|
844
|
+
#
|
845
|
+
#
|
846
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html
|
847
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html
|
848
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html
|
849
|
+
# [4]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
|
850
|
+
# [5]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
|
380
851
|
# @option options [String] :storage_class
|
381
|
-
#
|
852
|
+
# By default, Amazon S3 uses the STANDARD Storage Class to store newly
|
853
|
+
# created objects. The STANDARD storage class provides high durability
|
854
|
+
# and high availability. Depending on performance needs, you can specify
|
855
|
+
# a different Storage Class. For more information, see [Storage
|
856
|
+
# Classes][1] in the *Amazon S3 User Guide*.
|
857
|
+
#
|
858
|
+
# <note markdown="1"> * For directory buckets, only the S3 Express One Zone storage class is
|
859
|
+
# supported to store newly created objects.
|
860
|
+
#
|
861
|
+
# * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.
|
862
|
+
#
|
863
|
+
# </note>
|
864
|
+
#
|
865
|
+
#
|
866
|
+
#
|
867
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html
|
382
868
|
# @option options [String] :website_redirect_location
|
383
869
|
# If the bucket is configured as a website, redirects requests for this
|
384
870
|
# object to another object in the same bucket or to an external URL.
|
385
|
-
# Amazon S3 stores the value of this header in the object metadata.
|
871
|
+
# Amazon S3 stores the value of this header in the object metadata. For
|
872
|
+
# information about object metadata, see [Object Key and Metadata][1] in
|
873
|
+
# the *Amazon S3 User Guide*.
|
874
|
+
#
|
875
|
+
# In the following example, the request header sets the redirect to an
|
876
|
+
# object (anotherPage.html) in the same bucket:
|
877
|
+
#
|
878
|
+
# `x-amz-website-redirect-location: /anotherPage.html`
|
879
|
+
#
|
880
|
+
# In the following example, the request header sets the object redirect
|
881
|
+
# to another website:
|
882
|
+
#
|
883
|
+
# `x-amz-website-redirect-location: http://www.example.com/`
|
884
|
+
#
|
885
|
+
# For more information about website hosting in Amazon S3, see [Hosting
|
886
|
+
# Websites on Amazon S3][2] and [How to Configure Website Page
|
887
|
+
# Redirects][3] in the *Amazon S3 User Guide*.
|
888
|
+
#
|
889
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
890
|
+
#
|
891
|
+
# </note>
|
892
|
+
#
|
893
|
+
#
|
894
|
+
#
|
895
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
|
896
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
|
897
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
|
386
898
|
# @option options [String] :sse_customer_algorithm
|
387
|
-
# Specifies the algorithm to use
|
388
|
-
# AES256).
|
899
|
+
# Specifies the algorithm to use when encrypting the object (for
|
900
|
+
# example, `AES256`).
|
901
|
+
#
|
902
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
903
|
+
#
|
904
|
+
# </note>
|
389
905
|
# @option options [String] :sse_customer_key
|
390
906
|
# Specifies the customer-provided encryption key for Amazon S3 to use in
|
391
907
|
# encrypting data. This value is used to store the object and then it is
|
392
|
-
# discarded; Amazon does not store the encryption key. The key must
|
393
|
-
# appropriate for use with the algorithm specified in the
|
394
|
-
# x-amz-server-side
|
908
|
+
# discarded; Amazon S3 does not store the encryption key. The key must
|
909
|
+
# be appropriate for use with the algorithm specified in the
|
910
|
+
# `x-amz-server-side-encryption-customer-algorithm` header.
|
911
|
+
#
|
912
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
913
|
+
#
|
914
|
+
# </note>
|
395
915
|
# @option options [String] :sse_customer_key_md5
|
396
916
|
# Specifies the 128-bit MD5 digest of the encryption key according to
|
397
917
|
# RFC 1321. Amazon S3 uses this header for a message integrity check to
|
398
|
-
# ensure the encryption key was transmitted without error.
|
918
|
+
# ensure that the encryption key was transmitted without error.
|
919
|
+
#
|
920
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
921
|
+
#
|
922
|
+
# </note>
|
399
923
|
# @option options [String] :ssekms_key_id
|
400
|
-
# Specifies the
|
401
|
-
#
|
402
|
-
#
|
403
|
-
#
|
404
|
-
#
|
924
|
+
# Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for
|
925
|
+
# object encryption. If the KMS key doesn't exist in the same account
|
926
|
+
# that's issuing the command, you must use the full Key ARN not the Key
|
927
|
+
# ID.
|
928
|
+
#
|
929
|
+
# **General purpose buckets** - If you specify
|
930
|
+
# `x-amz-server-side-encryption` with `aws:kms` or `aws:kms:dsse`, this
|
931
|
+
# header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key
|
932
|
+
# to use. If you specify `x-amz-server-side-encryption:aws:kms` or
|
933
|
+
# `x-amz-server-side-encryption:aws:kms:dsse`, but do not provide
|
934
|
+
# `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
|
935
|
+
# Amazon Web Services managed key (`aws/s3`) to protect the data.
|
936
|
+
#
|
937
|
+
# **Directory buckets** - If you specify `x-amz-server-side-encryption`
|
938
|
+
# with `aws:kms`, the ` x-amz-server-side-encryption-aws-kms-key-id`
|
939
|
+
# header is implicitly assigned the ID of the KMS symmetric encryption
|
940
|
+
# customer managed key that's configured for your directory bucket's
|
941
|
+
# default encryption setting. If you want to specify the `
|
942
|
+
# x-amz-server-side-encryption-aws-kms-key-id` header explicitly, you
|
943
|
+
# can only specify it with the ID (Key ID or Key ARN) of the KMS
|
944
|
+
# customer managed key that's configured for your directory bucket's
|
945
|
+
# default encryption setting. Otherwise, you get an HTTP `400 Bad
|
946
|
+
# Request` error. Only use the key ID or key ARN. The key alias format
|
947
|
+
# of the KMS key isn't supported. Your SSE-KMS configuration can only
|
948
|
+
# support 1 [customer managed key][1] per directory bucket for the
|
949
|
+
# lifetime of the bucket. The [Amazon Web Services managed key][2]
|
950
|
+
# (`aws/s3`) isn't supported.
|
951
|
+
#
|
952
|
+
#
|
953
|
+
#
|
954
|
+
# [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
|
955
|
+
# [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
|
405
956
|
# @option options [String] :ssekms_encryption_context
|
406
|
-
# Specifies the
|
407
|
-
#
|
408
|
-
#
|
957
|
+
# Specifies the Amazon Web Services KMS Encryption Context as an
|
958
|
+
# additional encryption context to use for object encryption. The value
|
959
|
+
# of this header is a Base64-encoded string of a UTF-8 encoded JSON,
|
960
|
+
# which contains the encryption context as key-value pairs. This value
|
961
|
+
# is stored as object metadata and automatically gets passed on to
|
962
|
+
# Amazon Web Services KMS for future `GetObject` operations on this
|
963
|
+
# object.
|
964
|
+
#
|
965
|
+
# **General purpose buckets** - This value must be explicitly added
|
966
|
+
# during `CopyObject` operations if you want an additional encryption
|
967
|
+
# context for your object. For more information, see [Encryption
|
968
|
+
# context][1] in the *Amazon S3 User Guide*.
|
969
|
+
#
|
970
|
+
# **Directory buckets** - You can optionally provide an explicit
|
971
|
+
# encryption context value. The value must match the default encryption
|
972
|
+
# context - the bucket Amazon Resource Name (ARN). An additional
|
973
|
+
# encryption context value is not supported.
|
974
|
+
#
|
975
|
+
#
|
976
|
+
#
|
977
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context
|
978
|
+
# @option options [Boolean] :bucket_key_enabled
|
979
|
+
# Specifies whether Amazon S3 should use an S3 Bucket Key for object
|
980
|
+
# encryption with server-side encryption using Key Management Service
|
981
|
+
# (KMS) keys (SSE-KMS).
|
982
|
+
#
|
983
|
+
# **General purpose buckets** - Setting this header to `true` causes
|
984
|
+
# Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.
|
985
|
+
# Also, specifying this header with a PUT action doesn't affect
|
986
|
+
# bucket-level settings for S3 Bucket Key.
|
987
|
+
#
|
988
|
+
# **Directory buckets** - S3 Bucket Keys are always enabled for `GET`
|
989
|
+
# and `PUT` operations in a directory bucket and can’t be disabled. S3
|
990
|
+
# Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects
|
991
|
+
# from general purpose buckets to directory buckets, from directory
|
992
|
+
# buckets to general purpose buckets, or between directory buckets,
|
993
|
+
# through [CopyObject][1], [UploadPartCopy][2], [the Copy operation in
|
994
|
+
# Batch Operations][3], or [the import jobs][4]. In this case, Amazon S3
|
995
|
+
# makes a call to KMS every time a copy request is made for a
|
996
|
+
# KMS-encrypted object.
|
997
|
+
#
|
998
|
+
#
|
999
|
+
#
|
1000
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
|
1001
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
|
1002
|
+
# [3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops
|
1003
|
+
# [4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job
|
409
1004
|
# @option options [String] :request_payer
|
410
|
-
# Confirms that the requester knows that
|
411
|
-
#
|
412
|
-
# requests.
|
413
|
-
#
|
414
|
-
#
|
1005
|
+
# Confirms that the requester knows that they will be charged for the
|
1006
|
+
# request. Bucket owners need not specify this parameter in their
|
1007
|
+
# requests. If either the source or destination S3 bucket has Requester
|
1008
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
1009
|
+
# the object. For information about downloading objects from Requester
|
1010
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
1011
|
+
# in the *Amazon S3 User Guide*.
|
1012
|
+
#
|
1013
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1014
|
+
#
|
1015
|
+
# </note>
|
1016
|
+
#
|
1017
|
+
#
|
1018
|
+
#
|
1019
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
415
1020
|
# @option options [String] :tagging
|
416
1021
|
# The tag-set for the object. The tag-set must be encoded as URL Query
|
417
1022
|
# parameters. (For example, "Key1=Value1")
|
1023
|
+
#
|
1024
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1025
|
+
#
|
1026
|
+
# </note>
|
418
1027
|
# @option options [String] :object_lock_mode
|
419
|
-
# The
|
1028
|
+
# The Object Lock mode that you want to apply to this object.
|
1029
|
+
#
|
1030
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1031
|
+
#
|
1032
|
+
# </note>
|
420
1033
|
# @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
|
421
|
-
# The date and time when you want this object's
|
1034
|
+
# The date and time when you want this object's Object Lock to expire.
|
1035
|
+
# Must be formatted as a timestamp parameter.
|
1036
|
+
#
|
1037
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1038
|
+
#
|
1039
|
+
# </note>
|
422
1040
|
# @option options [String] :object_lock_legal_hold_status
|
423
|
-
#
|
1041
|
+
# Specifies whether a legal hold will be applied to this object. For
|
1042
|
+
# more information about S3 Object Lock, see [Object Lock][1] in the
|
1043
|
+
# *Amazon S3 User Guide*.
|
1044
|
+
#
|
1045
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1046
|
+
#
|
1047
|
+
# </note>
|
1048
|
+
#
|
1049
|
+
#
|
1050
|
+
#
|
1051
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
|
1052
|
+
# @option options [String] :expected_bucket_owner
|
1053
|
+
# The account ID of the expected bucket owner. If the account ID that
|
1054
|
+
# you provide does not match the actual owner of the bucket, the request
|
1055
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
424
1056
|
# @return [Object]
|
425
1057
|
def put_object(options = {})
|
426
1058
|
options = options.merge(bucket: @name)
|
427
|
-
|
1059
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1060
|
+
@client.put_object(options)
|
1061
|
+
end
|
428
1062
|
Object.new(
|
429
1063
|
bucket_name: @name,
|
430
1064
|
key: options[:key],
|
@@ -482,32 +1116,121 @@ module Aws::S3
|
|
482
1116
|
# key_marker: "KeyMarker",
|
483
1117
|
# prefix: "Prefix",
|
484
1118
|
# upload_id_marker: "UploadIdMarker",
|
1119
|
+
# expected_bucket_owner: "AccountId",
|
1120
|
+
# request_payer: "requester", # accepts requester
|
485
1121
|
# })
|
486
1122
|
# @param [Hash] options ({})
|
487
1123
|
# @option options [String] :delimiter
|
488
1124
|
# Character you use to group keys.
|
1125
|
+
#
|
1126
|
+
# All keys that contain the same string between the prefix, if
|
1127
|
+
# specified, and the first occurrence of the delimiter after the prefix
|
1128
|
+
# are grouped under a single result element, `CommonPrefixes`. If you
|
1129
|
+
# don't specify the prefix parameter, then the substring starts at the
|
1130
|
+
# beginning of the key. The keys that are grouped under `CommonPrefixes`
|
1131
|
+
# result element are not returned elsewhere in the response.
|
1132
|
+
#
|
1133
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, `/` is the only
|
1134
|
+
# supported delimiter.
|
1135
|
+
#
|
1136
|
+
# </note>
|
489
1137
|
# @option options [String] :encoding_type
|
490
|
-
#
|
491
|
-
#
|
492
|
-
# Unicode character
|
493
|
-
# characters, such as characters with an ASCII value from
|
494
|
-
# characters that
|
495
|
-
# parameter to request that Amazon S3 encode the keys in the
|
1138
|
+
# Encoding type used by Amazon S3 to encode the [object keys][1] in the
|
1139
|
+
# response. Responses are encoded only in UTF-8. An object key can
|
1140
|
+
# contain any Unicode character. However, the XML 1.0 parser can't
|
1141
|
+
# parse certain characters, such as characters with an ASCII value from
|
1142
|
+
# 0 to 10. For characters that aren't supported in XML 1.0, you can add
|
1143
|
+
# this parameter to request that Amazon S3 encode the keys in the
|
1144
|
+
# response. For more information about characters to avoid in object key
|
1145
|
+
# names, see [Object key naming guidelines][2].
|
1146
|
+
#
|
1147
|
+
# <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
|
1148
|
+
# in an object's key name will be percent-encoded according to UTF-8
|
1149
|
+
# code values. For example, the object `test_file(3).png` will appear as
|
1150
|
+
# `test_file%283%29.png`.
|
1151
|
+
#
|
1152
|
+
# </note>
|
1153
|
+
#
|
1154
|
+
#
|
1155
|
+
#
|
1156
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
|
1157
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
|
496
1158
|
# @option options [String] :key_marker
|
497
|
-
#
|
498
|
-
#
|
1159
|
+
# Specifies the multipart upload after which listing should begin.
|
1160
|
+
#
|
1161
|
+
# <note markdown="1"> * **General purpose buckets** - For general purpose buckets,
|
1162
|
+
# `key-marker` is an object key. Together with `upload-id-marker`,
|
1163
|
+
# this parameter specifies the multipart upload after which listing
|
1164
|
+
# should begin.
|
1165
|
+
#
|
1166
|
+
# If `upload-id-marker` is not specified, only the keys
|
1167
|
+
# lexicographically greater than the specified `key-marker` will be
|
1168
|
+
# included in the list.
|
1169
|
+
#
|
1170
|
+
# If `upload-id-marker` is specified, any multipart uploads for a key
|
1171
|
+
# equal to the `key-marker` might also be included, provided those
|
1172
|
+
# multipart uploads have upload IDs lexicographically greater than the
|
1173
|
+
# specified `upload-id-marker`.
|
1174
|
+
#
|
1175
|
+
# * **Directory buckets** - For directory buckets, `key-marker` is
|
1176
|
+
# obfuscated and isn't a real object key. The `upload-id-marker`
|
1177
|
+
# parameter isn't supported by directory buckets. To list the
|
1178
|
+
# additional multipart uploads, you only need to set the value of
|
1179
|
+
# `key-marker` to the `NextKeyMarker` value from the previous
|
1180
|
+
# response.
|
1181
|
+
#
|
1182
|
+
# In the `ListMultipartUploads` response, the multipart uploads
|
1183
|
+
# aren't sorted lexicographically based on the object keys.
|
1184
|
+
#
|
1185
|
+
# </note>
|
499
1186
|
# @option options [String] :prefix
|
500
1187
|
# Lists in-progress uploads only for those keys that begin with the
|
501
|
-
# specified prefix.
|
1188
|
+
# specified prefix. You can use prefixes to separate a bucket into
|
1189
|
+
# different grouping of keys. (You can think of using `prefix` to make
|
1190
|
+
# groups in the same way that you'd use a folder in a file system.)
|
1191
|
+
#
|
1192
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
|
1193
|
+
# in a delimiter (`/`) are supported.
|
1194
|
+
#
|
1195
|
+
# </note>
|
502
1196
|
# @option options [String] :upload_id_marker
|
503
1197
|
# Together with key-marker, specifies the multipart upload after which
|
504
1198
|
# listing should begin. If key-marker is not specified, the
|
505
|
-
# upload-id-marker parameter is ignored.
|
1199
|
+
# upload-id-marker parameter is ignored. Otherwise, any multipart
|
1200
|
+
# uploads for a key equal to the key-marker might be included in the
|
1201
|
+
# list only if they have an upload ID lexicographically greater than the
|
1202
|
+
# specified `upload-id-marker`.
|
1203
|
+
#
|
1204
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1205
|
+
#
|
1206
|
+
# </note>
|
1207
|
+
# @option options [String] :expected_bucket_owner
|
1208
|
+
# The account ID of the expected bucket owner. If the account ID that
|
1209
|
+
# you provide does not match the actual owner of the bucket, the request
|
1210
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1211
|
+
# @option options [String] :request_payer
|
1212
|
+
# Confirms that the requester knows that they will be charged for the
|
1213
|
+
# request. Bucket owners need not specify this parameter in their
|
1214
|
+
# requests. If either the source or destination S3 bucket has Requester
|
1215
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
1216
|
+
# the object. For information about downloading objects from Requester
|
1217
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
1218
|
+
# in the *Amazon S3 User Guide*.
|
1219
|
+
#
|
1220
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1221
|
+
#
|
1222
|
+
# </note>
|
1223
|
+
#
|
1224
|
+
#
|
1225
|
+
#
|
1226
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
506
1227
|
# @return [MultipartUpload::Collection]
|
507
1228
|
def multipart_uploads(options = {})
|
508
1229
|
batches = Enumerator.new do |y|
|
509
1230
|
options = options.merge(bucket: @name)
|
510
|
-
resp =
|
1231
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1232
|
+
@client.list_multipart_uploads(options)
|
1233
|
+
end
|
511
1234
|
resp.each_page do |page|
|
512
1235
|
batch = []
|
513
1236
|
page.data.uploads.each do |u|
|
@@ -551,28 +1274,80 @@ module Aws::S3
|
|
551
1274
|
# key_marker: "KeyMarker",
|
552
1275
|
# prefix: "Prefix",
|
553
1276
|
# version_id_marker: "VersionIdMarker",
|
1277
|
+
# expected_bucket_owner: "AccountId",
|
1278
|
+
# request_payer: "requester", # accepts requester
|
1279
|
+
# optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
|
554
1280
|
# })
|
555
1281
|
# @param [Hash] options ({})
|
556
1282
|
# @option options [String] :delimiter
|
557
|
-
# A delimiter is a character you
|
1283
|
+
# A delimiter is a character that you specify to group keys. All keys
|
1284
|
+
# that contain the same string between the `prefix` and the first
|
1285
|
+
# occurrence of the delimiter are grouped under a single result element
|
1286
|
+
# in `CommonPrefixes`. These groups are counted as one result against
|
1287
|
+
# the `max-keys` limitation. These keys are not returned elsewhere in
|
1288
|
+
# the response.
|
558
1289
|
# @option options [String] :encoding_type
|
559
|
-
#
|
560
|
-
#
|
561
|
-
# Unicode character
|
562
|
-
# characters, such as characters with an ASCII value from
|
563
|
-
# characters that
|
564
|
-
# parameter to request that Amazon S3 encode the keys in the
|
1290
|
+
# Encoding type used by Amazon S3 to encode the [object keys][1] in the
|
1291
|
+
# response. Responses are encoded only in UTF-8. An object key can
|
1292
|
+
# contain any Unicode character. However, the XML 1.0 parser can't
|
1293
|
+
# parse certain characters, such as characters with an ASCII value from
|
1294
|
+
# 0 to 10. For characters that aren't supported in XML 1.0, you can add
|
1295
|
+
# this parameter to request that Amazon S3 encode the keys in the
|
1296
|
+
# response. For more information about characters to avoid in object key
|
1297
|
+
# names, see [Object key naming guidelines][2].
|
1298
|
+
#
|
1299
|
+
# <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
|
1300
|
+
# in an object's key name will be percent-encoded according to UTF-8
|
1301
|
+
# code values. For example, the object `test_file(3).png` will appear as
|
1302
|
+
# `test_file%283%29.png`.
|
1303
|
+
#
|
1304
|
+
# </note>
|
1305
|
+
#
|
1306
|
+
#
|
1307
|
+
#
|
1308
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
|
1309
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
|
565
1310
|
# @option options [String] :key_marker
|
566
1311
|
# Specifies the key to start with when listing objects in a bucket.
|
567
1312
|
# @option options [String] :prefix
|
568
|
-
#
|
1313
|
+
# Use this parameter to select only those keys that begin with the
|
1314
|
+
# specified prefix. You can use prefixes to separate a bucket into
|
1315
|
+
# different groupings of keys. (You can think of using `prefix` to make
|
1316
|
+
# groups in the same way that you'd use a folder in a file system.) You
|
1317
|
+
# can use `prefix` with `delimiter` to roll up numerous objects into a
|
1318
|
+
# single result under `CommonPrefixes`.
|
569
1319
|
# @option options [String] :version_id_marker
|
570
1320
|
# Specifies the object version you want to start listing from.
|
1321
|
+
# @option options [String] :expected_bucket_owner
|
1322
|
+
# The account ID of the expected bucket owner. If the account ID that
|
1323
|
+
# you provide does not match the actual owner of the bucket, the request
|
1324
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1325
|
+
# @option options [String] :request_payer
|
1326
|
+
# Confirms that the requester knows that they will be charged for the
|
1327
|
+
# request. Bucket owners need not specify this parameter in their
|
1328
|
+
# requests. If either the source or destination S3 bucket has Requester
|
1329
|
+
# Pays enabled, the requester will pay for corresponding charges to copy
|
1330
|
+
# the object. For information about downloading objects from Requester
|
1331
|
+
# Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
|
1332
|
+
# in the *Amazon S3 User Guide*.
|
1333
|
+
#
|
1334
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1335
|
+
#
|
1336
|
+
# </note>
|
1337
|
+
#
|
1338
|
+
#
|
1339
|
+
#
|
1340
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
|
1341
|
+
# @option options [Array<String>] :optional_object_attributes
|
1342
|
+
# Specifies the optional fields that you want returned in the response.
|
1343
|
+
# Fields that you do not specify are not returned.
|
571
1344
|
# @return [ObjectVersion::Collection]
|
572
1345
|
def object_versions(options = {})
|
573
1346
|
batches = Enumerator.new do |y|
|
574
1347
|
options = options.merge(bucket: @name)
|
575
|
-
resp =
|
1348
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1349
|
+
@client.list_object_versions(options)
|
1350
|
+
end
|
576
1351
|
resp.each_page do |page|
|
577
1352
|
batch = []
|
578
1353
|
page.data.versions_delete_markers.each do |v|
|
@@ -596,29 +1371,102 @@ module Aws::S3
|
|
596
1371
|
# delimiter: "Delimiter",
|
597
1372
|
# encoding_type: "url", # accepts url
|
598
1373
|
# prefix: "Prefix",
|
1374
|
+
# fetch_owner: false,
|
1375
|
+
# start_after: "StartAfter",
|
599
1376
|
# request_payer: "requester", # accepts requester
|
1377
|
+
# expected_bucket_owner: "AccountId",
|
1378
|
+
# optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
|
600
1379
|
# })
|
601
1380
|
# @param [Hash] options ({})
|
602
1381
|
# @option options [String] :delimiter
|
603
|
-
# A delimiter is a character you use to group keys.
|
1382
|
+
# A delimiter is a character that you use to group keys.
|
1383
|
+
#
|
1384
|
+
# <note markdown="1"> * **Directory buckets** - For directory buckets, `/` is the only
|
1385
|
+
# supported delimiter.
|
1386
|
+
#
|
1387
|
+
# * <b>Directory buckets </b> - When you query `ListObjectsV2` with a
|
1388
|
+
# delimiter during in-progress multipart uploads, the `CommonPrefixes`
|
1389
|
+
# response parameter contains the prefixes that are associated with
|
1390
|
+
# the in-progress multipart uploads. For more information about
|
1391
|
+
# multipart uploads, see [Multipart Upload Overview][1] in the *Amazon
|
1392
|
+
# S3 User Guide*.
|
1393
|
+
#
|
1394
|
+
# </note>
|
1395
|
+
#
|
1396
|
+
#
|
1397
|
+
#
|
1398
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html
|
604
1399
|
# @option options [String] :encoding_type
|
605
|
-
#
|
606
|
-
#
|
607
|
-
# Unicode character
|
608
|
-
# characters, such as characters with an ASCII value from
|
609
|
-
# characters that
|
610
|
-
# parameter to request that Amazon S3 encode the keys in the
|
1400
|
+
# Encoding type used by Amazon S3 to encode the [object keys][1] in the
|
1401
|
+
# response. Responses are encoded only in UTF-8. An object key can
|
1402
|
+
# contain any Unicode character. However, the XML 1.0 parser can't
|
1403
|
+
# parse certain characters, such as characters with an ASCII value from
|
1404
|
+
# 0 to 10. For characters that aren't supported in XML 1.0, you can add
|
1405
|
+
# this parameter to request that Amazon S3 encode the keys in the
|
1406
|
+
# response. For more information about characters to avoid in object key
|
1407
|
+
# names, see [Object key naming guidelines][2].
|
1408
|
+
#
|
1409
|
+
# <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
|
1410
|
+
# in an object's key name will be percent-encoded according to UTF-8
|
1411
|
+
# code values. For example, the object `test_file(3).png` will appear as
|
1412
|
+
# `test_file%283%29.png`.
|
1413
|
+
#
|
1414
|
+
# </note>
|
1415
|
+
#
|
1416
|
+
#
|
1417
|
+
#
|
1418
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
|
1419
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
|
611
1420
|
# @option options [String] :prefix
|
612
1421
|
# Limits the response to keys that begin with the specified prefix.
|
1422
|
+
#
|
1423
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
|
1424
|
+
# in a delimiter (`/`) are supported.
|
1425
|
+
#
|
1426
|
+
# </note>
|
1427
|
+
# @option options [Boolean] :fetch_owner
|
1428
|
+
# The owner field is not present in `ListObjectsV2` by default. If you
|
1429
|
+
# want to return the owner field with each key in the result, then set
|
1430
|
+
# the `FetchOwner` field to `true`.
|
1431
|
+
#
|
1432
|
+
# <note markdown="1"> **Directory buckets** - For directory buckets, the bucket owner is
|
1433
|
+
# returned as the object owner for all objects.
|
1434
|
+
#
|
1435
|
+
# </note>
|
1436
|
+
# @option options [String] :start_after
|
1437
|
+
# StartAfter is where you want Amazon S3 to start listing from. Amazon
|
1438
|
+
# S3 starts listing after this specified key. StartAfter can be any key
|
1439
|
+
# in the bucket.
|
1440
|
+
#
|
1441
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1442
|
+
#
|
1443
|
+
# </note>
|
613
1444
|
# @option options [String] :request_payer
|
614
1445
|
# 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.
|
1446
|
+
# the list objects request in V2 style. Bucket owners need not specify
|
1447
|
+
# this parameter in their requests.
|
1448
|
+
#
|
1449
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1450
|
+
#
|
1451
|
+
# </note>
|
1452
|
+
# @option options [String] :expected_bucket_owner
|
1453
|
+
# The account ID of the expected bucket owner. If the account ID that
|
1454
|
+
# you provide does not match the actual owner of the bucket, the request
|
1455
|
+
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1456
|
+
# @option options [Array<String>] :optional_object_attributes
|
1457
|
+
# Specifies the optional fields that you want returned in the response.
|
1458
|
+
# Fields that you do not specify are not returned.
|
1459
|
+
#
|
1460
|
+
# <note markdown="1"> This functionality is not supported for directory buckets.
|
1461
|
+
#
|
1462
|
+
# </note>
|
617
1463
|
# @return [ObjectSummary::Collection]
|
618
1464
|
def objects(options = {})
|
619
1465
|
batches = Enumerator.new do |y|
|
620
1466
|
options = options.merge(bucket: @name)
|
621
|
-
resp =
|
1467
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1468
|
+
@client.list_objects_v2(options)
|
1469
|
+
end
|
622
1470
|
resp.each_page do |page|
|
623
1471
|
batch = []
|
624
1472
|
page.data.contents.each do |c|
|
@@ -697,8 +1545,8 @@ module Aws::S3
|
|
697
1545
|
|
698
1546
|
def yield_waiter_and_warn(waiter, &block)
|
699
1547
|
if !@waiter_block_warned
|
700
|
-
msg = "pass options to configure the waiter; "
|
701
|
-
|
1548
|
+
msg = "pass options to configure the waiter; "\
|
1549
|
+
"yielding the waiter is deprecated"
|
702
1550
|
warn(msg)
|
703
1551
|
@waiter_block_warned = true
|
704
1552
|
end
|
@@ -706,7 +1554,9 @@ module Aws::S3
|
|
706
1554
|
end
|
707
1555
|
|
708
1556
|
def separate_params_and_options(options)
|
709
|
-
opts = Set.new(
|
1557
|
+
opts = Set.new(
|
1558
|
+
[:client, :max_attempts, :delay, :before_attempt, :before_wait]
|
1559
|
+
)
|
710
1560
|
waiter_opts = {}
|
711
1561
|
waiter_params = {}
|
712
1562
|
options.each_pair do |key, value|
|
@@ -723,3 +1573,6 @@ module Aws::S3
|
|
723
1573
|
class Collection < Aws::Resources::Collection; end
|
724
1574
|
end
|
725
1575
|
end
|
1576
|
+
|
1577
|
+
# Load customizations if they exist
|
1578
|
+
require 'aws-sdk-s3/customizations/bucket'
|