aws-sdk-s3 1.9.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/aws-sdk-s3/bucket.rb +1 -1
- data/lib/aws-sdk-s3/bucket_notification.rb +3 -2
- data/lib/aws-sdk-s3/client.rb +706 -198
- data/lib/aws-sdk-s3/client_api.rb +171 -2
- data/lib/aws-sdk-s3/customizations/bucket.rb +2 -2
- data/lib/aws-sdk-s3/customizations/object.rb +60 -0
- data/lib/aws-sdk-s3/customizations/object_summary.rb +7 -0
- data/lib/aws-sdk-s3/customizations.rb +1 -0
- data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +9 -3
- data/lib/aws-sdk-s3/event_streams.rb +56 -0
- data/lib/aws-sdk-s3/file_downloader.rb +10 -9
- data/lib/aws-sdk-s3/file_part.rb +5 -7
- data/lib/aws-sdk-s3/file_uploader.rb +1 -3
- data/lib/aws-sdk-s3/multipart_stream_uploader.rb +160 -0
- data/lib/aws-sdk-s3/multipart_upload_part.rb +1 -1
- data/lib/aws-sdk-s3/object.rb +5 -2
- data/lib/aws-sdk-s3/object_summary.rb +5 -2
- data/lib/aws-sdk-s3/plugins/accelerate.rb +4 -0
- data/lib/aws-sdk-s3/plugins/md5s.rb +1 -1
- data/lib/aws-sdk-s3/plugins/redirects.rb +3 -1
- data/lib/aws-sdk-s3/plugins/s3_signer.rb +5 -1
- data/lib/aws-sdk-s3/presigner.rb +1 -0
- data/lib/aws-sdk-s3/types.rb +866 -129
- data/lib/aws-sdk-s3.rb +2 -1
- metadata +11 -3
data/lib/aws-sdk-s3/client.rb
CHANGED
@@ -15,10 +15,13 @@ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
|
|
15
15
|
require 'aws-sdk-core/plugins/retry_errors.rb'
|
16
16
|
require 'aws-sdk-core/plugins/global_configuration.rb'
|
17
17
|
require 'aws-sdk-core/plugins/regional_endpoint.rb'
|
18
|
+
require 'aws-sdk-core/plugins/endpoint_discovery.rb'
|
18
19
|
require 'aws-sdk-core/plugins/response_paging.rb'
|
19
20
|
require 'aws-sdk-core/plugins/stub_responses.rb'
|
20
21
|
require 'aws-sdk-core/plugins/idempotency_token.rb'
|
21
22
|
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
|
23
|
+
require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
|
24
|
+
require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
|
22
25
|
require 'aws-sdk-core/plugins/protocols/rest_xml.rb'
|
23
26
|
require 'aws-sdk-s3/plugins/accelerate.rb'
|
24
27
|
require 'aws-sdk-s3/plugins/dualstack.rb'
|
@@ -34,6 +37,7 @@ require 'aws-sdk-s3/plugins/sse_cpk.rb'
|
|
34
37
|
require 'aws-sdk-s3/plugins/url_encoded_keys.rb'
|
35
38
|
require 'aws-sdk-s3/plugins/s3_signer.rb'
|
36
39
|
require 'aws-sdk-s3/plugins/bucket_name_restrictions.rb'
|
40
|
+
require 'aws-sdk-core/plugins/event_stream_configuration.rb'
|
37
41
|
|
38
42
|
Aws::Plugins::GlobalConfiguration.add_identifier(:s3)
|
39
43
|
|
@@ -56,10 +60,13 @@ module Aws::S3
|
|
56
60
|
add_plugin(Aws::Plugins::RetryErrors)
|
57
61
|
add_plugin(Aws::Plugins::GlobalConfiguration)
|
58
62
|
add_plugin(Aws::Plugins::RegionalEndpoint)
|
63
|
+
add_plugin(Aws::Plugins::EndpointDiscovery)
|
59
64
|
add_plugin(Aws::Plugins::ResponsePaging)
|
60
65
|
add_plugin(Aws::Plugins::StubResponses)
|
61
66
|
add_plugin(Aws::Plugins::IdempotencyToken)
|
62
67
|
add_plugin(Aws::Plugins::JsonvalueConverter)
|
68
|
+
add_plugin(Aws::Plugins::ClientMetricsPlugin)
|
69
|
+
add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
|
63
70
|
add_plugin(Aws::Plugins::Protocols::RestXml)
|
64
71
|
add_plugin(Aws::S3::Plugins::Accelerate)
|
65
72
|
add_plugin(Aws::S3::Plugins::Dualstack)
|
@@ -75,123 +82,175 @@ module Aws::S3
|
|
75
82
|
add_plugin(Aws::S3::Plugins::UrlEncodedKeys)
|
76
83
|
add_plugin(Aws::S3::Plugins::S3Signer)
|
77
84
|
add_plugin(Aws::S3::Plugins::BucketNameRestrictions)
|
85
|
+
add_plugin(Aws::Plugins::EventStreamConfiguration)
|
78
86
|
|
79
|
-
# @
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
# When `:credentials` are not configured directly, the following
|
95
|
-
# locations will be searched for credentials:
|
96
|
-
#
|
97
|
-
# * `Aws.config[:credentials]`
|
98
|
-
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
99
|
-
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
100
|
-
# * `~/.aws/credentials`
|
101
|
-
# * `~/.aws/config`
|
102
|
-
# * EC2 IMDS instance profile - When used by default, the timeouts are
|
103
|
-
# very aggressive. Construct and pass an instance of
|
104
|
-
# `Aws::InstanceProfileCredentails` to enable retries and extended
|
105
|
-
# timeouts.
|
106
|
-
#
|
107
|
-
# @option options [required, String] :region
|
108
|
-
# The AWS region to connect to. The configured `:region` is
|
109
|
-
# used to determine the service `:endpoint`. When not passed,
|
110
|
-
# a default `:region` is search for in the following locations:
|
111
|
-
#
|
112
|
-
# * `Aws.config[:region]`
|
113
|
-
# * `ENV['AWS_REGION']`
|
114
|
-
# * `ENV['AMAZON_REGION']`
|
115
|
-
# * `ENV['AWS_DEFAULT_REGION']`
|
116
|
-
# * `~/.aws/credentials`
|
117
|
-
# * `~/.aws/config`
|
118
|
-
#
|
119
|
-
# @option options [String] :access_key_id
|
120
|
-
#
|
121
|
-
# @option options [Boolean] :compute_checksums (true)
|
122
|
-
# When `true` a MD5 checksum will be computed for every request that
|
123
|
-
# sends a body. When `false`, MD5 checksums will only be computed
|
124
|
-
# for operations that require them. Checksum errors returned by Amazon
|
125
|
-
# S3 are automatically retried up to `:retry_limit` times.
|
126
|
-
#
|
127
|
-
# @option options [Boolean] :convert_params (true)
|
128
|
-
# When `true`, an attempt is made to coerce request parameters into
|
129
|
-
# the required types.
|
130
|
-
#
|
131
|
-
# @option options [String] :endpoint
|
132
|
-
# The client endpoint is normally constructed from the `:region`
|
133
|
-
# option. You should only configure an `:endpoint` when connecting
|
134
|
-
# to test endpoints. This should be avalid HTTP(S) URI.
|
135
|
-
#
|
136
|
-
# @option options [Boolean] :follow_redirects (true)
|
137
|
-
# When `true`, this client will follow 307 redirects returned
|
138
|
-
# by Amazon S3.
|
139
|
-
#
|
140
|
-
# @option options [Boolean] :force_path_style (false)
|
141
|
-
# When set to `true`, the bucket name is always left in the
|
142
|
-
# request URI and never moved to the host as a sub-domain.
|
143
|
-
#
|
144
|
-
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
145
|
-
# The log formatter.
|
146
|
-
#
|
147
|
-
# @option options [Symbol] :log_level (:info)
|
148
|
-
# The log level to send messages to the `:logger` at.
|
149
|
-
#
|
150
|
-
# @option options [Logger] :logger
|
151
|
-
# The Logger instance to send log messages to. If this option
|
152
|
-
# is not set, logging will be disabled.
|
153
|
-
#
|
154
|
-
# @option options [String] :profile ("default")
|
155
|
-
# Used when loading credentials from the shared credentials file
|
156
|
-
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
157
|
-
#
|
158
|
-
# @option options [Boolean] :require_https_for_sse_cpk (true)
|
159
|
-
# When `true`, the endpoint **must** be HTTPS for all operations
|
160
|
-
# where server-side-encryption is used with customer-provided keys.
|
161
|
-
# This should only be disabled for local testing.
|
162
|
-
#
|
163
|
-
# @option options [Integer] :retry_limit (3)
|
164
|
-
# The maximum number of times to retry failed requests. Only
|
165
|
-
# ~ 500 level server errors and certain ~ 400 level client errors
|
166
|
-
# are retried. Generally, these are throttling errors, data
|
167
|
-
# checksum errors, networking errors, timeout errors and auth
|
168
|
-
# errors from expired credentials.
|
169
|
-
#
|
170
|
-
# @option options [String] :secret_access_key
|
171
|
-
#
|
172
|
-
# @option options [String] :session_token
|
173
|
-
#
|
174
|
-
# @option options [Boolean] :stub_responses (false)
|
175
|
-
# Causes the client to return stubbed responses. By default
|
176
|
-
# fake responses are generated and returned. You can specify
|
177
|
-
# the response data to return or errors to raise by calling
|
178
|
-
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
179
|
-
#
|
180
|
-
# ** Please note ** When response stubbing is enabled, no HTTP
|
181
|
-
# requests are made, and retries are disabled.
|
87
|
+
# @overload initialize(options)
|
88
|
+
# @param [Hash] options
|
89
|
+
# @option options [required, Aws::CredentialProvider] :credentials
|
90
|
+
# Your AWS credentials. This can be an instance of any one of the
|
91
|
+
# following classes:
|
92
|
+
#
|
93
|
+
# * `Aws::Credentials` - Used for configuring static, non-refreshing
|
94
|
+
# credentials.
|
95
|
+
#
|
96
|
+
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
|
97
|
+
# from an EC2 IMDS on an EC2 instance.
|
98
|
+
#
|
99
|
+
# * `Aws::SharedCredentials` - Used for loading credentials from a
|
100
|
+
# shared file, such as `~/.aws/config`.
|
182
101
|
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
102
|
+
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
|
103
|
+
#
|
104
|
+
# When `:credentials` are not configured directly, the following
|
105
|
+
# locations will be searched for credentials:
|
106
|
+
#
|
107
|
+
# * `Aws.config[:credentials]`
|
108
|
+
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
109
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
110
|
+
# * `~/.aws/credentials`
|
111
|
+
# * `~/.aws/config`
|
112
|
+
# * EC2 IMDS instance profile - When used by default, the timeouts are
|
113
|
+
# very aggressive. Construct and pass an instance of
|
114
|
+
# `Aws::InstanceProfileCredentails` to enable retries and extended
|
115
|
+
# timeouts.
|
116
|
+
#
|
117
|
+
# @option options [required, String] :region
|
118
|
+
# The AWS region to connect to. The configured `:region` is
|
119
|
+
# used to determine the service `:endpoint`. When not passed,
|
120
|
+
# a default `:region` is search for in the following locations:
|
121
|
+
#
|
122
|
+
# * `Aws.config[:region]`
|
123
|
+
# * `ENV['AWS_REGION']`
|
124
|
+
# * `ENV['AMAZON_REGION']`
|
125
|
+
# * `ENV['AWS_DEFAULT_REGION']`
|
126
|
+
# * `~/.aws/credentials`
|
127
|
+
# * `~/.aws/config`
|
128
|
+
#
|
129
|
+
# @option options [String] :access_key_id
|
130
|
+
#
|
131
|
+
# @option options [Boolean] :active_endpoint_cache (false)
|
132
|
+
# When set to `true`, a thread polling for endpoints will be running in
|
133
|
+
# the background every 60 secs (default). Defaults to `false`.
|
134
|
+
#
|
135
|
+
# @option options [Boolean] :client_side_monitoring (false)
|
136
|
+
# When `true`, client-side metrics will be collected for all API requests from
|
137
|
+
# this client.
|
138
|
+
#
|
139
|
+
# @option options [String] :client_side_monitoring_client_id ("")
|
140
|
+
# Allows you to provide an identifier for this client which will be attached to
|
141
|
+
# all generated client side metrics. Defaults to an empty string.
|
142
|
+
#
|
143
|
+
# @option options [Integer] :client_side_monitoring_port (31000)
|
144
|
+
# Required for publishing client metrics. The port that the client side monitoring
|
145
|
+
# agent is running on, where client metrics will be published via UDP.
|
146
|
+
#
|
147
|
+
# @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
|
148
|
+
# Allows you to provide a custom client-side monitoring publisher class. By default,
|
149
|
+
# will use the Client Side Monitoring Agent Publisher.
|
150
|
+
#
|
151
|
+
# @option options [Boolean] :compute_checksums (true)
|
152
|
+
# When `true` a MD5 checksum will be computed for every request that
|
153
|
+
# sends a body. When `false`, MD5 checksums will only be computed
|
154
|
+
# for operations that require them. Checksum errors returned by Amazon
|
155
|
+
# S3 are automatically retried up to `:retry_limit` times.
|
156
|
+
#
|
157
|
+
# @option options [Boolean] :convert_params (true)
|
158
|
+
# When `true`, an attempt is made to coerce request parameters into
|
159
|
+
# the required types.
|
160
|
+
#
|
161
|
+
# @option options [String] :endpoint
|
162
|
+
# The client endpoint is normally constructed from the `:region`
|
163
|
+
# option. You should only configure an `:endpoint` when connecting
|
164
|
+
# to test endpoints. This should be avalid HTTP(S) URI.
|
165
|
+
#
|
166
|
+
# @option options [Integer] :endpoint_cache_max_entries (1000)
|
167
|
+
# Used for the maximum size limit of the LRU cache storing endpoints data
|
168
|
+
# for endpoint discovery enabled operations. Defaults to 1000.
|
169
|
+
#
|
170
|
+
# @option options [Integer] :endpoint_cache_max_threads (10)
|
171
|
+
# Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
|
172
|
+
#
|
173
|
+
# @option options [Integer] :endpoint_cache_poll_interval (60)
|
174
|
+
# When :endpoint_discovery and :active_endpoint_cache is enabled,
|
175
|
+
# Use this option to config the time interval in seconds for making
|
176
|
+
# requests fetching endpoints information. Defaults to 60 sec.
|
177
|
+
#
|
178
|
+
# @option options [Boolean] :endpoint_discovery (false)
|
179
|
+
# When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
|
180
|
+
#
|
181
|
+
# @option options [Proc] :event_stream_handler
|
182
|
+
# When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.
|
183
|
+
#
|
184
|
+
# @option options [Boolean] :follow_redirects (true)
|
185
|
+
# When `true`, this client will follow 307 redirects returned
|
186
|
+
# by Amazon S3.
|
187
|
+
#
|
188
|
+
# @option options [Boolean] :force_path_style (false)
|
189
|
+
# When set to `true`, the bucket name is always left in the
|
190
|
+
# request URI and never moved to the host as a sub-domain.
|
191
|
+
#
|
192
|
+
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
193
|
+
# The log formatter.
|
194
|
+
#
|
195
|
+
# @option options [Symbol] :log_level (:info)
|
196
|
+
# The log level to send messages to the `:logger` at.
|
197
|
+
#
|
198
|
+
# @option options [Logger] :logger
|
199
|
+
# The Logger instance to send log messages to. If this option
|
200
|
+
# is not set, logging will be disabled.
|
201
|
+
#
|
202
|
+
# @option options [String] :profile ("default")
|
203
|
+
# Used when loading credentials from the shared credentials file
|
204
|
+
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
205
|
+
#
|
206
|
+
# @option options [Boolean] :require_https_for_sse_cpk (true)
|
207
|
+
# When `true`, the endpoint **must** be HTTPS for all operations
|
208
|
+
# where server-side-encryption is used with customer-provided keys.
|
209
|
+
# This should only be disabled for local testing.
|
210
|
+
#
|
211
|
+
# @option options [Float] :retry_base_delay (0.3)
|
212
|
+
# The base delay in seconds used by the default backoff function.
|
213
|
+
#
|
214
|
+
# @option options [Symbol] :retry_jitter (:none)
|
215
|
+
# A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
|
216
|
+
#
|
217
|
+
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
218
|
+
#
|
219
|
+
# @option options [Integer] :retry_limit (3)
|
220
|
+
# The maximum number of times to retry failed requests. Only
|
221
|
+
# ~ 500 level server errors and certain ~ 400 level client errors
|
222
|
+
# are retried. Generally, these are throttling errors, data
|
223
|
+
# checksum errors, networking errors, timeout errors and auth
|
224
|
+
# errors from expired credentials.
|
225
|
+
#
|
226
|
+
# @option options [Integer] :retry_max_delay (0)
|
227
|
+
# The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
|
228
|
+
#
|
229
|
+
# @option options [String] :secret_access_key
|
230
|
+
#
|
231
|
+
# @option options [String] :session_token
|
232
|
+
#
|
233
|
+
# @option options [Boolean] :stub_responses (false)
|
234
|
+
# Causes the client to return stubbed responses. By default
|
235
|
+
# fake responses are generated and returned. You can specify
|
236
|
+
# the response data to return or errors to raise by calling
|
237
|
+
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
238
|
+
#
|
239
|
+
# ** Please note ** When response stubbing is enabled, no HTTP
|
240
|
+
# requests are made, and retries are disabled.
|
241
|
+
#
|
242
|
+
# @option options [Boolean] :use_accelerate_endpoint (false)
|
243
|
+
# When set to `true`, accelerated bucket endpoints will be used
|
244
|
+
# for all object operations. You must first enable accelerate for
|
245
|
+
# each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html).
|
246
|
+
#
|
247
|
+
# @option options [Boolean] :use_dualstack_endpoint (false)
|
248
|
+
# When set to `true`, IPv6-compatible bucket endpoints will be used
|
249
|
+
# for all operations.
|
250
|
+
#
|
251
|
+
# @option options [Boolean] :validate_params (true)
|
252
|
+
# When `true`, request parameters are validated before
|
253
|
+
# sending the request.
|
195
254
|
#
|
196
255
|
def initialize(*args)
|
197
256
|
super
|
@@ -909,7 +968,7 @@ module Aws::S3
|
|
909
968
|
req.send_request(options)
|
910
969
|
end
|
911
970
|
|
912
|
-
# Deletes the
|
971
|
+
# Deletes the CORS configuration information set for the bucket.
|
913
972
|
#
|
914
973
|
# @option params [required, String] :bucket
|
915
974
|
#
|
@@ -1077,9 +1136,18 @@ module Aws::S3
|
|
1077
1136
|
req.send_request(options)
|
1078
1137
|
end
|
1079
1138
|
|
1080
|
-
# Deletes the replication configuration from the bucket.
|
1139
|
+
# Deletes the replication configuration from the bucket. For information
|
1140
|
+
# about replication configuration, see [Cross-Region Replication (CRR)](
|
1141
|
+
# https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) in the
|
1142
|
+
# *Amazon S3 Developer Guide*.
|
1081
1143
|
#
|
1082
1144
|
# @option params [required, String] :bucket
|
1145
|
+
# The bucket name.
|
1146
|
+
#
|
1147
|
+
# <note markdown="1"> It can take a while to propagate the deletion of a replication
|
1148
|
+
# configuration to all Amazon S3 systems.
|
1149
|
+
#
|
1150
|
+
# </note>
|
1083
1151
|
#
|
1084
1152
|
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
1085
1153
|
#
|
@@ -1334,22 +1402,20 @@ module Aws::S3
|
|
1334
1402
|
# * {Types::DeleteObjectsOutput#errors #errors} => Array<Types::Error>
|
1335
1403
|
#
|
1336
1404
|
#
|
1337
|
-
# @example Example: To delete multiple
|
1405
|
+
# @example Example: To delete multiple objects from a versioned bucket
|
1338
1406
|
#
|
1339
|
-
# # The following example deletes objects from a bucket. The
|
1340
|
-
# #
|
1407
|
+
# # The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the
|
1408
|
+
# # object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker.
|
1341
1409
|
#
|
1342
1410
|
# resp = client.delete_objects({
|
1343
1411
|
# bucket: "examplebucket",
|
1344
1412
|
# delete: {
|
1345
1413
|
# objects: [
|
1346
1414
|
# {
|
1347
|
-
# key: "
|
1348
|
-
# version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b",
|
1415
|
+
# key: "objectkey1",
|
1349
1416
|
# },
|
1350
1417
|
# {
|
1351
|
-
# key: "
|
1352
|
-
# version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd",
|
1418
|
+
# key: "objectkey2",
|
1353
1419
|
# },
|
1354
1420
|
# ],
|
1355
1421
|
# quiet: false,
|
@@ -1360,30 +1426,34 @@ module Aws::S3
|
|
1360
1426
|
# {
|
1361
1427
|
# deleted: [
|
1362
1428
|
# {
|
1363
|
-
#
|
1364
|
-
#
|
1429
|
+
# delete_marker: true,
|
1430
|
+
# delete_marker_version_id: "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F",
|
1431
|
+
# key: "objectkey1",
|
1365
1432
|
# },
|
1366
1433
|
# {
|
1367
|
-
#
|
1368
|
-
#
|
1434
|
+
# delete_marker: true,
|
1435
|
+
# delete_marker_version_id: "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt",
|
1436
|
+
# key: "objectkey2",
|
1369
1437
|
# },
|
1370
1438
|
# ],
|
1371
1439
|
# }
|
1372
1440
|
#
|
1373
|
-
# @example Example: To delete multiple
|
1441
|
+
# @example Example: To delete multiple object versions from a versioned bucket
|
1374
1442
|
#
|
1375
|
-
# # The following example deletes objects from a bucket. The
|
1376
|
-
# #
|
1443
|
+
# # The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object
|
1444
|
+
# # versions and returns the key and versions of deleted objects in the response.
|
1377
1445
|
#
|
1378
1446
|
# resp = client.delete_objects({
|
1379
1447
|
# bucket: "examplebucket",
|
1380
1448
|
# delete: {
|
1381
1449
|
# objects: [
|
1382
1450
|
# {
|
1383
|
-
# key: "
|
1451
|
+
# key: "HappyFace.jpg",
|
1452
|
+
# version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b",
|
1384
1453
|
# },
|
1385
1454
|
# {
|
1386
|
-
# key: "
|
1455
|
+
# key: "HappyFace.jpg",
|
1456
|
+
# version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd",
|
1387
1457
|
# },
|
1388
1458
|
# ],
|
1389
1459
|
# quiet: false,
|
@@ -1394,14 +1464,12 @@ module Aws::S3
|
|
1394
1464
|
# {
|
1395
1465
|
# deleted: [
|
1396
1466
|
# {
|
1397
|
-
#
|
1398
|
-
#
|
1399
|
-
# key: "objectkey1",
|
1467
|
+
# key: "HappyFace.jpg",
|
1468
|
+
# version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd",
|
1400
1469
|
# },
|
1401
1470
|
# {
|
1402
|
-
#
|
1403
|
-
#
|
1404
|
-
# key: "objectkey2",
|
1471
|
+
# key: "HappyFace.jpg",
|
1472
|
+
# version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b",
|
1405
1473
|
# },
|
1406
1474
|
# ],
|
1407
1475
|
# }
|
@@ -1446,6 +1514,29 @@ module Aws::S3
|
|
1446
1514
|
req.send_request(options)
|
1447
1515
|
end
|
1448
1516
|
|
1517
|
+
# Removes the Public Access Block configuration for an Amazon S3 bucket.
|
1518
|
+
#
|
1519
|
+
# @option params [required, String] :bucket
|
1520
|
+
# The Amazon S3 bucket whose Public Access Block configuration you want
|
1521
|
+
# to delete.
|
1522
|
+
#
|
1523
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
1524
|
+
#
|
1525
|
+
# @example Request syntax with placeholder values
|
1526
|
+
#
|
1527
|
+
# resp = client.delete_public_access_block({
|
1528
|
+
# bucket: "BucketName", # required
|
1529
|
+
# })
|
1530
|
+
#
|
1531
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletePublicAccessBlock AWS API Documentation
|
1532
|
+
#
|
1533
|
+
# @overload delete_public_access_block(params = {})
|
1534
|
+
# @param [Hash] params ({})
|
1535
|
+
def delete_public_access_block(params = {}, options = {})
|
1536
|
+
req = build_request(:delete_public_access_block, params)
|
1537
|
+
req.send_request(options)
|
1538
|
+
end
|
1539
|
+
|
1449
1540
|
# Returns the accelerate configuration of a bucket.
|
1450
1541
|
#
|
1451
1542
|
# @option params [required, String] :bucket
|
@@ -1557,7 +1648,7 @@ module Aws::S3
|
|
1557
1648
|
req.send_request(options)
|
1558
1649
|
end
|
1559
1650
|
|
1560
|
-
# Returns the
|
1651
|
+
# Returns the CORS configuration for the bucket.
|
1561
1652
|
#
|
1562
1653
|
# @option params [required, String] :bucket
|
1563
1654
|
#
|
@@ -2149,8 +2240,44 @@ module Aws::S3
|
|
2149
2240
|
req.send_request(options, &block)
|
2150
2241
|
end
|
2151
2242
|
|
2243
|
+
# Retrieves the policy status for an Amazon S3 bucket, indicating
|
2244
|
+
# whether the bucket is public.
|
2245
|
+
#
|
2246
|
+
# @option params [required, String] :bucket
|
2247
|
+
# The name of the Amazon S3 bucket whose public-policy status you want
|
2248
|
+
# to retrieve.
|
2249
|
+
#
|
2250
|
+
# @return [Types::GetBucketPolicyStatusOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
2251
|
+
#
|
2252
|
+
# * {Types::GetBucketPolicyStatusOutput#policy_status #policy_status} => Types::PolicyStatus
|
2253
|
+
#
|
2254
|
+
# @example Request syntax with placeholder values
|
2255
|
+
#
|
2256
|
+
# resp = client.get_bucket_policy_status({
|
2257
|
+
# bucket: "BucketName", # required
|
2258
|
+
# })
|
2259
|
+
#
|
2260
|
+
# @example Response structure
|
2261
|
+
#
|
2262
|
+
# resp.policy_status.is_public #=> Boolean
|
2263
|
+
#
|
2264
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyStatus AWS API Documentation
|
2265
|
+
#
|
2266
|
+
# @overload get_bucket_policy_status(params = {})
|
2267
|
+
# @param [Hash] params ({})
|
2268
|
+
def get_bucket_policy_status(params = {}, options = {})
|
2269
|
+
req = build_request(:get_bucket_policy_status, params)
|
2270
|
+
req.send_request(options)
|
2271
|
+
end
|
2272
|
+
|
2152
2273
|
# Returns the replication configuration of a bucket.
|
2153
2274
|
#
|
2275
|
+
# <note markdown="1"> It can take a while to propagate the put or delete a replication
|
2276
|
+
# configuration to all Amazon S3 systems. Therefore, a get request soon
|
2277
|
+
# after put or delete can return a wrong result.
|
2278
|
+
#
|
2279
|
+
# </note>
|
2280
|
+
#
|
2154
2281
|
# @option params [required, String] :bucket
|
2155
2282
|
#
|
2156
2283
|
# @return [Types::GetBucketReplicationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
@@ -2194,7 +2321,15 @@ module Aws::S3
|
|
2194
2321
|
# resp.replication_configuration.role #=> String
|
2195
2322
|
# resp.replication_configuration.rules #=> Array
|
2196
2323
|
# resp.replication_configuration.rules[0].id #=> String
|
2324
|
+
# resp.replication_configuration.rules[0].priority #=> Integer
|
2197
2325
|
# resp.replication_configuration.rules[0].prefix #=> String
|
2326
|
+
# resp.replication_configuration.rules[0].filter.prefix #=> String
|
2327
|
+
# resp.replication_configuration.rules[0].filter.tag.key #=> String
|
2328
|
+
# resp.replication_configuration.rules[0].filter.tag.value #=> String
|
2329
|
+
# resp.replication_configuration.rules[0].filter.and.prefix #=> String
|
2330
|
+
# resp.replication_configuration.rules[0].filter.and.tags #=> Array
|
2331
|
+
# resp.replication_configuration.rules[0].filter.and.tags[0].key #=> String
|
2332
|
+
# resp.replication_configuration.rules[0].filter.and.tags[0].value #=> String
|
2198
2333
|
# resp.replication_configuration.rules[0].status #=> String, one of "Enabled", "Disabled"
|
2199
2334
|
# resp.replication_configuration.rules[0].source_selection_criteria.sse_kms_encrypted_objects.status #=> String, one of "Enabled", "Disabled"
|
2200
2335
|
# resp.replication_configuration.rules[0].destination.bucket #=> String
|
@@ -2202,6 +2337,7 @@ module Aws::S3
|
|
2202
2337
|
# resp.replication_configuration.rules[0].destination.storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "ONEZONE_IA"
|
2203
2338
|
# resp.replication_configuration.rules[0].destination.access_control_translation.owner #=> String, one of "Destination"
|
2204
2339
|
# resp.replication_configuration.rules[0].destination.encryption_configuration.replica_kms_key_id #=> String
|
2340
|
+
# resp.replication_configuration.rules[0].delete_marker_replication.status #=> String, one of "Enabled", "Disabled"
|
2205
2341
|
#
|
2206
2342
|
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication AWS API Documentation
|
2207
2343
|
#
|
@@ -2906,6 +3042,39 @@ module Aws::S3
|
|
2906
3042
|
req.send_request(options, &block)
|
2907
3043
|
end
|
2908
3044
|
|
3045
|
+
# Retrieves the Public Access Block configuration for an Amazon S3
|
3046
|
+
# bucket.
|
3047
|
+
#
|
3048
|
+
# @option params [required, String] :bucket
|
3049
|
+
# The name of the Amazon S3 bucket whose Public Access Block
|
3050
|
+
# configuration you want to retrieve.
|
3051
|
+
#
|
3052
|
+
# @return [Types::GetPublicAccessBlockOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
3053
|
+
#
|
3054
|
+
# * {Types::GetPublicAccessBlockOutput#public_access_block_configuration #public_access_block_configuration} => Types::PublicAccessBlockConfiguration
|
3055
|
+
#
|
3056
|
+
# @example Request syntax with placeholder values
|
3057
|
+
#
|
3058
|
+
# resp = client.get_public_access_block({
|
3059
|
+
# bucket: "BucketName", # required
|
3060
|
+
# })
|
3061
|
+
#
|
3062
|
+
# @example Response structure
|
3063
|
+
#
|
3064
|
+
# resp.public_access_block_configuration.block_public_acls #=> Boolean
|
3065
|
+
# resp.public_access_block_configuration.ignore_public_acls #=> Boolean
|
3066
|
+
# resp.public_access_block_configuration.block_public_policy #=> Boolean
|
3067
|
+
# resp.public_access_block_configuration.restrict_public_buckets #=> Boolean
|
3068
|
+
#
|
3069
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetPublicAccessBlock AWS API Documentation
|
3070
|
+
#
|
3071
|
+
# @overload get_public_access_block(params = {})
|
3072
|
+
# @param [Hash] params ({})
|
3073
|
+
def get_public_access_block(params = {}, options = {})
|
3074
|
+
req = build_request(:get_public_access_block, params)
|
3075
|
+
req.send_request(options)
|
3076
|
+
end
|
3077
|
+
|
2909
3078
|
# This operation is useful to determine if a bucket exists and you have
|
2910
3079
|
# permission to access it.
|
2911
3080
|
#
|
@@ -4213,7 +4382,7 @@ module Aws::S3
|
|
4213
4382
|
req.send_request(options)
|
4214
4383
|
end
|
4215
4384
|
|
4216
|
-
# Sets the
|
4385
|
+
# Sets the CORS configuration for a bucket.
|
4217
4386
|
#
|
4218
4387
|
# @option params [required, String] :bucket
|
4219
4388
|
#
|
@@ -4724,8 +4893,9 @@ module Aws::S3
|
|
4724
4893
|
# @option params [required, String] :bucket
|
4725
4894
|
#
|
4726
4895
|
# @option params [required, Types::NotificationConfiguration] :notification_configuration
|
4727
|
-
#
|
4728
|
-
# If this element is empty, notifications are turned off
|
4896
|
+
# A container for specifying the notification configuration of the
|
4897
|
+
# bucket. If this element is empty, notifications are turned off for the
|
4898
|
+
# bucket.
|
4729
4899
|
#
|
4730
4900
|
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
4731
4901
|
#
|
@@ -4860,16 +5030,18 @@ module Aws::S3
|
|
4860
5030
|
req.send_request(options)
|
4861
5031
|
end
|
4862
5032
|
|
4863
|
-
# Creates a
|
4864
|
-
#
|
5033
|
+
# Creates a replication configuration or replaces an existing one. For
|
5034
|
+
# more information, see [Cross-Region Replication (CRR)](
|
5035
|
+
# https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) in the
|
5036
|
+
# *Amazon S3 Developer Guide*.
|
4865
5037
|
#
|
4866
5038
|
# @option params [required, String] :bucket
|
4867
5039
|
#
|
4868
5040
|
# @option params [String] :content_md5
|
4869
5041
|
#
|
4870
5042
|
# @option params [required, Types::ReplicationConfiguration] :replication_configuration
|
4871
|
-
#
|
4872
|
-
#
|
5043
|
+
# A container for replication rules. You can add up to 1,000 rules. The
|
5044
|
+
# maximum size of a replication configuration is 2 MB.
|
4873
5045
|
#
|
4874
5046
|
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
4875
5047
|
#
|
@@ -4905,7 +5077,24 @@ module Aws::S3
|
|
4905
5077
|
# rules: [ # required
|
4906
5078
|
# {
|
4907
5079
|
# id: "ID",
|
4908
|
-
#
|
5080
|
+
# priority: 1,
|
5081
|
+
# prefix: "Prefix",
|
5082
|
+
# filter: {
|
5083
|
+
# prefix: "Prefix",
|
5084
|
+
# tag: {
|
5085
|
+
# key: "ObjectKey", # required
|
5086
|
+
# value: "Value", # required
|
5087
|
+
# },
|
5088
|
+
# and: {
|
5089
|
+
# prefix: "Prefix",
|
5090
|
+
# tags: [
|
5091
|
+
# {
|
5092
|
+
# key: "ObjectKey", # required
|
5093
|
+
# value: "Value", # required
|
5094
|
+
# },
|
5095
|
+
# ],
|
5096
|
+
# },
|
5097
|
+
# },
|
4909
5098
|
# status: "Enabled", # required, accepts Enabled, Disabled
|
4910
5099
|
# source_selection_criteria: {
|
4911
5100
|
# sse_kms_encrypted_objects: {
|
@@ -4923,6 +5112,9 @@ module Aws::S3
|
|
4923
5112
|
# replica_kms_key_id: "ReplicaKmsKeyID",
|
4924
5113
|
# },
|
4925
5114
|
# },
|
5115
|
+
# delete_marker_replication: {
|
5116
|
+
# status: "Enabled", # accepts Enabled, Disabled
|
5117
|
+
# },
|
4926
5118
|
# },
|
4927
5119
|
# ],
|
4928
5120
|
# },
|
@@ -5259,7 +5451,7 @@ module Aws::S3
|
|
5259
5451
|
#
|
5260
5452
|
# @option params [String] :tagging
|
5261
5453
|
# The tag-set for the object. The tag-set must be encoded as URL Query
|
5262
|
-
# parameters
|
5454
|
+
# parameters. (For example, "Key1=Value1")
|
5263
5455
|
#
|
5264
5456
|
# @return [Types::PutObjectOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
5265
5457
|
#
|
@@ -5273,134 +5465,134 @@ module Aws::S3
|
|
5273
5465
|
# * {Types::PutObjectOutput#request_charged #request_charged} => String
|
5274
5466
|
#
|
5275
5467
|
#
|
5276
|
-
# @example Example: To
|
5468
|
+
# @example Example: To create an object.
|
5277
5469
|
#
|
5278
|
-
# # The following example
|
5279
|
-
# # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
|
5470
|
+
# # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
|
5280
5471
|
#
|
5281
5472
|
# resp = client.put_object({
|
5282
5473
|
# body: "filetoupload",
|
5283
5474
|
# bucket: "examplebucket",
|
5284
|
-
# key: "
|
5285
|
-
# server_side_encryption: "AES256",
|
5286
|
-
# tagging: "key1=value1&key2=value2",
|
5475
|
+
# key: "objectkey",
|
5287
5476
|
# })
|
5288
5477
|
#
|
5289
5478
|
# resp.to_h outputs the following:
|
5290
5479
|
# {
|
5291
5480
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5292
|
-
#
|
5293
|
-
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
5481
|
+
# version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
|
5294
5482
|
# }
|
5295
5483
|
#
|
5296
|
-
# @example Example: To upload
|
5484
|
+
# @example Example: To upload object and specify user-defined metadata
|
5297
5485
|
#
|
5298
|
-
# # The following example
|
5299
|
-
# #
|
5486
|
+
# # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning
|
5487
|
+
# # enabled, S3 returns version ID in response.
|
5300
5488
|
#
|
5301
5489
|
# resp = client.put_object({
|
5302
|
-
# acl: "authenticated-read",
|
5303
5490
|
# body: "filetoupload",
|
5304
5491
|
# bucket: "examplebucket",
|
5305
5492
|
# key: "exampleobject",
|
5493
|
+
# metadata: {
|
5494
|
+
# "metadata1" => "value1",
|
5495
|
+
# "metadata2" => "value2",
|
5496
|
+
# },
|
5306
5497
|
# })
|
5307
5498
|
#
|
5308
5499
|
# resp.to_h outputs the following:
|
5309
5500
|
# {
|
5310
5501
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5311
|
-
# version_id: "
|
5502
|
+
# version_id: "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0",
|
5312
5503
|
# }
|
5313
5504
|
#
|
5314
|
-
# @example Example: To upload an object
|
5505
|
+
# @example Example: To upload an object and specify optional tags
|
5315
5506
|
#
|
5316
|
-
# # The following example uploads an object
|
5317
|
-
# #
|
5507
|
+
# # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
|
5508
|
+
# # S3 returns version ID of the newly created object.
|
5318
5509
|
#
|
5319
5510
|
# resp = client.put_object({
|
5320
|
-
# body: "HappyFace.jpg",
|
5511
|
+
# body: "c:\\HappyFace.jpg",
|
5321
5512
|
# bucket: "examplebucket",
|
5322
5513
|
# key: "HappyFace.jpg",
|
5514
|
+
# tagging: "key1=value1&key2=value2",
|
5323
5515
|
# })
|
5324
5516
|
#
|
5325
5517
|
# resp.to_h outputs the following:
|
5326
5518
|
# {
|
5327
5519
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5328
|
-
# version_id: "
|
5520
|
+
# version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
|
5329
5521
|
# }
|
5330
5522
|
#
|
5331
|
-
# @example Example: To
|
5523
|
+
# @example Example: To upload an object
|
5332
5524
|
#
|
5333
|
-
# # The following example
|
5525
|
+
# # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
|
5526
|
+
# # syntax. S3 returns VersionId of the newly created object.
|
5334
5527
|
#
|
5335
5528
|
# resp = client.put_object({
|
5336
|
-
# body: "
|
5529
|
+
# body: "HappyFace.jpg",
|
5337
5530
|
# bucket: "examplebucket",
|
5338
|
-
# key: "
|
5531
|
+
# key: "HappyFace.jpg",
|
5339
5532
|
# })
|
5340
5533
|
#
|
5341
5534
|
# resp.to_h outputs the following:
|
5342
5535
|
# {
|
5343
5536
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5344
|
-
# version_id: "
|
5537
|
+
# version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
|
5345
5538
|
# }
|
5346
5539
|
#
|
5347
|
-
# @example Example: To upload an object and specify
|
5540
|
+
# @example Example: To upload an object and specify canned ACL.
|
5348
5541
|
#
|
5349
|
-
# # The following example uploads
|
5350
|
-
# # S3 returns version ID
|
5542
|
+
# # The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ
|
5543
|
+
# # access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response.
|
5351
5544
|
#
|
5352
5545
|
# resp = client.put_object({
|
5353
|
-
#
|
5546
|
+
# acl: "authenticated-read",
|
5547
|
+
# body: "filetoupload",
|
5354
5548
|
# bucket: "examplebucket",
|
5355
|
-
# key: "
|
5356
|
-
# tagging: "key1=value1&key2=value2",
|
5549
|
+
# key: "exampleobject",
|
5357
5550
|
# })
|
5358
5551
|
#
|
5359
5552
|
# resp.to_h outputs the following:
|
5360
5553
|
# {
|
5361
5554
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5362
|
-
# version_id: "
|
5555
|
+
# version_id: "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr",
|
5363
5556
|
# }
|
5364
5557
|
#
|
5365
|
-
# @example Example: To upload object
|
5558
|
+
# @example Example: To upload an object (specify optional headers)
|
5366
5559
|
#
|
5367
|
-
# # The following example
|
5368
|
-
# #
|
5560
|
+
# # The following example uploads an object. The request specifies optional request headers to directs S3 to use specific
|
5561
|
+
# # storage class and use server-side encryption.
|
5369
5562
|
#
|
5370
5563
|
# resp = client.put_object({
|
5371
|
-
# body: "
|
5564
|
+
# body: "HappyFace.jpg",
|
5372
5565
|
# bucket: "examplebucket",
|
5373
|
-
# key: "
|
5374
|
-
#
|
5375
|
-
#
|
5376
|
-
# "metadata2" => "value2",
|
5377
|
-
# },
|
5566
|
+
# key: "HappyFace.jpg",
|
5567
|
+
# server_side_encryption: "AES256",
|
5568
|
+
# storage_class: "STANDARD_IA",
|
5378
5569
|
# })
|
5379
5570
|
#
|
5380
5571
|
# resp.to_h outputs the following:
|
5381
5572
|
# {
|
5382
5573
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5383
|
-
#
|
5574
|
+
# server_side_encryption: "AES256",
|
5575
|
+
# version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp",
|
5384
5576
|
# }
|
5385
5577
|
#
|
5386
|
-
# @example Example: To upload an object
|
5578
|
+
# @example Example: To upload an object and specify server-side encryption and object tags
|
5387
5579
|
#
|
5388
|
-
# # The following example uploads
|
5389
|
-
# #
|
5580
|
+
# # The following example uploads and object. The request specifies the optional server-side encryption option. The request
|
5581
|
+
# # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
|
5390
5582
|
#
|
5391
5583
|
# resp = client.put_object({
|
5392
|
-
# body: "
|
5584
|
+
# body: "filetoupload",
|
5393
5585
|
# bucket: "examplebucket",
|
5394
|
-
# key: "
|
5586
|
+
# key: "exampleobject",
|
5395
5587
|
# server_side_encryption: "AES256",
|
5396
|
-
#
|
5588
|
+
# tagging: "key1=value1&key2=value2",
|
5397
5589
|
# })
|
5398
5590
|
#
|
5399
5591
|
# resp.to_h outputs the following:
|
5400
5592
|
# {
|
5401
5593
|
# etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
|
5402
5594
|
# server_side_encryption: "AES256",
|
5403
|
-
# version_id: "
|
5595
|
+
# version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
|
5404
5596
|
# }
|
5405
5597
|
#
|
5406
5598
|
# @example Streaming a file from disk
|
@@ -5646,6 +5838,44 @@ module Aws::S3
|
|
5646
5838
|
req.send_request(options)
|
5647
5839
|
end
|
5648
5840
|
|
5841
|
+
# Creates or modifies the Public Access Block configuration for an
|
5842
|
+
# Amazon S3 bucket.
|
5843
|
+
#
|
5844
|
+
# @option params [required, String] :bucket
|
5845
|
+
# The name of the Amazon S3 bucket whose Public Access Block
|
5846
|
+
# configuration you want to set.
|
5847
|
+
#
|
5848
|
+
# @option params [String] :content_md5
|
5849
|
+
# The MD5 hash of the `PutPublicBlock` request body.
|
5850
|
+
#
|
5851
|
+
# @option params [required, Types::PublicAccessBlockConfiguration] :public_access_block_configuration
|
5852
|
+
# The Public Access Block configuration that you want to apply to this
|
5853
|
+
# Amazon S3 bucket.
|
5854
|
+
#
|
5855
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
5856
|
+
#
|
5857
|
+
# @example Request syntax with placeholder values
|
5858
|
+
#
|
5859
|
+
# resp = client.put_public_access_block({
|
5860
|
+
# bucket: "BucketName", # required
|
5861
|
+
# content_md5: "ContentMD5",
|
5862
|
+
# public_access_block_configuration: { # required
|
5863
|
+
# block_public_acls: false,
|
5864
|
+
# ignore_public_acls: false,
|
5865
|
+
# block_public_policy: false,
|
5866
|
+
# restrict_public_buckets: false,
|
5867
|
+
# },
|
5868
|
+
# })
|
5869
|
+
#
|
5870
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutPublicAccessBlock AWS API Documentation
|
5871
|
+
#
|
5872
|
+
# @overload put_public_access_block(params = {})
|
5873
|
+
# @param [Hash] params ({})
|
5874
|
+
def put_public_access_block(params = {}, options = {})
|
5875
|
+
req = build_request(:put_public_access_block, params)
|
5876
|
+
req.send_request(options)
|
5877
|
+
end
|
5878
|
+
|
5649
5879
|
# Restores an archived copy of an object back into Amazon S3
|
5650
5880
|
#
|
5651
5881
|
# @option params [required, String] :bucket
|
@@ -5712,11 +5942,14 @@ module Aws::S3
|
|
5712
5942
|
# record_delimiter: "RecordDelimiter",
|
5713
5943
|
# field_delimiter: "FieldDelimiter",
|
5714
5944
|
# quote_character: "QuoteCharacter",
|
5945
|
+
# allow_quoted_record_delimiter: false,
|
5715
5946
|
# },
|
5716
|
-
# compression_type: "NONE", # accepts NONE, GZIP
|
5947
|
+
# compression_type: "NONE", # accepts NONE, GZIP, BZIP2
|
5717
5948
|
# json: {
|
5718
5949
|
# type: "DOCUMENT", # accepts DOCUMENT, LINES
|
5719
5950
|
# },
|
5951
|
+
# parquet: {
|
5952
|
+
# },
|
5720
5953
|
# },
|
5721
5954
|
# expression_type: "SQL", # required, accepts SQL
|
5722
5955
|
# expression: "Expression", # required
|
@@ -5790,6 +6023,281 @@ module Aws::S3
|
|
5790
6023
|
req.send_request(options)
|
5791
6024
|
end
|
5792
6025
|
|
6026
|
+
# This operation filters the contents of an Amazon S3 object based on a
|
6027
|
+
# simple Structured Query Language (SQL) statement. In the request,
|
6028
|
+
# along with the SQL expression, you must also specify a data
|
6029
|
+
# serialization format (JSON or CSV) of the object. Amazon S3 uses this
|
6030
|
+
# to parse object data into records, and returns only records that match
|
6031
|
+
# the specified SQL expression. You must also specify the data
|
6032
|
+
# serialization format for the response.
|
6033
|
+
#
|
6034
|
+
# @option params [required, String] :bucket
|
6035
|
+
# The S3 bucket.
|
6036
|
+
#
|
6037
|
+
# @option params [required, String] :key
|
6038
|
+
# The object key.
|
6039
|
+
#
|
6040
|
+
# @option params [String] :sse_customer_algorithm
|
6041
|
+
# The SSE Algorithm used to encrypt the object. For more information,
|
6042
|
+
# see [ Server-Side Encryption (Using Customer-Provided Encryption
|
6043
|
+
# Keys][1].
|
6044
|
+
#
|
6045
|
+
#
|
6046
|
+
#
|
6047
|
+
# [1]: http://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
6048
|
+
#
|
6049
|
+
# @option params [String] :sse_customer_key
|
6050
|
+
# The SSE Customer Key. For more information, see [ Server-Side
|
6051
|
+
# Encryption (Using Customer-Provided Encryption Keys][1].
|
6052
|
+
#
|
6053
|
+
#
|
6054
|
+
#
|
6055
|
+
# [1]: http://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
6056
|
+
#
|
6057
|
+
# @option params [String] :sse_customer_key_md5
|
6058
|
+
# The SSE Customer Key MD5. For more information, see [ Server-Side
|
6059
|
+
# Encryption (Using Customer-Provided Encryption Keys][1].
|
6060
|
+
#
|
6061
|
+
#
|
6062
|
+
#
|
6063
|
+
# [1]: http://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
|
6064
|
+
#
|
6065
|
+
# @option params [required, String] :expression
|
6066
|
+
# The expression that is used to query the object.
|
6067
|
+
#
|
6068
|
+
# @option params [required, String] :expression_type
|
6069
|
+
# The type of the provided expression (for example., SQL).
|
6070
|
+
#
|
6071
|
+
# @option params [Types::RequestProgress] :request_progress
|
6072
|
+
# Specifies if periodic request progress information should be enabled.
|
6073
|
+
#
|
6074
|
+
# @option params [required, Types::InputSerialization] :input_serialization
|
6075
|
+
# Describes the format of the data in the object that is being queried.
|
6076
|
+
#
|
6077
|
+
# @option params [required, Types::OutputSerialization] :output_serialization
|
6078
|
+
# Describes the format of the data that you want Amazon S3 to return in
|
6079
|
+
# response.
|
6080
|
+
#
|
6081
|
+
# @return [Types::SelectObjectContentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
6082
|
+
#
|
6083
|
+
# * {Types::SelectObjectContentOutput#payload #payload} => Types::SelectObjectContentEventStream
|
6084
|
+
#
|
6085
|
+
# @example EventStream Operation Example
|
6086
|
+
#
|
6087
|
+
# You can process event once it arrives immediately, or wait until
|
6088
|
+
# full response complete and iterate through eventstream enumerator.
|
6089
|
+
#
|
6090
|
+
# To interact with event immediately, you need to register #select_object_content
|
6091
|
+
# with callbacks, callbacks can be register for specifc events or for all events,
|
6092
|
+
# callback for errors in the event stream is also available for register.
|
6093
|
+
#
|
6094
|
+
# Callbacks can be passed in by `:event_stream_handler` option or within block
|
6095
|
+
# statement attached to #select_object_content call directly. Hybrid pattern of both
|
6096
|
+
# is also supported.
|
6097
|
+
#
|
6098
|
+
# `:event_stream_handler` option takes in either Proc object or
|
6099
|
+
# EventStreams::SelectObjectContentEventStream object.
|
6100
|
+
#
|
6101
|
+
# Usage pattern a): callbacks with a block attached to #select_object_content
|
6102
|
+
# Example for registering callbacks for all event types and error event
|
6103
|
+
#
|
6104
|
+
# client.select_object_content( # params input# ) do |stream|
|
6105
|
+
#
|
6106
|
+
# stream.on_error_event do |event|
|
6107
|
+
# # catch unmodeled error event in the stream
|
6108
|
+
# raise event
|
6109
|
+
# # => Aws::Errors::EventError
|
6110
|
+
# # event.event_type => :error
|
6111
|
+
# # event.error_code => String
|
6112
|
+
# # event.error_message => String
|
6113
|
+
# end
|
6114
|
+
#
|
6115
|
+
# stream.on_event do |event|
|
6116
|
+
# # process all events arrive
|
6117
|
+
# puts event.event_type
|
6118
|
+
# ...
|
6119
|
+
# end
|
6120
|
+
#
|
6121
|
+
# end
|
6122
|
+
#
|
6123
|
+
# Usage pattern b): pass in `:event_stream_handler` for #select_object_content
|
6124
|
+
#
|
6125
|
+
# 1) create a EventStreams::SelectObjectContentEventStream object
|
6126
|
+
# Example for registering callbacks with specific events
|
6127
|
+
#
|
6128
|
+
# handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new
|
6129
|
+
# handler.on_records_event do |event|
|
6130
|
+
# event # => Aws::S3::Types::Records
|
6131
|
+
# end
|
6132
|
+
# handler.on_stats_event do |event|
|
6133
|
+
# event # => Aws::S3::Types::Stats
|
6134
|
+
# end
|
6135
|
+
# handler.on_progress_event do |event|
|
6136
|
+
# event # => Aws::S3::Types::Progress
|
6137
|
+
# end
|
6138
|
+
# handler.on_cont_event do |event|
|
6139
|
+
# event # => Aws::S3::Types::Cont
|
6140
|
+
# end
|
6141
|
+
# handler.on_end_event do |event|
|
6142
|
+
# event # => Aws::S3::Types::End
|
6143
|
+
# end
|
6144
|
+
#
|
6145
|
+
# client.select_object_content( # params input #, event_stream_handler: handler)
|
6146
|
+
#
|
6147
|
+
# 2) use a Ruby Proc object
|
6148
|
+
# Example for registering callbacks with specific events
|
6149
|
+
#
|
6150
|
+
# handler = Proc.new do |stream|
|
6151
|
+
# stream.on_records_event do |event|
|
6152
|
+
# event # => Aws::S3::Types::Records
|
6153
|
+
# end
|
6154
|
+
# stream.on_stats_event do |event|
|
6155
|
+
# event # => Aws::S3::Types::Stats
|
6156
|
+
# end
|
6157
|
+
# stream.on_progress_event do |event|
|
6158
|
+
# event # => Aws::S3::Types::Progress
|
6159
|
+
# end
|
6160
|
+
# stream.on_cont_event do |event|
|
6161
|
+
# event # => Aws::S3::Types::Cont
|
6162
|
+
# end
|
6163
|
+
# stream.on_end_event do |event|
|
6164
|
+
# event # => Aws::S3::Types::End
|
6165
|
+
# end
|
6166
|
+
# end
|
6167
|
+
#
|
6168
|
+
# client.select_object_content( # params input #, event_stream_handler: handler)
|
6169
|
+
#
|
6170
|
+
# Usage pattern c): hybird pattern of a) and b)
|
6171
|
+
#
|
6172
|
+
# handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new
|
6173
|
+
# handler.on_records_event do |event|
|
6174
|
+
# event # => Aws::S3::Types::Records
|
6175
|
+
# end
|
6176
|
+
# handler.on_stats_event do |event|
|
6177
|
+
# event # => Aws::S3::Types::Stats
|
6178
|
+
# end
|
6179
|
+
# handler.on_progress_event do |event|
|
6180
|
+
# event # => Aws::S3::Types::Progress
|
6181
|
+
# end
|
6182
|
+
# handler.on_cont_event do |event|
|
6183
|
+
# event # => Aws::S3::Types::Cont
|
6184
|
+
# end
|
6185
|
+
# handler.on_end_event do |event|
|
6186
|
+
# event # => Aws::S3::Types::End
|
6187
|
+
# end
|
6188
|
+
#
|
6189
|
+
# client.select_object_content( # params input #, event_stream_handler: handler) do |stream|
|
6190
|
+
# stream.on_error_event do |event|
|
6191
|
+
# # catch unmodeled error event in the stream
|
6192
|
+
# raise event
|
6193
|
+
# # => Aws::Errors::EventError
|
6194
|
+
# # event.event_type => :error
|
6195
|
+
# # event.error_code => String
|
6196
|
+
# # event.error_message => String
|
6197
|
+
# end
|
6198
|
+
# end
|
6199
|
+
#
|
6200
|
+
# Besides above usage patterns for process events when they arrive immediately, you can also
|
6201
|
+
# iterate through events after response complete.
|
6202
|
+
#
|
6203
|
+
# Events are available at resp.payload # => Enumerator
|
6204
|
+
# For parameter input example, please refer to following request syntax
|
6205
|
+
#
|
6206
|
+
# @example Request syntax with placeholder values
|
6207
|
+
#
|
6208
|
+
# resp = client.select_object_content({
|
6209
|
+
# bucket: "BucketName", # required
|
6210
|
+
# key: "ObjectKey", # required
|
6211
|
+
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
6212
|
+
# sse_customer_key: "SSECustomerKey",
|
6213
|
+
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
6214
|
+
# expression: "Expression", # required
|
6215
|
+
# expression_type: "SQL", # required, accepts SQL
|
6216
|
+
# request_progress: {
|
6217
|
+
# enabled: false,
|
6218
|
+
# },
|
6219
|
+
# input_serialization: { # required
|
6220
|
+
# csv: {
|
6221
|
+
# file_header_info: "USE", # accepts USE, IGNORE, NONE
|
6222
|
+
# comments: "Comments",
|
6223
|
+
# quote_escape_character: "QuoteEscapeCharacter",
|
6224
|
+
# record_delimiter: "RecordDelimiter",
|
6225
|
+
# field_delimiter: "FieldDelimiter",
|
6226
|
+
# quote_character: "QuoteCharacter",
|
6227
|
+
# allow_quoted_record_delimiter: false,
|
6228
|
+
# },
|
6229
|
+
# compression_type: "NONE", # accepts NONE, GZIP, BZIP2
|
6230
|
+
# json: {
|
6231
|
+
# type: "DOCUMENT", # accepts DOCUMENT, LINES
|
6232
|
+
# },
|
6233
|
+
# parquet: {
|
6234
|
+
# },
|
6235
|
+
# },
|
6236
|
+
# output_serialization: { # required
|
6237
|
+
# csv: {
|
6238
|
+
# quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED
|
6239
|
+
# quote_escape_character: "QuoteEscapeCharacter",
|
6240
|
+
# record_delimiter: "RecordDelimiter",
|
6241
|
+
# field_delimiter: "FieldDelimiter",
|
6242
|
+
# quote_character: "QuoteCharacter",
|
6243
|
+
# },
|
6244
|
+
# json: {
|
6245
|
+
# record_delimiter: "RecordDelimiter",
|
6246
|
+
# },
|
6247
|
+
# },
|
6248
|
+
# })
|
6249
|
+
#
|
6250
|
+
# @example Response structure
|
6251
|
+
#
|
6252
|
+
# All events are available at resp.payload:
|
6253
|
+
# resp.payload #=> Enumerator
|
6254
|
+
# resp.payload.event_types #=> [:records, :stats, :progress, :cont, :end]
|
6255
|
+
#
|
6256
|
+
# For :records event available at #on_records_event callback and response eventstream enumerator:
|
6257
|
+
# event.payload #=> IO
|
6258
|
+
#
|
6259
|
+
# For :stats event available at #on_stats_event callback and response eventstream enumerator:
|
6260
|
+
# event.details.bytes_scanned #=> Integer
|
6261
|
+
# event.details.bytes_processed #=> Integer
|
6262
|
+
# event.details.bytes_returned #=> Integer
|
6263
|
+
#
|
6264
|
+
# For :progress event available at #on_progress_event callback and response eventstream enumerator:
|
6265
|
+
# event.details.bytes_scanned #=> Integer
|
6266
|
+
# event.details.bytes_processed #=> Integer
|
6267
|
+
# event.details.bytes_returned #=> Integer
|
6268
|
+
#
|
6269
|
+
# For :cont event available at #on_cont_event callback and response eventstream enumerator:
|
6270
|
+
# #=> EmptyStruct
|
6271
|
+
# For :end event available at #on_end_event callback and response eventstream enumerator:
|
6272
|
+
# #=> EmptyStruct
|
6273
|
+
#
|
6274
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContent AWS API Documentation
|
6275
|
+
#
|
6276
|
+
# @overload select_object_content(params = {})
|
6277
|
+
# @param [Hash] params ({})
|
6278
|
+
def select_object_content(params = {}, options = {}, &block)
|
6279
|
+
params = params.dup
|
6280
|
+
event_stream_handler = case handler = params.delete(:event_stream_handler)
|
6281
|
+
when EventStreams::SelectObjectContentEventStream then handler
|
6282
|
+
when Proc then EventStreams::SelectObjectContentEventStream.new.tap(&handler)
|
6283
|
+
when nil then EventStreams::SelectObjectContentEventStream.new
|
6284
|
+
else
|
6285
|
+
msg = "expected :event_stream_handler to be a block or "\
|
6286
|
+
"instance of Aws::S3::EventStreams::SelectObjectContentEventStream"\
|
6287
|
+
", got `#{handler.inspect}` instead"
|
6288
|
+
raise ArgumentError, msg
|
6289
|
+
end
|
6290
|
+
|
6291
|
+
yield(event_stream_handler) if block_given?
|
6292
|
+
|
6293
|
+
req = build_request(:select_object_content, params)
|
6294
|
+
|
6295
|
+
req.context[:event_stream_handler] = event_stream_handler
|
6296
|
+
req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)
|
6297
|
+
|
6298
|
+
req.send_request(options, &block)
|
6299
|
+
end
|
6300
|
+
|
5793
6301
|
# Uploads a part in a multipart upload.
|
5794
6302
|
#
|
5795
6303
|
# **Note:** After you initiate multipart upload and upload one or more
|
@@ -6094,7 +6602,7 @@ module Aws::S3
|
|
6094
6602
|
params: params,
|
6095
6603
|
config: config)
|
6096
6604
|
context[:gem_name] = 'aws-sdk-s3'
|
6097
|
-
context[:gem_version] = '1.
|
6605
|
+
context[:gem_version] = '1.24.1'
|
6098
6606
|
Seahorse::Client::Request.new(handlers, context)
|
6099
6607
|
end
|
6100
6608
|
|