aws-sdk-rds 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/aws-sdk-rds.rb +1 -1
- data/lib/aws-sdk-rds/account_quota.rb +97 -2
- data/lib/aws-sdk-rds/certificate.rb +100 -5
- data/lib/aws-sdk-rds/client.rb +1 -1
- data/lib/aws-sdk-rds/db_cluster.rb +137 -42
- data/lib/aws-sdk-rds/db_cluster_parameter_group.rb +98 -3
- data/lib/aws-sdk-rds/db_cluster_snapshot.rb +113 -18
- data/lib/aws-sdk-rds/db_engine.rb +95 -0
- data/lib/aws-sdk-rds/db_engine_version.rb +104 -9
- data/lib/aws-sdk-rds/db_instance.rb +159 -64
- data/lib/aws-sdk-rds/db_log_file.rb +97 -2
- data/lib/aws-sdk-rds/db_parameter_group.rb +98 -3
- data/lib/aws-sdk-rds/db_parameter_group_family.rb +95 -0
- data/lib/aws-sdk-rds/db_security_group.rb +101 -6
- data/lib/aws-sdk-rds/db_snapshot.rb +121 -26
- data/lib/aws-sdk-rds/db_snapshot_attribute.rb +96 -1
- data/lib/aws-sdk-rds/db_subnet_group.rb +100 -5
- data/lib/aws-sdk-rds/event.rb +99 -4
- data/lib/aws-sdk-rds/event_category_map.rb +96 -1
- data/lib/aws-sdk-rds/event_subscription.rb +104 -9
- data/lib/aws-sdk-rds/option_group.rb +102 -7
- data/lib/aws-sdk-rds/option_group_option.rb +110 -15
- data/lib/aws-sdk-rds/parameter.rb +104 -9
- data/lib/aws-sdk-rds/pending_maintenance_action.rb +100 -5
- data/lib/aws-sdk-rds/reserved_db_instance.rb +111 -16
- data/lib/aws-sdk-rds/reserved_db_instances_offering.rb +104 -9
- data/lib/aws-sdk-rds/resource_pending_maintenance_action_list.rb +99 -4
- metadata +2 -2
@@ -44,101 +44,101 @@ module Aws::RDS
|
|
44
44
|
# Coordinated Time (UTC).
|
45
45
|
# @return [Time]
|
46
46
|
def snapshot_create_time
|
47
|
-
data
|
47
|
+
data[:snapshot_create_time]
|
48
48
|
end
|
49
49
|
|
50
50
|
# Specifies the name of the database engine.
|
51
51
|
# @return [String]
|
52
52
|
def engine
|
53
|
-
data
|
53
|
+
data[:engine]
|
54
54
|
end
|
55
55
|
|
56
56
|
# Specifies the allocated storage size in gigabytes (GB).
|
57
57
|
# @return [Integer]
|
58
58
|
def allocated_storage
|
59
|
-
data
|
59
|
+
data[:allocated_storage]
|
60
60
|
end
|
61
61
|
|
62
62
|
# Specifies the status of this DB snapshot.
|
63
63
|
# @return [String]
|
64
64
|
def status
|
65
|
-
data
|
65
|
+
data[:status]
|
66
66
|
end
|
67
67
|
|
68
68
|
# Specifies the port that the database engine was listening on at the
|
69
69
|
# time of the snapshot.
|
70
70
|
# @return [Integer]
|
71
71
|
def port
|
72
|
-
data
|
72
|
+
data[:port]
|
73
73
|
end
|
74
74
|
|
75
75
|
# Specifies the name of the Availability Zone the DB instance was
|
76
76
|
# located in at the time of the DB snapshot.
|
77
77
|
# @return [String]
|
78
78
|
def availability_zone
|
79
|
-
data
|
79
|
+
data[:availability_zone]
|
80
80
|
end
|
81
81
|
|
82
82
|
# Provides the VPC ID associated with the DB snapshot.
|
83
83
|
# @return [String]
|
84
84
|
def vpc_id
|
85
|
-
data
|
85
|
+
data[:vpc_id]
|
86
86
|
end
|
87
87
|
|
88
88
|
# Specifies the time when the snapshot was taken, in Universal
|
89
89
|
# Coordinated Time (UTC).
|
90
90
|
# @return [Time]
|
91
91
|
def instance_create_time
|
92
|
-
data
|
92
|
+
data[:instance_create_time]
|
93
93
|
end
|
94
94
|
|
95
95
|
# Provides the master username for the DB snapshot.
|
96
96
|
# @return [String]
|
97
97
|
def master_username
|
98
|
-
data
|
98
|
+
data[:master_username]
|
99
99
|
end
|
100
100
|
|
101
101
|
# Specifies the version of the database engine.
|
102
102
|
# @return [String]
|
103
103
|
def engine_version
|
104
|
-
data
|
104
|
+
data[:engine_version]
|
105
105
|
end
|
106
106
|
|
107
107
|
# License model information for the restored DB instance.
|
108
108
|
# @return [String]
|
109
109
|
def license_model
|
110
|
-
data
|
110
|
+
data[:license_model]
|
111
111
|
end
|
112
112
|
|
113
113
|
# Provides the type of the DB snapshot.
|
114
114
|
# @return [String]
|
115
115
|
def snapshot_type
|
116
|
-
data
|
116
|
+
data[:snapshot_type]
|
117
117
|
end
|
118
118
|
|
119
119
|
# Specifies the Provisioned IOPS (I/O operations per second) value of
|
120
120
|
# the DB instance at the time of the snapshot.
|
121
121
|
# @return [Integer]
|
122
122
|
def iops
|
123
|
-
data
|
123
|
+
data[:iops]
|
124
124
|
end
|
125
125
|
|
126
126
|
# Provides the option group name for the DB snapshot.
|
127
127
|
# @return [String]
|
128
128
|
def option_group_name
|
129
|
-
data
|
129
|
+
data[:option_group_name]
|
130
130
|
end
|
131
131
|
|
132
132
|
# The percentage of the estimated data that has been transferred.
|
133
133
|
# @return [Integer]
|
134
134
|
def percent_progress
|
135
|
-
data
|
135
|
+
data[:percent_progress]
|
136
136
|
end
|
137
137
|
|
138
138
|
# The AWS Region that the DB snapshot was created in or copied from.
|
139
139
|
# @return [String]
|
140
140
|
def source_region
|
141
|
-
data
|
141
|
+
data[:source_region]
|
142
142
|
end
|
143
143
|
|
144
144
|
# The DB snapshot Amazon Resource Name (ARN) that the DB snapshot was
|
@@ -146,39 +146,39 @@ module Aws::RDS
|
|
146
146
|
# cross-region copy.
|
147
147
|
# @return [String]
|
148
148
|
def source_db_snapshot_identifier
|
149
|
-
data
|
149
|
+
data[:source_db_snapshot_identifier]
|
150
150
|
end
|
151
151
|
|
152
152
|
# Specifies the storage type associated with DB snapshot.
|
153
153
|
# @return [String]
|
154
154
|
def storage_type
|
155
|
-
data
|
155
|
+
data[:storage_type]
|
156
156
|
end
|
157
157
|
|
158
158
|
# The ARN from the key store with which to associate the instance for
|
159
159
|
# TDE encryption.
|
160
160
|
# @return [String]
|
161
161
|
def tde_credential_arn
|
162
|
-
data
|
162
|
+
data[:tde_credential_arn]
|
163
163
|
end
|
164
164
|
|
165
165
|
# Specifies whether the DB snapshot is encrypted.
|
166
166
|
# @return [Boolean]
|
167
167
|
def encrypted
|
168
|
-
data
|
168
|
+
data[:encrypted]
|
169
169
|
end
|
170
170
|
|
171
171
|
# If `Encrypted` is true, the KMS key identifier for the encrypted DB
|
172
172
|
# snapshot.
|
173
173
|
# @return [String]
|
174
174
|
def kms_key_id
|
175
|
-
data
|
175
|
+
data[:kms_key_id]
|
176
176
|
end
|
177
177
|
|
178
178
|
# The Amazon Resource Name (ARN) for the DB snapshot.
|
179
179
|
# @return [String]
|
180
180
|
def db_snapshot_arn
|
181
|
-
data
|
181
|
+
data[:db_snapshot_arn]
|
182
182
|
end
|
183
183
|
|
184
184
|
# The time zone of the DB snapshot. In most cases, the `Timezone`
|
@@ -187,14 +187,14 @@ module Aws::RDS
|
|
187
187
|
# zone specified.
|
188
188
|
# @return [String]
|
189
189
|
def timezone
|
190
|
-
data
|
190
|
+
data[:timezone]
|
191
191
|
end
|
192
192
|
|
193
193
|
# True if mapping of AWS Identity and Access Management (IAM) accounts
|
194
194
|
# to database accounts is enabled; otherwise false.
|
195
195
|
# @return [Boolean]
|
196
196
|
def iam_database_authentication_enabled
|
197
|
-
data
|
197
|
+
data[:iam_database_authentication_enabled]
|
198
198
|
end
|
199
199
|
|
200
200
|
# @!endgroup
|
@@ -232,6 +232,101 @@ module Aws::RDS
|
|
232
232
|
!!@data
|
233
233
|
end
|
234
234
|
|
235
|
+
# @deprecated Use [Aws::RDS::Client] #wait_until instead
|
236
|
+
#
|
237
|
+
# Waiter polls an API operation until a resource enters a desired
|
238
|
+
# state.
|
239
|
+
#
|
240
|
+
# @note The waiting operation is performed on a copy. The original resource remains unchanged
|
241
|
+
#
|
242
|
+
# ## Basic Usage
|
243
|
+
#
|
244
|
+
# Waiter will polls until it is successful, it fails by
|
245
|
+
# entering a terminal state, or until a maximum number of attempts
|
246
|
+
# are made.
|
247
|
+
#
|
248
|
+
# # polls in a loop until condition is true
|
249
|
+
# resource.wait_until(options) {|resource| condition}
|
250
|
+
#
|
251
|
+
# ## Example
|
252
|
+
#
|
253
|
+
# instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
|
254
|
+
#
|
255
|
+
# ## Configuration
|
256
|
+
#
|
257
|
+
# You can configure the maximum number of polling attempts, and the
|
258
|
+
# delay (in seconds) between each polling attempt. The waiting condition is set
|
259
|
+
# by passing a block to {#wait_until}:
|
260
|
+
#
|
261
|
+
# # poll for ~25 seconds
|
262
|
+
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
263
|
+
#
|
264
|
+
# ## Callbacks
|
265
|
+
#
|
266
|
+
# You can be notified before each polling attempt and before each
|
267
|
+
# delay. If you throw `:success` or `:failure` from these callbacks,
|
268
|
+
# it will terminate the waiter.
|
269
|
+
#
|
270
|
+
# started_at = Time.now
|
271
|
+
# # poll for 1 hour, instead of a number of attempts
|
272
|
+
# proc = Proc.new do |attempts, response|
|
273
|
+
# throw :failure if Time.now - started_at > 3600
|
274
|
+
# end
|
275
|
+
#
|
276
|
+
# # disable max attempts
|
277
|
+
# instance.wait_until(before_wait:proc, max_attempts:nil) {...}
|
278
|
+
#
|
279
|
+
# ## Handling Errors
|
280
|
+
#
|
281
|
+
# When a waiter is successful, it returns the Resource. When a waiter
|
282
|
+
# fails, it raises an error.
|
283
|
+
#
|
284
|
+
# begin
|
285
|
+
# resource.wait_until(...)
|
286
|
+
# rescue Aws::Waiters::Errors::WaiterFailed
|
287
|
+
# # resource did not enter the desired state in time
|
288
|
+
# end
|
289
|
+
#
|
290
|
+
#
|
291
|
+
# @yield param [Resource] resource to be used in the waiting condition
|
292
|
+
#
|
293
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
|
294
|
+
# because the waiter has entered a state that it will not transition
|
295
|
+
# out of, preventing success.
|
296
|
+
#
|
297
|
+
# yet successful.
|
298
|
+
#
|
299
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
|
300
|
+
# while polling for a resource that is not expected.
|
301
|
+
#
|
302
|
+
# @raise [NotImplementedError] Raised when the resource does not
|
303
|
+
#
|
304
|
+
# @option options [Integer] :max_attempts (10) Maximum number of
|
305
|
+
# attempts
|
306
|
+
# @option options [Integer] :delay (10) Delay between each
|
307
|
+
# attempt in seconds
|
308
|
+
# @option options [Proc] :before_attempt (nil) Callback
|
309
|
+
# invoked before each attempt
|
310
|
+
# @option options [Proc] :before_wait (nil) Callback
|
311
|
+
# invoked before each wait
|
312
|
+
# @return [Resource] if the waiter was successful
|
313
|
+
def wait_until(options = {}, &block)
|
314
|
+
self_copy = self.dup
|
315
|
+
attempts = 0
|
316
|
+
options[:max_attempts] = 10 unless options.key?(:max_attempts)
|
317
|
+
options[:delay] ||= 10
|
318
|
+
options[:poller] = Proc.new do
|
319
|
+
attempts += 1
|
320
|
+
if block.call(self_copy)
|
321
|
+
[:success, self_copy]
|
322
|
+
else
|
323
|
+
self_copy.reload unless attempts == options[:max_attempts]
|
324
|
+
:retry
|
325
|
+
end
|
326
|
+
end
|
327
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
328
|
+
end
|
329
|
+
|
235
330
|
# @!group Actions
|
236
331
|
|
237
332
|
# @example Request syntax with placeholder values
|
@@ -758,9 +853,9 @@ module Aws::RDS
|
|
758
853
|
|
759
854
|
# @return [OptionGroup, nil]
|
760
855
|
def option_group
|
761
|
-
if data
|
856
|
+
if data[:db_snapshot][:option_group_name]
|
762
857
|
OptionGroup.new(
|
763
|
-
name: data
|
858
|
+
name: data[:db_snapshot][:option_group_name],
|
764
859
|
client: @client
|
765
860
|
)
|
766
861
|
else
|
@@ -48,7 +48,7 @@ module Aws::RDS
|
|
48
48
|
# account to copy or restore.
|
49
49
|
# @return [Array<String>]
|
50
50
|
def attribute_values
|
51
|
-
data
|
51
|
+
data[:attribute_values]
|
52
52
|
end
|
53
53
|
|
54
54
|
# @!endgroup
|
@@ -81,6 +81,101 @@ module Aws::RDS
|
|
81
81
|
!!@data
|
82
82
|
end
|
83
83
|
|
84
|
+
# @deprecated Use [Aws::RDS::Client] #wait_until instead
|
85
|
+
#
|
86
|
+
# Waiter polls an API operation until a resource enters a desired
|
87
|
+
# state.
|
88
|
+
#
|
89
|
+
# @note The waiting operation is performed on a copy. The original resource remains unchanged
|
90
|
+
#
|
91
|
+
# ## Basic Usage
|
92
|
+
#
|
93
|
+
# Waiter will polls until it is successful, it fails by
|
94
|
+
# entering a terminal state, or until a maximum number of attempts
|
95
|
+
# are made.
|
96
|
+
#
|
97
|
+
# # polls in a loop until condition is true
|
98
|
+
# resource.wait_until(options) {|resource| condition}
|
99
|
+
#
|
100
|
+
# ## Example
|
101
|
+
#
|
102
|
+
# instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
|
103
|
+
#
|
104
|
+
# ## Configuration
|
105
|
+
#
|
106
|
+
# You can configure the maximum number of polling attempts, and the
|
107
|
+
# delay (in seconds) between each polling attempt. The waiting condition is set
|
108
|
+
# by passing a block to {#wait_until}:
|
109
|
+
#
|
110
|
+
# # poll for ~25 seconds
|
111
|
+
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
112
|
+
#
|
113
|
+
# ## Callbacks
|
114
|
+
#
|
115
|
+
# You can be notified before each polling attempt and before each
|
116
|
+
# delay. If you throw `:success` or `:failure` from these callbacks,
|
117
|
+
# it will terminate the waiter.
|
118
|
+
#
|
119
|
+
# started_at = Time.now
|
120
|
+
# # poll for 1 hour, instead of a number of attempts
|
121
|
+
# proc = Proc.new do |attempts, response|
|
122
|
+
# throw :failure if Time.now - started_at > 3600
|
123
|
+
# end
|
124
|
+
#
|
125
|
+
# # disable max attempts
|
126
|
+
# instance.wait_until(before_wait:proc, max_attempts:nil) {...}
|
127
|
+
#
|
128
|
+
# ## Handling Errors
|
129
|
+
#
|
130
|
+
# When a waiter is successful, it returns the Resource. When a waiter
|
131
|
+
# fails, it raises an error.
|
132
|
+
#
|
133
|
+
# begin
|
134
|
+
# resource.wait_until(...)
|
135
|
+
# rescue Aws::Waiters::Errors::WaiterFailed
|
136
|
+
# # resource did not enter the desired state in time
|
137
|
+
# end
|
138
|
+
#
|
139
|
+
#
|
140
|
+
# @yield param [Resource] resource to be used in the waiting condition
|
141
|
+
#
|
142
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
|
143
|
+
# because the waiter has entered a state that it will not transition
|
144
|
+
# out of, preventing success.
|
145
|
+
#
|
146
|
+
# yet successful.
|
147
|
+
#
|
148
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
|
149
|
+
# while polling for a resource that is not expected.
|
150
|
+
#
|
151
|
+
# @raise [NotImplementedError] Raised when the resource does not
|
152
|
+
#
|
153
|
+
# @option options [Integer] :max_attempts (10) Maximum number of
|
154
|
+
# attempts
|
155
|
+
# @option options [Integer] :delay (10) Delay between each
|
156
|
+
# attempt in seconds
|
157
|
+
# @option options [Proc] :before_attempt (nil) Callback
|
158
|
+
# invoked before each attempt
|
159
|
+
# @option options [Proc] :before_wait (nil) Callback
|
160
|
+
# invoked before each wait
|
161
|
+
# @return [Resource] if the waiter was successful
|
162
|
+
def wait_until(options = {}, &block)
|
163
|
+
self_copy = self.dup
|
164
|
+
attempts = 0
|
165
|
+
options[:max_attempts] = 10 unless options.key?(:max_attempts)
|
166
|
+
options[:delay] ||= 10
|
167
|
+
options[:poller] = Proc.new do
|
168
|
+
attempts += 1
|
169
|
+
if block.call(self_copy)
|
170
|
+
[:success, self_copy]
|
171
|
+
else
|
172
|
+
self_copy.reload unless attempts == options[:max_attempts]
|
173
|
+
:retry
|
174
|
+
end
|
175
|
+
end
|
176
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
177
|
+
end
|
178
|
+
|
84
179
|
# @!group Actions
|
85
180
|
|
86
181
|
# @example Request syntax with placeholder values
|
@@ -34,31 +34,31 @@ module Aws::RDS
|
|
34
34
|
# Provides the description of the DB subnet group.
|
35
35
|
# @return [String]
|
36
36
|
def db_subnet_group_description
|
37
|
-
data
|
37
|
+
data[:db_subnet_group_description]
|
38
38
|
end
|
39
39
|
|
40
40
|
# Provides the VpcId of the DB subnet group.
|
41
41
|
# @return [String]
|
42
42
|
def vpc_id
|
43
|
-
data
|
43
|
+
data[:vpc_id]
|
44
44
|
end
|
45
45
|
|
46
46
|
# Provides the status of the DB subnet group.
|
47
47
|
# @return [String]
|
48
48
|
def subnet_group_status
|
49
|
-
data
|
49
|
+
data[:subnet_group_status]
|
50
50
|
end
|
51
51
|
|
52
52
|
# Contains a list of Subnet elements.
|
53
53
|
# @return [Array<Types::Subnet>]
|
54
54
|
def subnets
|
55
|
-
data
|
55
|
+
data[:subnets]
|
56
56
|
end
|
57
57
|
|
58
58
|
# The Amazon Resource Name (ARN) for the DB subnet group.
|
59
59
|
# @return [String]
|
60
60
|
def db_subnet_group_arn
|
61
|
-
data
|
61
|
+
data[:db_subnet_group_arn]
|
62
62
|
end
|
63
63
|
|
64
64
|
# @!endgroup
|
@@ -96,6 +96,101 @@ module Aws::RDS
|
|
96
96
|
!!@data
|
97
97
|
end
|
98
98
|
|
99
|
+
# @deprecated Use [Aws::RDS::Client] #wait_until instead
|
100
|
+
#
|
101
|
+
# Waiter polls an API operation until a resource enters a desired
|
102
|
+
# state.
|
103
|
+
#
|
104
|
+
# @note The waiting operation is performed on a copy. The original resource remains unchanged
|
105
|
+
#
|
106
|
+
# ## Basic Usage
|
107
|
+
#
|
108
|
+
# Waiter will polls until it is successful, it fails by
|
109
|
+
# entering a terminal state, or until a maximum number of attempts
|
110
|
+
# are made.
|
111
|
+
#
|
112
|
+
# # polls in a loop until condition is true
|
113
|
+
# resource.wait_until(options) {|resource| condition}
|
114
|
+
#
|
115
|
+
# ## Example
|
116
|
+
#
|
117
|
+
# instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
|
118
|
+
#
|
119
|
+
# ## Configuration
|
120
|
+
#
|
121
|
+
# You can configure the maximum number of polling attempts, and the
|
122
|
+
# delay (in seconds) between each polling attempt. The waiting condition is set
|
123
|
+
# by passing a block to {#wait_until}:
|
124
|
+
#
|
125
|
+
# # poll for ~25 seconds
|
126
|
+
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
127
|
+
#
|
128
|
+
# ## Callbacks
|
129
|
+
#
|
130
|
+
# You can be notified before each polling attempt and before each
|
131
|
+
# delay. If you throw `:success` or `:failure` from these callbacks,
|
132
|
+
# it will terminate the waiter.
|
133
|
+
#
|
134
|
+
# started_at = Time.now
|
135
|
+
# # poll for 1 hour, instead of a number of attempts
|
136
|
+
# proc = Proc.new do |attempts, response|
|
137
|
+
# throw :failure if Time.now - started_at > 3600
|
138
|
+
# end
|
139
|
+
#
|
140
|
+
# # disable max attempts
|
141
|
+
# instance.wait_until(before_wait:proc, max_attempts:nil) {...}
|
142
|
+
#
|
143
|
+
# ## Handling Errors
|
144
|
+
#
|
145
|
+
# When a waiter is successful, it returns the Resource. When a waiter
|
146
|
+
# fails, it raises an error.
|
147
|
+
#
|
148
|
+
# begin
|
149
|
+
# resource.wait_until(...)
|
150
|
+
# rescue Aws::Waiters::Errors::WaiterFailed
|
151
|
+
# # resource did not enter the desired state in time
|
152
|
+
# end
|
153
|
+
#
|
154
|
+
#
|
155
|
+
# @yield param [Resource] resource to be used in the waiting condition
|
156
|
+
#
|
157
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
|
158
|
+
# because the waiter has entered a state that it will not transition
|
159
|
+
# out of, preventing success.
|
160
|
+
#
|
161
|
+
# yet successful.
|
162
|
+
#
|
163
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
|
164
|
+
# while polling for a resource that is not expected.
|
165
|
+
#
|
166
|
+
# @raise [NotImplementedError] Raised when the resource does not
|
167
|
+
#
|
168
|
+
# @option options [Integer] :max_attempts (10) Maximum number of
|
169
|
+
# attempts
|
170
|
+
# @option options [Integer] :delay (10) Delay between each
|
171
|
+
# attempt in seconds
|
172
|
+
# @option options [Proc] :before_attempt (nil) Callback
|
173
|
+
# invoked before each attempt
|
174
|
+
# @option options [Proc] :before_wait (nil) Callback
|
175
|
+
# invoked before each wait
|
176
|
+
# @return [Resource] if the waiter was successful
|
177
|
+
def wait_until(options = {}, &block)
|
178
|
+
self_copy = self.dup
|
179
|
+
attempts = 0
|
180
|
+
options[:max_attempts] = 10 unless options.key?(:max_attempts)
|
181
|
+
options[:delay] ||= 10
|
182
|
+
options[:poller] = Proc.new do
|
183
|
+
attempts += 1
|
184
|
+
if block.call(self_copy)
|
185
|
+
[:success, self_copy]
|
186
|
+
else
|
187
|
+
self_copy.reload unless attempts == options[:max_attempts]
|
188
|
+
:retry
|
189
|
+
end
|
190
|
+
end
|
191
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
192
|
+
end
|
193
|
+
|
99
194
|
# @!group Actions
|
100
195
|
|
101
196
|
# @example Request syntax with placeholder values
|