aws-sdk-deadline 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,400 @@
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::Deadline
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
+ # | fleet_active | {Client#get_fleet} | 5 | 180 |
73
+ # | job_create_complete | {Client#get_job} | 1 | 120 |
74
+ # | license_endpoint_deleted | {Client#get_license_endpoint} | 10 | 234 |
75
+ # | license_endpoint_valid | {Client#get_license_endpoint} | 10 | 114 |
76
+ # | queue_fleet_association_stopped | {Client#get_queue_fleet_association} | 10 | 60 |
77
+ # | queue_scheduling | {Client#get_queue} | 10 | 70 |
78
+ # | queue_scheduling_blocked | {Client#get_queue} | 10 | 30 |
79
+ #
80
+ module Waiters
81
+
82
+ # Wait until a Fleet is activated. Use this after invoking CreateFleet or UpdateFleet.
83
+ class FleetActive
84
+
85
+ # @param [Hash] options
86
+ # @option options [required, Client] :client
87
+ # @option options [Integer] :max_attempts (180)
88
+ # @option options [Integer] :delay (5)
89
+ # @option options [Proc] :before_attempt
90
+ # @option options [Proc] :before_wait
91
+ def initialize(options)
92
+ @client = options.fetch(:client)
93
+ @waiter = Aws::Waiters::Waiter.new({
94
+ max_attempts: 180,
95
+ delay: 5,
96
+ poller: Aws::Waiters::Poller.new(
97
+ operation_name: :get_fleet,
98
+ acceptors: [
99
+ {
100
+ "matcher" => "path",
101
+ "argument" => "status",
102
+ "state" => "success",
103
+ "expected" => "ACTIVE"
104
+ },
105
+ {
106
+ "matcher" => "path",
107
+ "argument" => "status",
108
+ "state" => "failure",
109
+ "expected" => "CREATE_FAILED"
110
+ },
111
+ {
112
+ "matcher" => "path",
113
+ "argument" => "status",
114
+ "state" => "failure",
115
+ "expected" => "UPDATE_FAILED"
116
+ }
117
+ ]
118
+ )
119
+ }.merge(options))
120
+ end
121
+
122
+ # @option (see Client#get_fleet)
123
+ # @return (see Client#get_fleet)
124
+ def wait(params = {})
125
+ @waiter.wait(client: @client, params: params)
126
+ end
127
+
128
+ # @api private
129
+ attr_reader :waiter
130
+
131
+ end
132
+
133
+ # Wait until a Job is created. Use this after invoking CreateJob.
134
+ class JobCreateComplete
135
+
136
+ # @param [Hash] options
137
+ # @option options [required, Client] :client
138
+ # @option options [Integer] :max_attempts (120)
139
+ # @option options [Integer] :delay (1)
140
+ # @option options [Proc] :before_attempt
141
+ # @option options [Proc] :before_wait
142
+ def initialize(options)
143
+ @client = options.fetch(:client)
144
+ @waiter = Aws::Waiters::Waiter.new({
145
+ max_attempts: 120,
146
+ delay: 1,
147
+ poller: Aws::Waiters::Poller.new(
148
+ operation_name: :get_job,
149
+ acceptors: [
150
+ {
151
+ "matcher" => "path",
152
+ "argument" => "lifecycle_status",
153
+ "state" => "success",
154
+ "expected" => "CREATE_COMPLETE"
155
+ },
156
+ {
157
+ "matcher" => "path",
158
+ "argument" => "lifecycle_status",
159
+ "state" => "success",
160
+ "expected" => "UPDATE_IN_PROGRESS"
161
+ },
162
+ {
163
+ "matcher" => "path",
164
+ "argument" => "lifecycle_status",
165
+ "state" => "success",
166
+ "expected" => "UPDATE_FAILED"
167
+ },
168
+ {
169
+ "matcher" => "path",
170
+ "argument" => "lifecycle_status",
171
+ "state" => "success",
172
+ "expected" => "UPDATE_SUCCEEDED"
173
+ },
174
+ {
175
+ "matcher" => "path",
176
+ "argument" => "lifecycle_status",
177
+ "state" => "failure",
178
+ "expected" => "UPLOAD_FAILED"
179
+ },
180
+ {
181
+ "matcher" => "path",
182
+ "argument" => "lifecycle_status",
183
+ "state" => "failure",
184
+ "expected" => "CREATE_FAILED"
185
+ }
186
+ ]
187
+ )
188
+ }.merge(options))
189
+ end
190
+
191
+ # @option (see Client#get_job)
192
+ # @return (see Client#get_job)
193
+ def wait(params = {})
194
+ @waiter.wait(client: @client, params: params)
195
+ end
196
+
197
+ # @api private
198
+ attr_reader :waiter
199
+
200
+ end
201
+
202
+ # Wait until a LicenseEndpoint is Deleted. Use this after invoking DeleteLicenseEndpoint.
203
+ class LicenseEndpointDeleted
204
+
205
+ # @param [Hash] options
206
+ # @option options [required, Client] :client
207
+ # @option options [Integer] :max_attempts (234)
208
+ # @option options [Integer] :delay (10)
209
+ # @option options [Proc] :before_attempt
210
+ # @option options [Proc] :before_wait
211
+ def initialize(options)
212
+ @client = options.fetch(:client)
213
+ @waiter = Aws::Waiters::Waiter.new({
214
+ max_attempts: 234,
215
+ delay: 10,
216
+ poller: Aws::Waiters::Poller.new(
217
+ operation_name: :get_license_endpoint,
218
+ acceptors: [
219
+ {
220
+ "matcher" => "error",
221
+ "state" => "success",
222
+ "expected" => "ResourceNotFoundException"
223
+ },
224
+ {
225
+ "matcher" => "path",
226
+ "argument" => "status",
227
+ "state" => "failure",
228
+ "expected" => "NOT_READY"
229
+ }
230
+ ]
231
+ )
232
+ }.merge(options))
233
+ end
234
+
235
+ # @option (see Client#get_license_endpoint)
236
+ # @return (see Client#get_license_endpoint)
237
+ def wait(params = {})
238
+ @waiter.wait(client: @client, params: params)
239
+ end
240
+
241
+ # @api private
242
+ attr_reader :waiter
243
+
244
+ end
245
+
246
+ # Wait until a LicenseEndpoint is Ready. Use this after invoking CreateLicenseEndpoint.
247
+ class LicenseEndpointValid
248
+
249
+ # @param [Hash] options
250
+ # @option options [required, Client] :client
251
+ # @option options [Integer] :max_attempts (114)
252
+ # @option options [Integer] :delay (10)
253
+ # @option options [Proc] :before_attempt
254
+ # @option options [Proc] :before_wait
255
+ def initialize(options)
256
+ @client = options.fetch(:client)
257
+ @waiter = Aws::Waiters::Waiter.new({
258
+ max_attempts: 114,
259
+ delay: 10,
260
+ poller: Aws::Waiters::Poller.new(
261
+ operation_name: :get_license_endpoint,
262
+ acceptors: [
263
+ {
264
+ "matcher" => "path",
265
+ "argument" => "status",
266
+ "state" => "success",
267
+ "expected" => "READY"
268
+ },
269
+ {
270
+ "matcher" => "path",
271
+ "argument" => "status",
272
+ "state" => "failure",
273
+ "expected" => "NOT_READY"
274
+ }
275
+ ]
276
+ )
277
+ }.merge(options))
278
+ end
279
+
280
+ # @option (see Client#get_license_endpoint)
281
+ # @return (see Client#get_license_endpoint)
282
+ def wait(params = {})
283
+ @waiter.wait(client: @client, params: params)
284
+ end
285
+
286
+ # @api private
287
+ attr_reader :waiter
288
+
289
+ end
290
+
291
+ # Wait until a QueueFleetAssociation is stopped. Use this after setting the status to STOP_SCHEDULING_AND_COMPLETE_TASKS or STOP_SCHEDULING_AND_CANCEL_TASKS to wait for a QueueFleetAssociation to reach STOPPED
292
+ class QueueFleetAssociationStopped
293
+
294
+ # @param [Hash] options
295
+ # @option options [required, Client] :client
296
+ # @option options [Integer] :max_attempts (60)
297
+ # @option options [Integer] :delay (10)
298
+ # @option options [Proc] :before_attempt
299
+ # @option options [Proc] :before_wait
300
+ def initialize(options)
301
+ @client = options.fetch(:client)
302
+ @waiter = Aws::Waiters::Waiter.new({
303
+ max_attempts: 60,
304
+ delay: 10,
305
+ poller: Aws::Waiters::Poller.new(
306
+ operation_name: :get_queue_fleet_association,
307
+ acceptors: [{
308
+ "matcher" => "path",
309
+ "argument" => "status",
310
+ "state" => "success",
311
+ "expected" => "STOPPED"
312
+ }]
313
+ )
314
+ }.merge(options))
315
+ end
316
+
317
+ # @option (see Client#get_queue_fleet_association)
318
+ # @return (see Client#get_queue_fleet_association)
319
+ def wait(params = {})
320
+ @waiter.wait(client: @client, params: params)
321
+ end
322
+
323
+ # @api private
324
+ attr_reader :waiter
325
+
326
+ end
327
+
328
+ class QueueScheduling
329
+
330
+ # @param [Hash] options
331
+ # @option options [required, Client] :client
332
+ # @option options [Integer] :max_attempts (70)
333
+ # @option options [Integer] :delay (10)
334
+ # @option options [Proc] :before_attempt
335
+ # @option options [Proc] :before_wait
336
+ def initialize(options)
337
+ @client = options.fetch(:client)
338
+ @waiter = Aws::Waiters::Waiter.new({
339
+ max_attempts: 70,
340
+ delay: 10,
341
+ poller: Aws::Waiters::Poller.new(
342
+ operation_name: :get_queue,
343
+ acceptors: [{
344
+ "matcher" => "path",
345
+ "argument" => "status",
346
+ "state" => "success",
347
+ "expected" => "SCHEDULING"
348
+ }]
349
+ )
350
+ }.merge(options))
351
+ end
352
+
353
+ # @option (see Client#get_queue)
354
+ # @return (see Client#get_queue)
355
+ def wait(params = {})
356
+ @waiter.wait(client: @client, params: params)
357
+ end
358
+
359
+ # @api private
360
+ attr_reader :waiter
361
+
362
+ end
363
+
364
+ class QueueSchedulingBlocked
365
+
366
+ # @param [Hash] options
367
+ # @option options [required, Client] :client
368
+ # @option options [Integer] :max_attempts (30)
369
+ # @option options [Integer] :delay (10)
370
+ # @option options [Proc] :before_attempt
371
+ # @option options [Proc] :before_wait
372
+ def initialize(options)
373
+ @client = options.fetch(:client)
374
+ @waiter = Aws::Waiters::Waiter.new({
375
+ max_attempts: 30,
376
+ delay: 10,
377
+ poller: Aws::Waiters::Poller.new(
378
+ operation_name: :get_queue,
379
+ acceptors: [{
380
+ "matcher" => "path",
381
+ "argument" => "status",
382
+ "state" => "success",
383
+ "expected" => "SCHEDULING_BLOCKED"
384
+ }]
385
+ )
386
+ }.merge(options))
387
+ end
388
+
389
+ # @option (see Client#get_queue)
390
+ # @return (see Client#get_queue)
391
+ def wait(params = {})
392
+ @waiter.wait(client: @client, params: params)
393
+ end
394
+
395
+ # @api private
396
+ attr_reader :waiter
397
+
398
+ end
399
+ end
400
+ end
@@ -0,0 +1,58 @@
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
+ require_relative 'aws-sdk-deadline/types'
15
+ require_relative 'aws-sdk-deadline/client_api'
16
+ require_relative 'aws-sdk-deadline/plugins/endpoints.rb'
17
+ require_relative 'aws-sdk-deadline/client'
18
+ require_relative 'aws-sdk-deadline/errors'
19
+ require_relative 'aws-sdk-deadline/waiters'
20
+ require_relative 'aws-sdk-deadline/resource'
21
+ require_relative 'aws-sdk-deadline/endpoint_parameters'
22
+ require_relative 'aws-sdk-deadline/endpoint_provider'
23
+ require_relative 'aws-sdk-deadline/endpoints'
24
+ require_relative 'aws-sdk-deadline/customizations'
25
+
26
+ # This module provides support for AWSDeadlineCloud. This module is available in the
27
+ # `aws-sdk-deadline` gem.
28
+ #
29
+ # # Client
30
+ #
31
+ # The {Client} class provides one method for each API operation. Operation
32
+ # methods each accept a hash of request parameters and return a response
33
+ # structure.
34
+ #
35
+ # deadline = Aws::Deadline::Client.new
36
+ # resp = deadline.associate_member_to_farm(params)
37
+ #
38
+ # See {Client} for more information.
39
+ #
40
+ # # Errors
41
+ #
42
+ # Errors returned from AWSDeadlineCloud are defined in the
43
+ # {Errors} module and all extend {Errors::ServiceError}.
44
+ #
45
+ # begin
46
+ # # do stuff
47
+ # rescue Aws::Deadline::Errors::ServiceError
48
+ # # rescues all AWSDeadlineCloud API errors
49
+ # end
50
+ #
51
+ # See {Errors} for more information.
52
+ #
53
+ # @!group service
54
+ module Aws::Deadline
55
+
56
+ GEM_VERSION = '1.0.0'
57
+
58
+ end