aws-sdk-medialive 1.31.0 → 1.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a9a0258d57e674a96e00bf6313de8ed34bea3de
4
- data.tar.gz: d9e42c8a373835e176a44b2f15a90b65bff55e1a
3
+ metadata.gz: a38f84aaad1441fe3a7d1fff47fe7e2dda7faca2
4
+ data.tar.gz: 81c454a8168ff6a45078b085f409a0f30154aecb
5
5
  SHA512:
6
- metadata.gz: 694e1f334f3c5687bad77dc48fe5fd378db88dca2043b046e9a5d55c3f31a6b80f2dc87fc0e610a11091fac430da0783f4131692b567395d36b05e3ccad6dd8e
7
- data.tar.gz: 520cf545c5da1ff7306fd9ce0d144d928a5de64dc4e42e6b76e8efcd530f702b55157240fef48dc516b99980901ceef9fd71b737967f3dabb6d14704277c93be
6
+ metadata.gz: cd2d5bb0c76897886840bbbb276cc5c77496b86687c310a61be77ec9c22acf908adc91f8c36a4a0c4b05dd86d5b97c5c73859003124277785f7242c51ca80909
7
+ data.tar.gz: 6b83a954a9578e54e56352df0ce9e60a1014dd44c958881d8476d9c8edf7a2da87ae7c61c201e44e3410e9ebf4b61004bb04930a8d02bf23db772a7745f7e390
@@ -12,6 +12,7 @@ require_relative 'aws-sdk-medialive/types'
12
12
  require_relative 'aws-sdk-medialive/client_api'
13
13
  require_relative 'aws-sdk-medialive/client'
14
14
  require_relative 'aws-sdk-medialive/errors'
15
+ require_relative 'aws-sdk-medialive/waiters'
15
16
  require_relative 'aws-sdk-medialive/resource'
16
17
  require_relative 'aws-sdk-medialive/customizations'
17
18
 
@@ -42,6 +43,6 @@ require_relative 'aws-sdk-medialive/customizations'
42
43
  # @service
43
44
  module Aws::MediaLive
44
45
 
45
- GEM_VERSION = '1.31.0'
46
+ GEM_VERSION = '1.32.0'
46
47
 
47
48
  end
@@ -6842,14 +6842,133 @@ module Aws::MediaLive
6842
6842
  params: params,
6843
6843
  config: config)
6844
6844
  context[:gem_name] = 'aws-sdk-medialive'
6845
- context[:gem_version] = '1.31.0'
6845
+ context[:gem_version] = '1.32.0'
6846
6846
  Seahorse::Client::Request.new(handlers, context)
6847
6847
  end
6848
6848
 
6849
+ # Polls an API operation until a resource enters a desired state.
6850
+ #
6851
+ # ## Basic Usage
6852
+ #
6853
+ # A waiter will call an API operation until:
6854
+ #
6855
+ # * It is successful
6856
+ # * It enters a terminal state
6857
+ # * It makes the maximum number of attempts
6858
+ #
6859
+ # In between attempts, the waiter will sleep.
6860
+ #
6861
+ # # polls in a loop, sleeping between attempts
6862
+ # client.wait_until(waiter_name, params)
6863
+ #
6864
+ # ## Configuration
6865
+ #
6866
+ # You can configure the maximum number of polling attempts, and the
6867
+ # delay (in seconds) between each polling attempt. You can pass
6868
+ # configuration as the final arguments hash.
6869
+ #
6870
+ # # poll for ~25 seconds
6871
+ # client.wait_until(waiter_name, params, {
6872
+ # max_attempts: 5,
6873
+ # delay: 5,
6874
+ # })
6875
+ #
6876
+ # ## Callbacks
6877
+ #
6878
+ # You can be notified before each polling attempt and before each
6879
+ # delay. If you throw `:success` or `:failure` from these callbacks,
6880
+ # it will terminate the waiter.
6881
+ #
6882
+ # started_at = Time.now
6883
+ # client.wait_until(waiter_name, params, {
6884
+ #
6885
+ # # disable max attempts
6886
+ # max_attempts: nil,
6887
+ #
6888
+ # # poll for 1 hour, instead of a number of attempts
6889
+ # before_wait: -> (attempts, response) do
6890
+ # throw :failure if Time.now - started_at > 3600
6891
+ # end
6892
+ # })
6893
+ #
6894
+ # ## Handling Errors
6895
+ #
6896
+ # When a waiter is unsuccessful, it will raise an error.
6897
+ # All of the failure errors extend from
6898
+ # {Aws::Waiters::Errors::WaiterFailed}.
6899
+ #
6900
+ # begin
6901
+ # client.wait_until(...)
6902
+ # rescue Aws::Waiters::Errors::WaiterFailed
6903
+ # # resource did not enter the desired state in time
6904
+ # end
6905
+ #
6906
+ # ## Valid Waiters
6907
+ #
6908
+ # The following table lists the valid waiter names, the operations they call,
6909
+ # and the default `:delay` and `:max_attempts` values.
6910
+ #
6911
+ # | waiter_name | params | :delay | :max_attempts |
6912
+ # | --------------- | ------------------- | -------- | ------------- |
6913
+ # | channel_created | {#describe_channel} | 3 | 5 |
6914
+ # | channel_deleted | {#describe_channel} | 5 | 20 |
6915
+ # | channel_running | {#describe_channel} | 5 | 120 |
6916
+ # | channel_stopped | {#describe_channel} | 5 | 28 |
6917
+ #
6918
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
6919
+ # because the waiter has entered a state that it will not transition
6920
+ # out of, preventing success.
6921
+ #
6922
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
6923
+ # maximum number of attempts have been made, and the waiter is not
6924
+ # yet successful.
6925
+ #
6926
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
6927
+ # while polling for a resource that is not expected.
6928
+ #
6929
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
6930
+ # for an unknown state.
6931
+ #
6932
+ # @return [Boolean] Returns `true` if the waiter was successful.
6933
+ # @param [Symbol] waiter_name
6934
+ # @param [Hash] params ({})
6935
+ # @param [Hash] options ({})
6936
+ # @option options [Integer] :max_attempts
6937
+ # @option options [Integer] :delay
6938
+ # @option options [Proc] :before_attempt
6939
+ # @option options [Proc] :before_wait
6940
+ def wait_until(waiter_name, params = {}, options = {})
6941
+ w = waiter(waiter_name, options)
6942
+ yield(w.waiter) if block_given? # deprecated
6943
+ w.wait(params)
6944
+ end
6945
+
6849
6946
  # @api private
