aws-sdk-elasticbeanstalk 1.31.0 → 1.36.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,210 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ require 'aws-sdk-core/waiters'
11
+
12
+ module Aws::ElasticBeanstalk
13
+ # Waiters are utility methods that poll for a particular state to occur
14
+ # on a client. Waiters can fail after a number of attempts at a polling
15
+ # interval defined for the service client.
16
+ #
17
+ # For a list of operations that can be waited for and the
18
+ # client methods called for each operation, see the table below or the
19
+ # {Client#wait_until} field documentation for the {Client}.
20
+ #
21
+ # # Invoking a Waiter
22
+ # To invoke a waiter, call #wait_until on a {Client}. The first parameter
23
+ # is the waiter name, which is specific to the service client and indicates
24
+ # which operation is being waited for. The second parameter is a hash of
25
+ # parameters that are passed to the client method called by the waiter,
26
+ # which varies according to the waiter name.
27
+ #
28
+ # # Wait Failures
29
+ # To catch errors in a waiter, use WaiterFailed,
30
+ # as shown in the following example.
31
+ #
32
+ # rescue rescue Aws::Waiters::Errors::WaiterFailed => error
33
+ # puts "failed waiting for instance running: #{error.message}
34
+ # end
35
+ #
36
+ # # Configuring a Waiter
37
+ # Each waiter has a default polling interval and a maximum number of
38
+ # attempts it will make before returning control to your program.
39
+ # To set these values, use the `max_attempts` and `delay` parameters
40
+ # in your `#wait_until` call.
41
+ # The following example waits for up to 25 seconds, polling every five seconds.
42
+ #
43
+ # client.wait_until(...) do |w|
44
+ # w.max_attempts = 5
45
+ # w.delay = 5
46
+ # end
47
+ #
48
+ # To disable wait failures, set the value of either of these parameters
49
+ # to `nil`.
50
+ #
51
+ # # Extending a Waiter
52
+ # To modify the behavior of waiters, you can register callbacks that are
53
+ # triggered before each polling attempt and before waiting.
54
+ #
55
+ # The following example implements an exponential backoff in a waiter
56
+ # by doubling the amount of time to wait on every attempt.
57
+ #
58
+ # client.wait_until(...) do |w|
59
+ # w.interval = 0 # disable normal sleep
60
+ # w.before_wait do |n, resp|
61
+ # sleep(n ** 2)
62
+ # end
63
+ # end
64
+ #
65
+ # # Available Waiters
66
+ #
67
+ # The following table lists the valid waiter names, the operations they call,
68
+ # and the default `:delay` and `:max_attempts` values.
69
+ #
70
+ # | waiter_name | params | :delay | :max_attempts |
71
+ # | ---------------------- | ------------------------------ | -------- | ------------- |
72
+ # | environment_exists | {Client#describe_environments} | 20 | 20 |
73
+ # | environment_terminated | {Client#describe_environments} | 20 | 20 |
74
+ # | environment_updated | {Client#describe_environments} | 20 | 20 |
75
+ #
76
+ module Waiters
77
+
78
+ class EnvironmentExists
79
+
80
+ # @param [Hash] options
81
+ # @option options [required, Client] :client
82
+ # @option options [Integer] :max_attempts (20)
83
+ # @option options [Integer] :delay (20)
84
+ # @option options [Proc] :before_attempt
85
+ # @option options [Proc] :before_wait
86
+ def initialize(options)
87
+ @client = options.fetch(:client)
88
+ @waiter = Aws::Waiters::Waiter.new({
89
+ max_attempts: 20,
90
+ delay: 20,
91
+ poller: Aws::Waiters::Poller.new(
92
+ operation_name: :describe_environments,
93
+ acceptors: [
94
+ {
95
+ "state" => "success",
96
+ "matcher" => "pathAll",
97
+ "argument" => "environments[].status",
98
+ "expected" => "Ready"
99
+ },
100
+ {
101
+ "state" => "retry",
102
+ "matcher" => "pathAll",
103
+ "argument" => "environments[].status",
104
+ "expected" => "Launching"
105
+ }
106
+ ]
107
+ )
108
+ }.merge(options))
109
+ end
110
+
111
+ # @option (see Client#describe_environments)
112
+ # @return (see Client#describe_environments)
113
+ def wait(params = {})
114
+ @waiter.wait(client: @client, params: params)
115
+ end
116
+
117
+ # @api private
118
+ attr_reader :waiter
119
+
120
+ end
121
+
122
+ class EnvironmentTerminated
123
+
124
+ # @param [Hash] options
125
+ # @option options [required, Client] :client
126
+ # @option options [Integer] :max_attempts (20)
127
+ # @option options [Integer] :delay (20)
128
+ # @option options [Proc] :before_attempt
129
+ # @option options [Proc] :before_wait
130
+ def initialize(options)
131
+ @client = options.fetch(:client)
132
+ @waiter = Aws::Waiters::Waiter.new({
133
+ max_attempts: 20,
134
+ delay: 20,
135
+ poller: Aws::Waiters::Poller.new(
136
+ operation_name: :describe_environments,
137
+ acceptors: [
138
+ {
139
+ "state" => "success",
140
+ "matcher" => "pathAll",
141
+ "argument" => "environments[].status",
142
+ "expected" => "Terminated"
143
+ },
144
+ {
145
+ "state" => "retry",
146
+ "matcher" => "pathAll",
147
+ "argument" => "environments[].status",
148
+ "expected" => "Terminating"
149
+ }
150
+ ]
151
+ )
152
+ }.merge(options))
153
+ end
154
+
155
+ # @option (see Client#describe_environments)
156
+ # @return (see Client#describe_environments)
157
+ def wait(params = {})
158
+ @waiter.wait(client: @client, params: params)
159
+ end
160
+
161
+ # @api private
162
+ attr_reader :waiter
163
+
164
+ end
165
+
166
+ class EnvironmentUpdated
167
+
168
+ # @param [Hash] options
169
+ # @option options [required, Client] :client
170
+ # @option options [Integer] :max_attempts (20)
171
+ # @option options [Integer] :delay (20)
172
+ # @option options [Proc] :before_attempt
173
+ # @option options [Proc] :before_wait
174
+ def initialize(options)
175
+ @client = options.fetch(:client)
176
+ @waiter = Aws::Waiters::Waiter.new({
177
+ max_attempts: 20,
178
+ delay: 20,
179
+ poller: Aws::Waiters::Poller.new(
180
+ operation_name: :describe_environments,
181
+ acceptors: [
182
+ {
183
+ "state" => "success",
184
+ "matcher" => "pathAll",
185
+ "argument" => "environments[].status",
186
+ "expected" => "Ready"
187
+ },
188
+ {
189
+ "state" => "retry",
190
+ "matcher" => "pathAll",
191
+ "argument" => "environments[].status",
192
+ "expected" => "Updating"
193
+ }
194
+ ]
195
+ )
196
+ }.merge(options))
197
+ end
198
+
199
+ # @option (see Client#describe_environments)
200
+ # @return (see Client#describe_environments)
201
+ def wait(params = {})
202
+ @waiter.wait(client: @client, params: params)
203
+ end
204
+
205
+ # @api private
206
+ attr_reader :waiter
207
+
208
+ end
209
+ end
210
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-elasticbeanstalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.31.0
4
+ version: 1.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-05 00:00:00.000000000 Z
11
+ date: 2020-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.71.0
22
+ version: 3.99.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.71.0
32
+ version: 3.99.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: aws-sigv4
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -59,6 +59,7 @@ files:
59
59
  - lib/aws-sdk-elasticbeanstalk/errors.rb
60
60
  - lib/aws-sdk-elasticbeanstalk/resource.rb
61
61
  - lib/aws-sdk-elasticbeanstalk/types.rb
62
+ - lib/aws-sdk-elasticbeanstalk/waiters.rb
62
63
  homepage: https://github.com/aws/aws-sdk-ruby
63
64
  licenses:
64
65
  - Apache-2.0