aws-sdk-medialive 1.41.0 → 1.46.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.
@@ -8,6 +8,77 @@
8
8
  require 'aws-sdk-core/waiters'
9
9
 
10
10
  module Aws::MediaLive
11
+ # Waiters are utility methods that poll for a particular state to occur
12
+ # on a client. Waiters can fail after a number of attempts at a polling
13
+ # interval defined for the service client.
14
+ #
15
+ # For a list of operations that can be waited for and the
16
+ # client methods called for each operation, see the table below or the
17
+ # {Client#wait_until} field documentation for the {Client}.
18
+ #
19
+ # # Invoking a Waiter
20
+ # To invoke a waiter, call #wait_until on a {Client}. The first parameter
21
+ # is the waiter name, which is specific to the service client and indicates
22
+ # which operation is being waited for. The second parameter is a hash of
23
+ # parameters that are passed to the client method called by the waiter,
24
+ # which varies according to the waiter name.
25
+ #
26
+ # # Wait Failures
27
+ # To catch errors in a waiter, use WaiterFailed,
28
+ # as shown in the following example.
29
+ #
30
+ # rescue rescue Aws::Waiters::Errors::WaiterFailed => error
31
+ # puts "failed waiting for instance running: #{error.message}
32
+ # end
33
+ #
34
+ # # Configuring a Waiter
35
+ # Each waiter has a default polling interval and a maximum number of
36
+ # attempts it will make before returning control to your program.
37
+ # To set these values, use the `max_attempts` and `delay` parameters
38
+ # in your `#wait_until` call.
39
+ # The following example waits for up to 25 seconds, polling every five seconds.
40
+ #
41
+ # client.wait_until(...) do |w|
42
+ # w.max_attempts = 5
43
+ # w.delay = 5
44
+ # end
45
+ #
46
+ # To disable wait failures, set the value of either of these parameters
47
+ # to `nil`.
48
+ #
49
+ # # Extending a Waiter
50
+ # To modify the behavior of waiters, you can register callbacks that are
51
+ # triggered before each polling attempt and before waiting.
52
+ #
53
+ # The following example implements an exponential backoff in a waiter
54
+ # by doubling the amount of time to wait on every attempt.
55
+ #
56
+ # client.wait_until(...) do |w|
57
+ # w.interval = 0 # disable normal sleep
58
+ # w.before_wait do |n, resp|
59
+ # sleep(n ** 2)
60
+ # end
61
+ # end
62
+ #
63
+ # # Available Waiters
64
+ #
65
+ # The following table lists the valid waiter names, the operations they call,
66
+ # and the default `:delay` and `:max_attempts` values.
67
+ #
68
+ # | waiter_name | params | :delay | :max_attempts |
69
+ # | ----------------- | --------------------------- | -------- | ------------- |
70
+ # | channel_created | {Client#describe_channel} | 3 | 5 |
71
+ # | channel_deleted | {Client#describe_channel} | 5 | 84 |
72
+ # | channel_running | {Client#describe_channel} | 5 | 120 |
73
+ # | channel_stopped | {Client#describe_channel} | 5 | 60 |
74
+ # | input_attached | {Client#describe_input} | 5 | 20 |
75
+ # | input_deleted | {Client#describe_input} | 5 | 20 |
76
+ # | input_detached | {Client#describe_input} | 5 | 84 |
77
+ # | multiplex_created | {Client#describe_multiplex} | 3 | 5 |
78
+ # | multiplex_deleted | {Client#describe_multiplex} | 5 | 20 |
79
+ # | multiplex_running | {Client#describe_multiplex} | 5 | 120 |
80
+ # | multiplex_stopped | {Client#describe_multiplex} | 5 | 28 |
81
+ #
11
82
  module Waiters
12
83
 
13
84
  # Wait until a channel has been created
@@ -71,14 +142,14 @@ module Aws::MediaLive
71
142
 
72
143
  # @param [Hash] options
73
144
  # @option options [required, Client] :client
74
- # @option options [Integer] :max_attempts (20)
145
+ # @option options [Integer] :max_attempts (84)
75
146
  # @option options [Integer] :delay (5)
76
147
  # @option options [Proc] :before_attempt
77
148
  # @option options [Proc] :before_wait
78
149
  def initialize(options)
79
150
  @client = options.fetch(:client)
