aws-sdk-rds 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,20 +35,20 @@ module Aws::RDS
35
35
  # cluster parameter group is compatible with.
36
36
  # @return [String]
37
37
  def db_parameter_group_family
38
- data.db_parameter_group_family
38
+ data[:db_parameter_group_family]
39
39
  end
40
40
 
41
41
  # Provides the customer-specified description for this DB cluster
42
42
  # parameter group.
43
43
  # @return [String]
44
44
  def description
45
- data.description
45
+ data[:description]
46
46
  end
47
47
 
48
48
  # The Amazon Resource Name (ARN) for the DB cluster parameter group.
49
49
  # @return [String]
50
50
  def db_cluster_parameter_group_arn
51
- data.db_cluster_parameter_group_arn
51
+ data[:db_cluster_parameter_group_arn]
52
52
  end
53
53
 
54
54
  # @!endgroup
@@ -86,6 +86,101 @@ module Aws::RDS
86
86
  !!@data
87
87
  end
88
88
 
89
+ # @deprecated Use [Aws::RDS::Client] #wait_until instead
90
+ #
91
+ # Waiter polls an API operation until a resource enters a desired
92
+ # state.
93
+ #
94
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
95
+ #
96
+ # ## Basic Usage
97
+ #
98
+ # Waiter will polls until it is successful, it fails by
99
+ # entering a terminal state, or until a maximum number of attempts
100
+ # are made.
101
+ #
102
+ # # polls in a loop until condition is true
103
+ # resource.wait_until(options) {|resource| condition}
104
+ #
105
+ # ## Example
106
+ #
107
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
108
+ #
109
+ # ## Configuration
110
+ #
111
+ # You can configure the maximum number of polling attempts, and the
112
+ # delay (in seconds) between each polling attempt. The waiting condition is set
113
+ # by passing a block to {#wait_until}:
114
+ #
115
+ # # poll for ~25 seconds
116
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
117
+ #
118
+ # ## Callbacks
119
+ #
120
+ # You can be notified before each polling attempt and before each
121
+ # delay. If you throw `:success` or `:failure` from these callbacks,
122
+ # it will terminate the waiter.
123
+ #
124
+ # started_at = Time.now
125
+ # # poll for 1 hour, instead of a number of attempts
126
+ # proc = Proc.new do |attempts, response|
127
+ # throw :failure if Time.now - started_at > 3600
128
+ # end
129
+ #
130
+ # # disable max attempts
131
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
132
+ #
133
+ # ## Handling Errors
134
+ #
135
+ # When a waiter is successful, it returns the Resource. When a waiter
136
+ # fails, it raises an error.
137
+ #
138
+ # begin
139
+ # resource.wait_until(...)
140
+ # rescue Aws::Waiters::Errors::WaiterFailed
141
+ # # resource did not enter the desired state in time
142
+ # end
143
+ #
144
+ #
145
+ # @yield param [Resource] resource to be used in the waiting condition
146
+ #
147
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
148
+ # because the waiter has entered a state that it will not transition
149
+ # out of, preventing success.
150
+ #
151
+ # yet successful.
152
+ #
153
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
154
+ # while polling for a resource that is not expected.
155
+ #
156
+ # @raise [NotImplementedError] Raised when the resource does not
157
+ #
158
+ # @option options [Integer] :max_attempts (10) Maximum number of
159
+ # attempts
160
+ # @option options [Integer] :delay (10) Delay between each
161
+ # attempt in seconds
162
+ # @option options [Proc] :before_attempt (nil) Callback
163
+ # invoked before each attempt
164
+ # @option options [Proc] :before_wait (nil) Callback
165
+ # invoked before each wait
166
+ # @return [Resource] if the waiter was successful
167
+ def wait_until(options = {}, &block)
168
+ self_copy = self.dup
169
+ attempts = 0
170
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
171
+ options[:delay] ||= 10
172
+ options[:poller] = Proc.new do
173
+ attempts += 1
174
+ if block.call(self_copy)
175
+ [:success, self_copy]
176
+ else
177
+ self_copy.reload unless attempts == options[:max_attempts]
178
+ :retry
179
+ end
180
+ end
181
+ Aws::Waiters::Waiter.new(options).wait({})
182
+ end
183
+
89
184
  # @!group Actions
