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.
@@ -33,50 +33,50 @@ module Aws::RDS
33
33
  # The description of the option.
34
34
  # @return [String]
35
35
  def description
36
- data.description
36
+ data[:description]
37
37
  end
38
38
 
39
39
  # The name of the engine that this option can be applied to.
40
40
  # @return [String]
41
41
  def engine_name
42
- data.engine_name
42
+ data[:engine_name]
43
43
  end
44
44
 
45
45
  # Indicates the major engine version that the option is available for.
46
46
  # @return [String]
47
47
  def major_engine_version
48
- data.major_engine_version
48
+ data[:major_engine_version]
49
49
  end
50
50
 
51
51
  # The minimum required engine version for the option to be applied.
52
52
  # @return [String]
53
53
  def minimum_required_minor_engine_version
54
- data.minimum_required_minor_engine_version
54
+ data[:minimum_required_minor_engine_version]
55
55
  end
56
56
 
57
57
  # Specifies whether the option requires a port.
58
58
  # @return [Boolean]
59
59
  def port_required
60
- data.port_required
60
+ data[:port_required]
61
61
  end
62
62
 
63
63
  # If the option requires a port, specifies the default port for the
64
64
  # option.
65
65
  # @return [Integer]
66
66
  def default_port
67
- data.default_port
67
+ data[:default_port]
68
68
  end
69
69
 
70
70
  # The options that are prerequisites for this option.
71
71
  # @return [Array<String>]
72
72
  def options_depended_on
73
- data.options_depended_on
73
+ data[:options_depended_on]
74
74
  end
75
75
 
76
76
  # The options that conflict with this option.
77
77
  # @return [Array<String>]
78
78
  def options_conflicts_with
79
- data.options_conflicts_with
79
+ data[:options_conflicts_with]
80
80
  end
81
81
 
82
82
  # Persistent options can't be removed from an option group while DB
@@ -85,7 +85,7 @@ module Aws::RDS
85
85
  # option from the option group.
86
86
  # @return [Boolean]
87
87
  def persistent
88
- data.persistent
88
+ data[:persistent]
89
89
  end
90
90
 
91
91
  # Permanent options can never be removed from an option group. An option
@@ -93,7 +93,7 @@ module Aws::RDS
93
93
  # instance.
94
94
  # @return [Boolean]
95
95
  def permanent
96
- data.permanent
96
+ data[:permanent]
97
97
  end
98
98
 
99
99
  # If true, you must enable the Auto Minor Version Upgrade setting for
@@ -102,14 +102,14 @@ module Aws::RDS
102
102
  # modifying your DB instance later.
103
103
  # @return [Boolean]
104
104
  def requires_auto_minor_engine_version_upgrade
105
- data.requires_auto_minor_engine_version_upgrade
105
+ data[:requires_auto_minor_engine_version_upgrade]
106
106
  end
107
107
 
108
108
  # If true, you can only use this option with a DB instance that is in a
109
109
  # VPC.
110
110
  # @return [Boolean]
111
111
  def vpc_only
112
- data.vpc_only
112
+ data[:vpc_only]
113
113
  end
114
114
 
115
115
  # If true, you can change the option to an earlier version of the
@@ -117,20 +117,20 @@ module Aws::RDS
117
117
  # available.
118
118
  # @return [Boolean]
119
119
  def supports_option_version_downgrade
120
- data.supports_option_version_downgrade
120
+ data[:supports_option_version_downgrade]
121
121
  end
122
122
 
123
123
  # The option settings that are available (and the default value) for
124
124
  # each option in an option group.
125
125
  # @return [Array<Types::OptionGroupOptionSetting>]
126
126
  def option_group_option_settings
127
- data.option_group_option_settings
127
+ data[:option_group_option_settings]
128
128
  end
129
129
 
130
130
  # The versions that are available for the option.
131
131
  # @return [Array<Types::OptionVersion>]
132
132
  def option_group_option_versions
133
- data.option_group_option_versions
133
+ data[:option_group_option_versions]
134
134
  end
135
135
 
136
136
  # @!endgroup
@@ -163,6 +163,101 @@ module Aws::RDS
163
163
  !!@data
164
164
  end
165
165
 
