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.
@@ -42,13 +42,13 @@ module Aws::RDS
42
42
  # A POSIX timestamp when the last log entry was written.
43
43
  # @return [Integer]
44
44
  def last_written
45
- data.last_written
45
+ data[:last_written]
46
46
  end
47
47
 
48
48
  # The size, in bytes, of the log file for the specified DB instance.
49
49
  # @return [Integer]
50
50
  def size
51
- data.size
51
+ data[:size]
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
@@ -35,20 +35,20 @@ module Aws::RDS
35
35
  # 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 parameter
42
42
  # 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 parameter group.
49
49
  # @return [String]
50
50
  def db_parameter_group_arn
51
- data.db_parameter_group_arn
51
+ data[:db_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
@@ -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
@@ -34,37 +34,37 @@ module Aws::RDS
34
34
  # Provides the AWS ID of the owner of a specific DB security group.
35
35
  # @return [String]
36
36
  def owner_id
37
- data.owner_id
37
+ data[:owner_id]
38
38
  end
39
39
 
40
40
  # Provides the description of the DB security group.
41
41
  # @return [String]
42
42
  def db_security_group_description
43
- data.db_security_group_description
43
+ data[:db_security_group_description]
44
44
  end
45
45
 
46
46
  # Provides the VpcId of the DB security group.
47
47
  # @return [String]
48
48
  def vpc_id
49
- data.vpc_id
49
+ data[:vpc_id]
50
50
  end
51
51
 
52
52
  # Contains a list of EC2SecurityGroup elements.
53
53
  # @return [Array<Types::EC2SecurityGroup>]
54
54
  def ec2_security_groups
55
- data.ec2_security_groups
55
+ data[:ec2_security_groups]
56
56
  end
57
57
 
58
58
  # Contains a list of IPRange elements.
59
59
  # @return [Array<Types::IPRange>]
60
60
  def ip_ranges
61
- data.ip_ranges
61
+ data[:ip_ranges]
62
62
  end
63
63
 
64
64
  # The Amazon Resource Name (ARN) for the DB security group.
65
65
  # @return [String]
66
66
  def db_security_group_arn
67
- data.db_security_group_arn
67
+ data[:db_security_group_arn]
68
68
  end
69
69
 
70
70
  # @!endgroup
@@ -102,6 +102,101 @@ module Aws::RDS
102
102
  !!@data
103
103
  end
104
104
 
105
+ # @deprecated Use [Aws::RDS::Client] #wait_until instead
106
+ #
107
+ # Waiter polls an API operation until a resource enters a desired
108
+ # state.
109
+ #
110
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
111
+ #
112
+ # ## Basic Usage
113
+ #
114
+ # Waiter will polls until it is successful, it fails by
115
+ # entering a terminal state, or until a maximum number of attempts
116
+ # are made.
117
+ #
118
+ # # polls in a loop until condition is true
119
+ # resource.wait_until(options) {|resource| condition}
120
+ #
121
+ # ## Example
122
+ #
123
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
124
+ #
125
+ # ## Configuration
126
+ #
127
+ # You can configure the maximum number of polling attempts, and the
128
+ # delay (in seconds) between each polling attempt. The waiting condition is set
129
+ # by passing a block to {#wait_until}:
130
+ #
131
+ # # poll for ~25 seconds
132
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
133
+ #
134
+ # ## Callbacks
135
+ #
136
+ # You can be notified before each polling attempt and before each
137
+ # delay. If you throw `:success` or `:failure` from these callbacks,
138
+ # it will terminate the waiter.
139
+ #
140
+ # started_at = Time.now
141
+ # # poll for 1 hour, instead of a number of attempts
142
+ # proc = Proc.new do |attempts, response|
143
+ # throw :failure if Time.now - started_at > 3600
144
+ # end
145
+ #
146
+ # # disable max attempts
147
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
148
+ #
149
+ # ## Handling Errors
150
+ #
151
+ # When a waiter is successful, it returns the Resource. When a waiter
152
+ # fails, it raises an error.
153
+ #
154
+ # begin
155
+ # resource.wait_until(...)
156
+ # rescue Aws::Waiters::Errors::WaiterFailed
157
+ # # resource did not enter the desired state in time
158
+ # end
159
+ #
160
+ #
161
+ # @yield param [Resource] resource to be used in the waiting condition
162
+ #
163
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
164
+ # because the waiter has entered a state that it will not transition
165
+ # out of, preventing success.
166
+ #
167
+ # yet successful.
168
+ #
169
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
170
+ # while polling for a resource that is not expected.
171
+ #
172
+ # @raise [NotImplementedError] Raised when the resource does not
173
+ #
174
+ # @option options [Integer] :max_attempts (10) Maximum number of
175
+ # attempts
176
+ # @option options [Integer] :delay (10) Delay between each
177
+ # attempt in seconds
178
+ # @option options [Proc] :before_attempt (nil) Callback
179
+ # invoked before each attempt
180
+ # @option options [Proc] :before_wait (nil) Callback
181
+ # invoked before each wait
182
+ # @return [Resource] if the waiter was successful
183
+ def wait_until(options = {}, &block)
184
+ self_copy = self.dup
185
+ attempts = 0
186
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
187
+ options[:delay] ||= 10
188
+ options[:poller] = Proc.new do
189
+ attempts += 1
190
+ if block.call(self_copy)
191
+ [:success, self_copy]
192
+ else
193
+ self_copy.reload unless attempts == options[:max_attempts]
194
+ :retry
195
+ end
196
+ end
197
+ Aws::Waiters::Waiter.new(options).wait({})
198
+ end
199
+
105
200
  # @!group Actions
106
201
 
107
202
  # @example Request syntax with placeholder values