90
185
 
91
186
  # @example Request syntax with placeholder values
@@ -44,103 +44,103 @@ module Aws::RDS
44
44
  # cluster snapshot can be restored in.
45
45
  # @return [Array<String>]
46
46
  def availability_zones
47
- data.availability_zones
47
+ data[:availability_zones]
48
48
  end
49
49
 
50
50
  # Provides the time when the snapshot was taken, in Universal
51
51
  # Coordinated Time (UTC).
52
52
  # @return [Time]
53
53
  def snapshot_create_time
54
- data.snapshot_create_time
54
+ data[:snapshot_create_time]
55
55
  end
56
56
 
57
57
  # Specifies the name of the database engine.
58
58
  # @return [String]
59
59
  def engine
60
- data.engine
60
+ data[:engine]
61
61
  end
62
62
 
63
63
  # Specifies the allocated storage size in gigabytes (GB).
64
64
  # @return [Integer]
65
65
  def allocated_storage
66
- data.allocated_storage
66
+ data[:allocated_storage]
67
67
  end
68
68
 
69
69
  # Specifies the status of this DB cluster snapshot.
70
70
  # @return [String]
71
71
  def status
72
- data.status
72
+ data[:status]
73
73
  end
74
74
 
75
75
  # Specifies the port that the DB cluster was listening on at the time of
76
76
  # the snapshot.
77
77
  # @return [Integer]
78
78
  def port
79
- data.port
79
+ data[:port]
80
80
  end
81
81
 
82
82
  # Provides the VPC ID associated with the DB cluster snapshot.
83
83
  # @return [String]
84
84
  def vpc_id
85
- data.vpc_id
85
+ data[:vpc_id]
86
86
  end
87
87
 
88
88
  # Specifies the time when the DB cluster was created, in Universal
89
89
  # Coordinated Time (UTC).
90
90
  # @return [Time]
91
91
  def cluster_create_time
92
- data.cluster_create_time
92
+ data[:cluster_create_time]
93
93
  end
94
94
 
95
95
  # Provides the master username for the DB cluster snapshot.
96
96
  # @return [String]
97
97
  def master_username
98
- data.master_username
98
+ data[:master_username]
99
99
  end
100
100
 
101
101
  # Provides the version of the database engine for this DB cluster
102
102
  # snapshot.
103
103
  # @return [String]
104
104
  def engine_version
105
- data.engine_version
105
+ data[:engine_version]
106
106
  end
107
107
 
108
108
  # Provides the license model information for this DB cluster snapshot.
109
109
  # @return [String]
110
110
  def license_model
111
- data.license_model
111
+ data[:license_model]
112
112
  end
113
113
 
114
114
  # Provides the type of the DB cluster snapshot.
115
115
  # @return [String]
116
116
  def snapshot_type
117
- data.snapshot_type
117
+ data[:snapshot_type]
118
118
  end
119
119
 
120
120
  # Specifies the percentage of the estimated data that has been
121
121
  # transferred.
122
122
  # @return [Integer]
123
123
  def percent_progress
124
- data.percent_progress
124
+ data[:percent_progress]
125
125
  end
126
126
 
127
127
  # Specifies whether the DB cluster snapshot is encrypted.
128
128
  # @return [Boolean]
129
129
  def storage_encrypted
130
- data.storage_encrypted
130
+ data[:storage_encrypted]
131
131
  end
132
132
 
133
133
  # If `StorageEncrypted` is true, the KMS key identifier for the
134
134
  # encrypted DB cluster snapshot.
135
135
  # @return [String]
136
136
  def kms_key_id
137
- data.kms_key_id
137
+ data[:kms_key_id]
138
138
  end
139
139
 
140
140
  # The Amazon Resource Name (ARN) for the DB cluster snapshot.