166
+ # @deprecated Use [Aws::RDS::Client] #wait_until instead
167
+ #
168
+ # Waiter polls an API operation until a resource enters a desired
169
+ # state.
170
+ #
171
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
172
+ #
173
+ # ## Basic Usage
174
+ #
175
+ # Waiter will polls until it is successful, it fails by
176
+ # entering a terminal state, or until a maximum number of attempts
177
+ # are made.
178
+ #
179
+ # # polls in a loop until condition is true
180
+ # resource.wait_until(options) {|resource| condition}
181
+ #
182
+ # ## Example
183
+ #
184
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
185
+ #
186
+ # ## Configuration
187
+ #
188
+ # You can configure the maximum number of polling attempts, and the
189
+ # delay (in seconds) between each polling attempt. The waiting condition is set
190
+ # by passing a block to {#wait_until}:
191
+ #
192
+ # # poll for ~25 seconds
193
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
194
+ #
195
+ # ## Callbacks
196
+ #
197
+ # You can be notified before each polling attempt and before each
198
+ # delay. If you throw `:success` or `:failure` from these callbacks,
199
+ # it will terminate the waiter.
200
+ #
201
+ # started_at = Time.now
202
+ # # poll for 1 hour, instead of a number of attempts
203
+ # proc = Proc.new do |attempts, response|
204
+ # throw :failure if Time.now - started_at > 3600
205
+ # end
206
+ #
207
+ # # disable max attempts
208
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
209
+ #
210
+ # ## Handling Errors
211
+ #
212
+ # When a waiter is successful, it returns the Resource. When a waiter
213
+ # fails, it raises an error.
214
+ #
215
+ # begin
216
+ # resource.wait_until(...)
217
+ # rescue Aws::Waiters::Errors::WaiterFailed
218
+ # # resource did not enter the desired state in time
219
+ # end
220
+ #
221
+ #
222
+ # @yield param [Resource] resource to be used in the waiting condition
223
+ #
224
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
225
+ # because the waiter has entered a state that it will not transition
226
+ # out of, preventing success.
227
+ #
228
+ # yet successful.
229
+ #
230
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
231
+ # while polling for a resource that is not expected.
232
+ #
233
+ # @raise [NotImplementedError] Raised when the resource does not
234
+ #
235
+ # @option options [Integer] :max_attempts (10) Maximum number of
236
+ # attempts
237
+ # @option options [Integer] :delay (10) Delay between each
238
+ # attempt in seconds
239
+ # @option options [Proc] :before_attempt (nil) Callback
240
+ # invoked before each attempt
241
+ # @option options [Proc] :before_wait (nil) Callback
242
+ # invoked before each wait
243
+ # @return [Resource] if the waiter was successful
244
+ def wait_until(options = {}, &block)
245
+ self_copy = self.dup
246
+ attempts = 0
247
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
248
+ options[:delay] ||= 10
249
+ options[:poller] = Proc.new do
250
+ attempts += 1
251
+ if block.call(self_copy)
252
+ [:success, self_copy]
253
+ else
254
+ self_copy.reload unless attempts == options[:max_attempts]
255
+ :retry
256
+ end
257
+ end
258
+ Aws::Waiters::Waiter.new(options).wait({})
259
+ end
260
+
166
261
  # @deprecated
167
262
  # @api private
168
263
  def identifiers
@@ -34,37 +34,37 @@ module Aws::RDS
34
34
  # Specifies the value of the parameter.
35
35
  # @return [String]
36
36
  def parameter_value
37
- data.parameter_value
37
+ data[:parameter_value]
38
38
  end
39
39
 
40
40
  # Provides a description of the parameter.
41
41
  # @return [String]
42
42
  def description
43
- data.description
43
+ data[:description]
44
44
  end
45
45
 
46
46
  # Indicates the source of the parameter value.
47
47
  # @return [String]
48
48
  def source
49
- data.source
49
+ data[:source]
50
50
  end
51
51
 
52
52
  # Specifies the engine specific parameters type.
53
53
  # @return [String]
54
54
  def apply_type
55
- data.apply_type
55
+ data[:apply_type]
56
56
  end
57
57
 
58
58
  # Specifies the valid data type for the parameter.
59
59
  # @return [String]
60
60
  def data_type
61
- data.data_type
61
+ data[:data_type]
62
62
  end
63
63
 
64
64
  # Specifies the valid range of values for the parameter.
65
65
  # @return [String]
66
66
  def allowed_values
67
- data.allowed_values
67
+ data[:allowed_values]
68
68
  end
69
69
 
70
70
  # Indicates whether (`true`) or not (`false`) the parameter can be
@@ -72,19 +72,19 @@ module Aws::RDS
72
72
  # that prevent them from being changed.
73
73
  # @return [Boolean]
74
74
  def is_modifiable