80
151
  @waiter = Aws::Waiters::Waiter.new({
81
- max_attempts: 20,
152
+ max_attempts: 84,
82
153
  delay: 5,
83
154
  poller: Aws::Waiters::Poller.new(
84
155
  operation_name: :describe_channel,
@@ -171,14 +242,14 @@ module Aws::MediaLive
171
242
 
172
243
  # @param [Hash] options
173
244
  # @option options [required, Client] :client
174
- # @option options [Integer] :max_attempts (28)
245
+ # @option options [Integer] :max_attempts (60)
175
246
  # @option options [Integer] :delay (5)
176
247
  # @option options [Proc] :before_attempt
177
248
  # @option options [Proc] :before_wait
178
249
  def initialize(options)
179
250
  @client = options.fetch(:client)
180
251
  @waiter = Aws::Waiters::Waiter.new({
181
- max_attempts: 28,
252
+ max_attempts: 60,
182
253
  delay: 5,
183
254
  poller: Aws::Waiters::Poller.new(
184
255
  operation_name: :describe_channel,
@@ -216,6 +287,162 @@ module Aws::MediaLive
216
287
 
217
288
  end
218
289
 
290
+ # Wait until an input has been attached
291
+ class InputAttached
292
+
293
+ # @param [Hash] options
294
+ # @option options [required, Client] :client
295
+ # @option options [Integer] :max_attempts (20)
296
+ # @option options [Integer] :delay (5)
297
+ # @option options [Proc] :before_attempt
298
+ # @option options [Proc] :before_wait
299
+ def initialize(options)
300
+ @client = options.fetch(:client)
301
+ @waiter = Aws::Waiters::Waiter.new({
302
+ max_attempts: 20,
303
+ delay: 5,
304
+ poller: Aws::Waiters::Poller.new(
305
+ operation_name: :describe_input,
306
+ acceptors: [
307
+ {
308
+ "state" => "success",
309
+ "matcher" => "path",
310
+ "argument" => "state",
311
+ "expected" => "ATTACHED"
312
+ },
313
+ {
314
+ "state" => "retry",
315
+ "matcher" => "path",
316
+ "argument" => "state",
317
+ "expected" => "DETACHED"
318
+ },
319
+ {
320
+ "state" => "retry",
321
+ "matcher" => "status",
322
+ "expected" => 500
323
+ }
324
+ ]
325
+ )
326
+ }.merge(options))
327
+ end
328
+
329
+ # @option (see Client#describe_input)
330
+ # @return (see Client#describe_input)
331
+ def wait(params = {})
332
+ @waiter.wait(client: @client, params: params)
333
+ end
334
+
335
+ # @api private
336
+ attr_reader :waiter
337
+
338
+ end
339
+
340
+ # Wait until an input has been deleted
341
+ class InputDeleted
342
+
343
+ # @param [Hash] options
344
+ # @option options [required, Client] :client
345
+ # @option options [Integer] :max_attempts (20)
346
+ # @option options [Integer] :delay (5)
347
+ # @option options [Proc] :before_attempt
348
+ # @option options [Proc] :before_wait
349
+ def initialize(options)
350
+ @client = options.fetch(:client)
351
+ @waiter = Aws::Waiters::Waiter.new({
352
+ max_attempts: 20,
353
+ delay: 5,
354
+ poller: Aws::Waiters::Poller.new(
355
+ operation_name: :describe_input,
356
+ acceptors: [
357
+ {
358
+ "state" => "success",
359
+ "matcher" => "path",
360
+ "argument" => "state",
361
+ "expected" => "DELETED"
362
+ },
363
+ {
364
+ "state" => "retry",
365
+ "matcher" => "path",
366
+ "argument" => "state",
367
+ "expected" => "DELETING"
368
+ },
369
+ {
370
+ "state" => "retry",
371
+ "matcher" => "status",
372
+ "expected" => 500
373
+ }
374
+ ]
375
+ )
376
+ }.merge(options))
377
+ end
378
+
379
+ # @option (see Client#describe_input)
380
+ # @return (see Client#describe_input)
381
+ def wait(params = {})
382
+ @waiter.wait(client: @client, params: params)
383
+ end
384
+
385
+ # @api private
386
+ attr_reader :waiter
387
+
388
+ end
389
+
390
+ # Wait until an input has been detached
391
+ class InputDetached
392
+
393
+ # @param [Hash] options
394
+ # @option options [required, Client] :client
395
+ # @option options [Integer] :max_attempts (84)
396
+ # @option options [Integer] :delay (5)
397
+ # @option options [Proc] :before_attempt
398
+ # @option options [Proc] :before_wait
399
+ def initialize(options)
400
+ @client = options.fetch(:client)
401
+ @waiter = Aws::Waiters::Waiter.new({
402
+ max_attempts: 84,
403
+ delay: 5,
404
+ poller: Aws::Waiters::Poller.new(
405
+ operation_name: :describe_input,
406
+ acceptors: [
407
+ {
408
+ "state" => "success",
409
+ "matcher" => "path",
410
+ "argument" => "state",
411
+ "expected" => "DETACHED"
412
+ },
413
+ {
414
+ "state" => "retry",
415
+ "matcher" => "path",
416
+ "argument" => "state",
417
+ "expected" => "CREATING"
418
+ },
419
+ {
420
+ "state" => "retry",
421
+ "matcher" => "path",
422
+ "argument" => "state",
423
+ "expected" => "ATTACHED"
424
+ },
425
+ {
426
+ "state" => "retry",
427
+ "matcher" => "status",
428
+ "expected" => 500
429
+ }
430
+ ]
431
+ )
432
+ }.merge(options))
433
+ end
434
+
435
+ # @option (see Client#describe_input)
436
+ # @return (see Client#describe_input)
437
+ def wait(params = {})
438
+ @waiter.wait(client: @client, params: params)
439
+ end
440
+
441
+ # @api private
442
+ attr_reader :waiter
443
+
444
+ end
445
+
219
446
  # Wait until a multiplex has been created
220
447
  class MultiplexCreated
221
448
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-medialive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.41.0
4
+ version: 1.46.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-03-09 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.5.2.3
85
+ rubygems_version: 2.7.6.2
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: AWS SDK for Ruby - MediaLive