141
141
  # @return [String]
142
142
  def db_cluster_snapshot_arn
143
- data.db_cluster_snapshot_arn
143
+ data[:db_cluster_snapshot_arn]
144
144
  end
145
145
 
146
146
  # If the DB cluster snapshot was copied from a source DB cluster
@@ -148,14 +148,14 @@ module Aws::RDS
148
148
  # snapshot; otherwise, a null value.
149
149
  # @return [String]
150
150
  def source_db_cluster_snapshot_arn
151
- data.source_db_cluster_snapshot_arn
151
+ data[:source_db_cluster_snapshot_arn]
152
152
  end
153
153
 
154
154
  # True if mapping of AWS Identity and Access Management (IAM) accounts
155
155
  # to database accounts is enabled; otherwise false.
156
156
  # @return [Boolean]
157
157
  def iam_database_authentication_enabled
158
- data.iam_database_authentication_enabled
158
+ data[:iam_database_authentication_enabled]
159
159
  end
160
160
 
161
161
  # @!endgroup
@@ -193,6 +193,101 @@ module Aws::RDS
193
193
  !!@data
194
194
  end
195
195
 
196
+ # @deprecated Use [Aws::RDS::Client] #wait_until instead
197
+ #
198
+ # Waiter polls an API operation until a resource enters a desired
199
+ # state.
200
+ #
201
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
202
+ #
203
+ # ## Basic Usage
204
+ #
205
+ # Waiter will polls until it is successful, it fails by
206
+ # entering a terminal state, or until a maximum number of attempts
207
+ # are made.
208
+ #
209
+ # # polls in a loop until condition is true
210
+ # resource.wait_until(options) {|resource| condition}
211
+ #
212
+ # ## Example
213
+ #
214
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
215
+ #
216
+ # ## Configuration
217
+ #
218
+ # You can configure the maximum number of polling attempts, and the
219
+ # delay (in seconds) between each polling attempt. The waiting condition is set
220
+ # by passing a block to {#wait_until}:
221
+ #
222
+ # # poll for ~25 seconds
223
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
224
+ #
225
+ # ## Callbacks
226
+ #
227
+ # You can be notified before each polling attempt and before each
228
+ # delay. If you throw `:success` or `:failure` from these callbacks,
229
+ # it will terminate the waiter.
230
+ #
231
+ # started_at = Time.now
232
+ # # poll for 1 hour, instead of a number of attempts
233
+ # proc = Proc.new do |attempts, response|
234
+ # throw :failure if Time.now - started_at > 3600
235
+ # end
236
+ #
237
+ # # disable max attempts
238
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
239
+ #
240
+ # ## Handling Errors
241
+ #
242
+ # When a waiter is successful, it returns the Resource. When a waiter
243
+ # fails, it raises an error.
244
+ #
245
+ # begin
246
+ # resource.wait_until(...)
247
+ # rescue Aws::Waiters::Errors::WaiterFailed
248
+ # # resource did not enter the desired state in time
249
+ # end
250
+ #
251
+ #
252
+ # @yield param [Resource] resource to be used in the waiting condition
253
+ #
254
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
255
+ # because the waiter has entered a state that it will not transition
256
+ # out of, preventing success.
257
+ #
258
+ # yet successful.
259
+ #
260
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
261
+ # while polling for a resource that is not expected.
262
+ #
263
+ # @raise [NotImplementedError] Raised when the resource does not
264
+ #
265
+ # @option options [Integer] :max_attempts (10) Maximum number of
266
+ # attempts
267
+ # @option options [Integer] :delay (10) Delay between each
268
+ # attempt in seconds
269
+ # @option options [Proc] :before_attempt (nil) Callback
270
+ # invoked before each attempt
271
+ # @option options [Proc] :before_wait (nil) Callback
272
+ # invoked before each wait
273
+ # @return [Resource] if the waiter was successful
274
+ def wait_until(options = {}, &block)
275
+ self_copy = self.dup
276
+ attempts = 0
277
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
278
+ options[:delay] ||= 10
279
+ options[:poller] = Proc.new do
280
+ attempts += 1
281
+ if block.call(self_copy)
282
+ [:success, self_copy]
283
+ else
284
+ self_copy.reload unless attempts == options[:max_attempts]
285
+ :retry
286
+ end
287
+ end
288
+ Aws::Waiters::Waiter.new(options).wait({})
289
+ end
290
+
196
291
  # @!group Actions