6850
6947
  # @deprecated
6851
6948
  def waiter_names
6852
- []
6949
+ waiters.keys
6950
+ end
6951
+
6952
+ private
6953
+
6954
+ # @param [Symbol] waiter_name
6955
+ # @param [Hash] options ({})
6956
+ def waiter(waiter_name, options = {})
6957
+ waiter_class = waiters[waiter_name]
6958
+ if waiter_class
6959
+ waiter_class.new(options.merge(client: self))
6960
+ else
6961
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
6962
+ end
6963
+ end
6964
+
6965
+ def waiters
6966
+ {
6967
+ channel_created: Waiters::ChannelCreated,
6968
+ channel_deleted: Waiters::ChannelDeleted,
6969
+ channel_running: Waiters::ChannelRunning,
6970
+ channel_stopped: Waiters::ChannelStopped
6971
+ }
6853
6972
  end
6854
6973
 
6855
6974
  class << self
@@ -0,0 +1,219 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core/waiters'
9
+
10
+ module Aws::MediaLive
11
+ module Waiters
12
+
13
+ # Wait until a channel has been created
14
+ class ChannelCreated
15
+
16
+ # @param [Hash] options
17
+ # @option options [required, Client] :client
18
+ # @option options [Integer] :max_attempts (5)
19
+ # @option options [Integer] :delay (3)
20
+ # @option options [Proc] :before_attempt
21
+ # @option options [Proc] :before_wait
22
+ def initialize(options)
23
+ @client = options.fetch(:client)
24
+ @waiter = Aws::Waiters::Waiter.new({
25
+ max_attempts: 5,
26
+ delay: 3,
27
+ poller: Aws::Waiters::Poller.new(
28
+ operation_name: :describe_channel,
29
+ acceptors: [
30
+ {
31
+ "state" => "success",
32
+ "matcher" => "path",
33
+ "argument" => "state",
34
+ "expected" => "IDLE"
35
+ },
36
+ {
37
+ "state" => "retry",
38
+ "matcher" => "path",
39
+ "argument" => "state",
40
+ "expected" => "CREATING"
41
+ },
42
+ {
43
+ "state" => "retry",
44
+ "matcher" => "status",
45
+ "expected" => 500
46
+ },
47
+ {
48
+ "state" => "failure",
49
+ "matcher" => "path",
50
+ "argument" => "state",
51
+ "expected" => "CREATE_FAILED"
52
+ }
53
+ ]
54
+ )
55
+ }.merge(options))
56
+ end
57
+
58
+ # @option (see Client#describe_channel)
59
+ # @return (see Client#describe_channel)
60
+ def wait(params = {})
61
+ @waiter.wait(client: @client, params: params)
62
+ end
63
+
64
+ # @api private
65
+ attr_reader :waiter
66
+
67
+ end
68
+
69
+ # Wait until a channel has been deleted
70
+ class ChannelDeleted
71
+
72
+ # @param [Hash] options
73
+ # @option options [required, Client] :client
74
+ # @option options [Integer] :max_attempts (20)
75
+ # @option options [Integer] :delay (5)
76
+ # @option options [Proc] :before_attempt
77
+ # @option options [Proc] :before_wait
78
+ def initialize(options)
79
+ @client = options.fetch(:client)
80
+ @waiter = Aws::Waiters::Waiter.new({
81
+ max_attempts: 20,
82
+ delay: 5,
83
+ poller: Aws::Waiters::Poller.new(
84
+ operation_name: :describe_channel,
85
+ acceptors: [
86
+ {
87
+ "state" => "success",
88
+ "matcher" => "path",
89
+ "argument" => "state",
90
+ "expected" => "DELETED"
91
+ },
92
+ {
93
+ "state" => "retry",
94
+ "matcher" => "path",
95
+ "argument" => "state",
96
+ "expected" => "DELETING"
97
+ },
98
+ {
99
+ "state" => "retry",
100
+ "matcher" => "status",
101
+ "expected" => 500
102
+ }
103
+ ]
104
+ )
105
+ }.merge(options))
106
+ end
107
+
108
+ # @option (see Client#describe_channel)
109
+ # @return (see Client#describe_channel)
110
+ def wait(params = {})
111
+ @waiter.wait(client: @client, params: params)
112
+ end
113
+
114
+ # @api private
115
+ attr_reader :waiter
116
+
117
+ end
118
+
119
+ # Wait until a channel is running
120
+ class ChannelRunning
121
+
122
+ # @param [Hash] options
123
+ # @option options [required, Client] :client
124
+ # @option options [Integer] :max_attempts (120)
125
+ # @option options [Integer] :delay (5)
126
+ # @option options [Proc] :before_attempt
127
+ # @option options [Proc] :before_wait
128
+ def initialize(options)
129
+ @client = options.fetch(:client)
130
+ @waiter = Aws::Waiters::Waiter.new({
131
+ max_attempts: 120,
132
+ delay: 5,
133
+ poller: Aws::Waiters::Poller.new(
134
+ operation_name: :describe_channel,
135
+ acceptors: [
136
+ {
137
+ "state" => "success",
138
+ "matcher" => "path",
139
+ "argument" => "state",
140
+ "expected" => "RUNNING"
141
+ },
142
+ {
143
+ "state" => "retry",
144
+ "matcher" => "path",
145
+ "argument" => "state",
146
+ "expected" => "STARTING"
147
+ },
148
+ {
149
+ "state" => "retry",
150
+ "matcher" => "status",
151
+ "expected" => 500
152
+ }
153
+ ]
154
+ )
155
+ }.merge(options))
156
+ end
157
+
158
+ # @option (see Client#describe_channel)
159
+ # @return (see Client#describe_channel)
160
+ def wait(params = {})
161
+ @waiter.wait(client: @client, params: params)
162
+ end
163
+
164
+ # @api private
165
+ attr_reader :waiter
166
+
167
+ end
168
+
169
+ # Wait until a channel has is stopped
170
+ class ChannelStopped
171
+
172
+ # @param [Hash] options
173
+ # @option options [required, Client] :client
174
+ # @option options [Integer] :max_attempts (28)
175
+ # @option options [Integer] :delay (5)
176
+ # @option options [Proc] :before_attempt
177
+ # @option options [Proc] :before_wait
178
+ def initialize(options)
179
+ @client = options.fetch(:client)
180
+ @waiter = Aws::Waiters::Waiter.new({
181
+ max_attempts: 28,
182
+ delay: 5,
183
+ poller: Aws::Waiters::Poller.new(
184
+ operation_name: :describe_channel,
185
+ acceptors: [
186
+ {
187
+ "state" => "success",
188
+ "matcher" => "path",
189
+ "argument" => "state",
190
+ "expected" => "IDLE"
191
+ },
192
+ {
193
+ "state" => "retry",
194
+ "matcher" => "path",
195
+ "argument" => "state",
196
+ "expected" => "STOPPING"
197
+ },
198
+ {
199
+ "state" => "retry",
200
+ "matcher" => "status",
201
+ "expected" => 500
202
+ }
203
+ ]
204
+ )
205
+ }.merge(options))
206
+ end
207
+
208
+ # @option (see Client#describe_channel)
209
+ # @return (see Client#describe_channel)
210
+ def wait(params = {})
211
+ @waiter.wait(client: @client, params: params)
212
+ end
213
+
214
+ # @api private
215
+ attr_reader :waiter
216
+
217
+ end
218
+ end
219
+ end
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.31.0
4
+ version: 1.32.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: 2019-05-15 00:00:00.000000000 Z
11
+ date: 2019-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -59,6 +59,7 @@ files:
59
59
  - lib/aws-sdk-medialive/errors.rb
60
60
  - lib/aws-sdk-medialive/resource.rb
61
61
  - lib/aws-sdk-medialive/types.rb
62
+ - lib/aws-sdk-medialive/waiters.rb
62
63
  homepage: https://github.com/aws/aws-sdk-ruby
63
64
  licenses:
64
65
  - Apache-2.0