75
- data.is_modifiable
75
+ data[:is_modifiable]
76
76
  end
77
77
 
78
78
  # The earliest engine version to which the parameter can apply.
79
79
  # @return [String]
80
80
  def minimum_engine_version
81
- data.minimum_engine_version
81
+ data[:minimum_engine_version]
82
82
  end
83
83
 
84
84
  # Indicates when to apply parameter updates.
85
85
  # @return [String]
86
86
  def apply_method
87
- data.apply_method
87
+ data[:apply_method]
88
88
  end
89
89
 
90
90
  # @!endgroup
@@ -117,6 +117,101 @@ module Aws::RDS
117
117
  !!@data
118
118
  end
119
119
 
120
+ # @deprecated Use [Aws::RDS::Client] #wait_until instead
121
+ #
122
+ # Waiter polls an API operation until a resource enters a desired
123
+ # state.
124
+ #
125
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
126
+ #
127
+ # ## Basic Usage
128
+ #
129
+ # Waiter will polls until it is successful, it fails by
130
+ # entering a terminal state, or until a maximum number of attempts
131
+ # are made.
132
+ #
133
+ # # polls in a loop until condition is true
134
+ # resource.wait_until(options) {|resource| condition}
135
+ #
136
+ # ## Example
137
+ #
138
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
139
+ #
140
+ # ## Configuration
141
+ #
142
+ # You can configure the maximum number of polling attempts, and the
143
+ # delay (in seconds) between each polling attempt. The waiting condition is set
144
+ # by passing a block to {#wait_until}:
145
+ #
146
+ # # poll for ~25 seconds
147
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
148
+ #
149
+ # ## Callbacks
150
+ #
151
+ # You can be notified before each polling attempt and before each
152
+ # delay. If you throw `:success` or `:failure` from these callbacks,
153
+ # it will terminate the waiter.
154
+ #
155
+ # started_at = Time.now
156
+ # # poll for 1 hour, instead of a number of attempts
157
+ # proc = Proc.new do |attempts, response|
158
+ # throw :failure if Time.now - started_at > 3600
159
+ # end
160
+ #
161
+ # # disable max attempts
162
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
163
+ #
164
+ # ## Handling Errors
165
+ #
166
+ # When a waiter is successful, it returns the Resource. When a waiter
167
+ # fails, it raises an error.
168
+ #
169
+ # begin
170
+ # resource.wait_until(...)
171
+ # rescue Aws::Waiters::Errors::WaiterFailed
172
+ # # resource did not enter the desired state in time
173
+ # end
174
+ #
175
+ #
176
+ # @yield param [Resource] resource to be used in the waiting condition
177
+ #
178
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
179
+ # because the waiter has entered a state that it will not transition
180
+ # out of, preventing success.
181
+ #
182
+ # yet successful.
183
+ #
184
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
185
+ # while polling for a resource that is not expected.
186
+ #
187
+ # @raise [NotImplementedError] Raised when the resource does not
188
+ #
189
+ # @option options [Integer] :max_attempts (10) Maximum number of
190
+ # attempts
191
+ # @option options [Integer] :delay (10) Delay between each
192
+ # attempt in seconds
193
+ # @option options [Proc] :before_attempt (nil) Callback
194
+ # invoked before each attempt
195
+ # @option options [Proc] :before_wait (nil) Callback
196
+ # invoked before each wait
197
+ # @return [Resource] if the waiter was successful
198
+ def wait_until(options = {}, &block)
199
+ self_copy = self.dup
200
+ attempts = 0
201
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
202
+ options[:delay] ||= 10
203
+ options[:poller] = Proc.new do
204
+ attempts += 1
205
+ if block.call(self_copy)
206
+ [:success, self_copy]
207
+ else
208
+ self_copy.reload unless attempts == options[:max_attempts]
209
+ :retry
210
+ end
211
+ end
212
+ Aws::Waiters::Waiter.new(options).wait({})
213
+ end
214
+
120
215
  # @deprecated
121
216
  # @api private
122
217
  def identifiers
@@ -45,7 +45,7 @@ module Aws::RDS
45
45
  # any `next-maintenance` opt-in requests are ignored.
46
46
  # @return [Time]
47
47
  def auto_applied_after_date
48
- data.auto_applied_after_date
48
+ data[:auto_applied_after_date]
49
49
  end
50
50
 
51
51
  # The date when the maintenance action will be automatically applied.
@@ -54,14 +54,14 @@ module Aws::RDS
54
54
  # specified, any `immediate` opt-in requests are ignored.
