aws-sdk-elbproxy 1.0.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.
@@ -0,0 +1,225 @@
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/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ require 'aws-sdk-core/waiters'
11
+
12
+ module Aws::ELBProxy
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
+ # | proxy_active | {Client#get_proxy} | 15 | 40 |
73
+ # | proxy_deleted | {Client#get_proxy} | 15 | 40 |
74
+ # | proxy_update_complete | {Client#get_proxy_update} | 5 | 24 |
75
+ #
76
+ module Waiters
77
+
78
+ class ProxyActive
79
+
80
+ # @param [Hash] options
81
+ # @option options [required, Client] :client
82
+ # @option options [Integer] :max_attempts (40)
83
+ # @option options [Integer] :delay (15)
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: 40,
90
+ delay: 15,
91
+ poller: Aws::Waiters::Poller.new(
92
+ operation_name: :get_proxy,
93
+ acceptors: [
94
+ {
95
+ "matcher" => "path",
96
+ "argument" => "status.code",
97
+ "state" => "success",
98
+ "expected" => "active"
99
+ },
100
+ {
101
+ "matcher" => "path",
102
+ "argument" => "status.code",
103
+ "state" => "failure",
104
+ "expected" => "create-failed"
105
+ },
106
+ {
107
+ "matcher" => "path",
108
+ "argument" => "status.code",
109
+ "state" => "failure",
110
+ "expected" => "action-required"
111
+ }
112
+ ]
113
+ )
114
+ }.merge(options))
115
+ end
116
+
117
+ # @option (see Client#get_proxy)
118
+ # @return (see Client#get_proxy)
119
+ def wait(params = {})
120
+ @waiter.wait(client: @client, params: params)
121
+ end
122
+
123
+ # @api private
124
+ attr_reader :waiter
125
+
126
+ end
127
+
128
+ class ProxyDeleted
129
+
130
+ # @param [Hash] options
131
+ # @option options [required, Client] :client
132
+ # @option options [Integer] :max_attempts (40)
133
+ # @option options [Integer] :delay (15)
134
+ # @option options [Proc] :before_attempt
135
+ # @option options [Proc] :before_wait
136
+ def initialize(options)
137
+ @client = options.fetch(:client)
138
+ @waiter = Aws::Waiters::Waiter.new({
139
+ max_attempts: 40,
140
+ delay: 15,
141
+ poller: Aws::Waiters::Poller.new(
142
+ operation_name: :get_proxy,
143
+ acceptors: [{
144
+ "matcher" => "error",
145
+ "state" => "success",
146
+ "expected" => "ResourceNotFoundException"
147
+ }]
148
+ )
149
+ }.merge(options))
150
+ end
151
+
152
+ # @option (see Client#get_proxy)
153
+ # @return (see Client#get_proxy)
154
+ def wait(params = {})
155
+ @waiter.wait(client: @client, params: params)
156
+ end
157
+
158
+ # @api private
159
+ attr_reader :waiter
160
+
161
+ end
162
+
163
+ class ProxyUpdateComplete
164
+
165
+ # @param [Hash] options
166
+ # @option options [required, Client] :client
167
+ # @option options [Integer] :max_attempts (24)
168
+ # @option options [Integer] :delay (5)
169
+ # @option options [Proc] :before_attempt
170
+ # @option options [Proc] :before_wait
171
+ def initialize(options)
172
+ @client = options.fetch(:client)
173
+ @waiter = Aws::Waiters::Waiter.new({
174
+ max_attempts: 24,
175
+ delay: 5,
176
+ poller: Aws::Waiters::Poller.new(
177
+ operation_name: :get_proxy_update,
178
+ acceptors: [
179
+ {
180
+ "matcher" => "path",
181
+ "argument" => "state.propagation_status",
182
+ "state" => "success",
183
+ "expected" => "complete"
184
+ },
185
+ {
186
+ "matcher" => "path",
187
+ "argument" => "state.propagation_status",
188
+ "state" => "failure",
189
+ "expected" => "failed"
190
+ },
191
+ {
192
+ "matcher" => "path",
193
+ "argument" => "state.propagation_status",
194
+ "state" => "failure",
195
+ "expected" => "cancelled"
196
+ },
197
+ {
198
+ "matcher" => "path",
199
+ "argument" => "state.propagation_status",
200
+ "state" => "failure",
201
+ "expected" => "skipped"
202
+ },
203
+ {
204
+ "matcher" => "path",
205
+ "argument" => "state.validation_status",
206
+ "state" => "failure",
207
+ "expected" => "invalid"
208
+ }
209
+ ]
210
+ )
211
+ }.merge(options))
212
+ end
213
+
214
+ # @option (see Client#get_proxy_update)
215
+ # @return (see Client#get_proxy_update)
216
+ def wait(params = {})
217
+ @waiter.wait(client: @client, params: params)
218
+ end
219
+
220
+ # @api private
221
+ attr_reader :waiter
222
+
223
+ end
224
+ end
225
+ end
@@ -0,0 +1,62 @@
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/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ require 'aws-sdk-core'
12
+ require 'aws-sigv4'
13
+
14
+ Aws::Plugins::GlobalConfiguration.add_identifier(:elbproxy)
15
+
16
+ # This module provides support for Elastic Load Balancing for Envoy. This module is available in the
17
+ # `aws-sdk-elbproxy` gem.
18
+ #
19
+ # # Client
20
+ #
21
+ # The {Client} class provides one method for each API operation. Operation
22
+ # methods each accept a hash of request parameters and return a response
23
+ # structure.
24
+ #
25
+ # elb_proxy = Aws::ELBProxy::Client.new
26
+ # resp = elb_proxy.associate_certificate(params)
27
+ #
28
+ # See {Client} for more information.
29
+ #
30
+ # # Errors
31
+ #
32
+ # Errors returned from Elastic Load Balancing for Envoy are defined in the
33
+ # {Errors} module and all extend {Errors::ServiceError}.
34
+ #
35
+ # begin
36
+ # # do stuff
37
+ # rescue Aws::ELBProxy::Errors::ServiceError
38
+ # # rescues all Elastic Load Balancing for Envoy API errors
39
+ # end
40
+ #
41
+ # See {Errors} for more information.
42
+ #
43
+ # @!group service
44
+ module Aws::ELBProxy
45
+ autoload :Types, 'aws-sdk-elbproxy/types'
46
+ autoload :ClientApi, 'aws-sdk-elbproxy/client_api'
47
+ module Plugins
48
+ autoload :Endpoints, 'aws-sdk-elbproxy/plugins/endpoints.rb'
49
+ end
50
+ autoload :Client, 'aws-sdk-elbproxy/client'
51
+ autoload :Errors, 'aws-sdk-elbproxy/errors'
52
+ autoload :Waiters, 'aws-sdk-elbproxy/waiters'
53
+ autoload :Resource, 'aws-sdk-elbproxy/resource'
54
+ autoload :EndpointParameters, 'aws-sdk-elbproxy/endpoint_parameters'
55
+ autoload :EndpointProvider, 'aws-sdk-elbproxy/endpoint_provider'
56
+ autoload :Endpoints, 'aws-sdk-elbproxy/endpoints'
57
+
58
+ GEM_VERSION = '1.0.0'
59
+
60
+ end
61
+
62
+ require_relative 'aws-sdk-elbproxy/customizations'