197
292
 
198
293
  # @example Request syntax with placeholder values
@@ -58,6 +58,101 @@ module Aws::RDS
58
58
  !!@data
59
59
  end
60
60
 
61
+ # @deprecated Use [Aws::RDS::Client] #wait_until instead
62
+ #
63
+ # Waiter polls an API operation until a resource enters a desired
64
+ # state.
65
+ #
66
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
67
+ #
68
+ # ## Basic Usage
69
+ #
70
+ # Waiter will polls until it is successful, it fails by
71
+ # entering a terminal state, or until a maximum number of attempts
72
+ # are made.
73
+ #
74
+ # # polls in a loop until condition is true
75
+ # resource.wait_until(options) {|resource| condition}
76
+ #
77
+ # ## Example
78
+ #
79
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
80
+ #
81
+ # ## Configuration
82
+ #
83
+ # You can configure the maximum number of polling attempts, and the
84
+ # delay (in seconds) between each polling attempt. The waiting condition is set
85
+ # by passing a block to {#wait_until}:
86
+ #
87
+ # # poll for ~25 seconds
88
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
89
+ #
90
+ # ## Callbacks
91
+ #
92
+ # You can be notified before each polling attempt and before each
93
+ # delay. If you throw `:success` or `:failure` from these callbacks,
94
+ # it will terminate the waiter.
95
+ #
96
+ # started_at = Time.now
97
+ # # poll for 1 hour, instead of a number of attempts
98
+ # proc = Proc.new do |attempts, response|
99
+ # throw :failure if Time.now - started_at > 3600
100
+ # end
101
+ #
102
+ # # disable max attempts
103
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
104
+ #
105
+ # ## Handling Errors
106
+ #
107
+ # When a waiter is successful, it returns the Resource. When a waiter
108
+ # fails, it raises an error.
109
+ #
110
+ # begin
111
+ # resource.wait_until(...)
112
+ # rescue Aws::Waiters::Errors::WaiterFailed
113
+ # # resource did not enter the desired state in time
114
+ # end
115
+ #
116
+ #
117
+ # @yield param [Resource] resource to be used in the waiting condition
118
+ #
119
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
120
+ # because the waiter has entered a state that it will not transition
121
+ # out of, preventing success.
122
+ #
123
+ # yet successful.
124
+ #
125
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
126
+ # while polling for a resource that is not expected.
127
+ #
128
+ # @raise [NotImplementedError] Raised when the resource does not
129
+ #
130
+ # @option options [Integer] :max_attempts (10) Maximum number of
131
+ # attempts
132
+ # @option options [Integer] :delay (10) Delay between each
133
+ # attempt in seconds
134
+ # @option options [Proc] :before_attempt (nil) Callback
135
+ # invoked before each attempt
136
+ # @option options [Proc] :before_wait (nil) Callback
137
+ # invoked before each wait
138
+ # @return [Resource] if the waiter was successful
139
+ def wait_until(options = {}, &block)
140
+ self_copy = self.dup
141
+ attempts = 0
142
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
143
+ options[:delay] ||= 10
144
+ options[:poller] = Proc.new do
145
+ attempts += 1
146
+ if block.call(self_copy)
147
+ [:success, self_copy]
148
+ else
149
+ self_copy.reload unless attempts == options[:max_attempts]
150
+ :retry
151
+ end
152
+ end
153
+ Aws::Waiters::Waiter.new(options).wait({})
154
+ end
155
+
61
156
  # @!group Associations
62
157
 
63
158
  # @example Request syntax with placeholder values