55
55
  # @return [Time]
56
56
  def forced_apply_date
57
- data.forced_apply_date
57
+ data[:forced_apply_date]
58
58
  end
59
59
 
60
60
  # Indicates the type of opt-in request that has been received for the
61
61
  # resource.
62
62
  # @return [String]
63
63
  def opt_in_status
64
- data.opt_in_status
64
+ data[:opt_in_status]
65
65
  end
66
66
 
67
67
  # The effective date when the pending maintenance action will be applied
@@ -72,13 +72,13 @@ module Aws::RDS
72
72
  # specified as `AutoAppliedAfterDate` or `ForcedApplyDate`.
73
73
  # @return [Time]
74
74
  def current_apply_date
75
- data.current_apply_date
75
+ data[:current_apply_date]
76
76
  end
77
77
 
78
78
  # A description providing more detail about the maintenance action.
79
79
  # @return [String]
80
80
  def description
81
- data.description
81
+ data[:description]
82
82
  end
83
83
 
84
84
  # @!endgroup
@@ -111,6 +111,101 @@ module Aws::RDS
111
111
  !!@data
112
112
  end
113
113
 
114
+ # @deprecated Use [Aws::RDS::Client] #wait_until instead
115
+ #
116
+ # Waiter polls an API operation until a resource enters a desired
117
+ # state.
118
+ #
119
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
120
+ #
121
+ # ## Basic Usage
122
+ #
123
+ # Waiter will polls until it is successful, it fails by
124
+ # entering a terminal state, or until a maximum number of attempts
125
+ # are made.
126
+ #
127
+ # # polls in a loop until condition is true
128
+ # resource.wait_until(options) {|resource| condition}
129
+ #
130
+ # ## Example
131
+ #
132
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
133
+ #
134
+ # ## Configuration
135
+ #
136
+ # You can configure the maximum number of polling attempts, and the
137
+ # delay (in seconds) between each polling attempt. The waiting condition is set
138
+ # by passing a block to {#wait_until}:
139
+ #
140
+ # # poll for ~25 seconds
141
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
142
+ #
143
+ # ## Callbacks
144
+ #
145
+ # You can be notified before each polling attempt and before each
146
+ # delay. If you throw `:success` or `:failure` from these callbacks,
147
+ # it will terminate the waiter.
148
+ #
149
+ # started_at = Time.now
150
+ # # poll for 1 hour, instead of a number of attempts
151
+ # proc = Proc.new do |attempts, response|
152
+ # throw :failure if Time.now - started_at > 3600
153
+ # end
154
+ #
155
+ # # disable max attempts
156
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
157
+ #
158
+ # ## Handling Errors
159
+ #
160
+ # When a waiter is successful, it returns the Resource. When a waiter
161
+ # fails, it raises an error.
162
+ #
163
+ # begin
164
+ # resource.wait_until(...)
165
+ # rescue Aws::Waiters::Errors::WaiterFailed
166
+ # # resource did not enter the desired state in time
167
+ # end
168
+ #
169
+ #
170
+ # @yield param [Resource] resource to be used in the waiting condition
171
+ #
172
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
173
+ # because the waiter has entered a state that it will not transition
174
+ # out of, preventing success.
175
+ #
176
+ # yet successful.
177
+ #
178
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
179
+ # while polling for a resource that is not expected.
180
+ #
181
+ # @raise [NotImplementedError] Raised when the resource does not
182
+ #
183
+ # @option options [Integer] :max_attempts (10) Maximum number of
184
+ # attempts
185
+ # @option options [Integer] :delay (10) Delay between each
186
+ # attempt in seconds
187
+ # @option options [Proc] :before_attempt (nil) Callback
188
+ # invoked before each attempt
189
+ # @option options [Proc] :before_wait (nil) Callback
190
+ # invoked before each wait
191
+ # @return [Resource] if the waiter was successful
192
+ def wait_until(options = {}, &block)
193
+ self_copy = self.dup
194
+ attempts = 0
195
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
196
+ options[:delay] ||= 10
197
+ options[:poller] = Proc.new do
198
+ attempts += 1
199
+ if block.call(self_copy)
200
+ [:success, self_copy]
201
+ else
202
+ self_copy.reload unless attempts == options[:max_attempts]
203
+ :retry
204
+ end
205
+ end
206
+ Aws::Waiters::Waiter.new(options).wait({})
207
+ end
208
+
114
209
  # @!group Actions
115
210
 
116
211
  # @example Request syntax with placeholder values