aws-sdk-sagemaker 1.1.0 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f5ac5df89d71df99d66eedf98b95157073060d7
4
- data.tar.gz: c5e7233229ee3f5e42171be75f025802af28a889
3
+ metadata.gz: 8b19f4bc63a43c36cc648291e9449a2abf9ee4e7
4
+ data.tar.gz: e88bf65e22d37084d6e8fc7d74a7a65658ea0624
5
5
  SHA512:
6
- metadata.gz: 8b3be42afcef637ac2ff638449e73e871a9c278091650990c571312091354b4d0cbe8e4c4adc62a87ddeeefc3e6f680a48f3d99ea4a9e3904813b3e65a1eb143
7
- data.tar.gz: f0ef76def9613b4a79c0d53c34a84f8958ed57bfc2012a3615feffc7c351586da8c5587bd5cb76a960fee18f53002686ac08734e1d5e65aea2396b0e872e2636
6
+ metadata.gz: 4eba786391193ea80149a06a69dd5402fb2675d158c50944a299315c2136c1f8e1ddc5135e2877f27f42dfa8bb3ce73df972d36c104ff373cba307625950d34c
7
+ data.tar.gz: 4713627bcd4b30d520b8c1d6c7b356064927e7443bf5800e2ad8cb5473c5ec39b7ea704c9d61c723d71b64691ede388b7d3c70592f5e4cb2e9d8e940cfcf5ccc
@@ -43,6 +43,6 @@ require_relative 'aws-sdk-sagemaker/customizations'
43
43
  # @service
44
44
  module Aws::SageMaker
45
45
 
46
- GEM_VERSION = '1.1.0'
46
+ GEM_VERSION = '1.2.0'
47
47
 
48
48
  end
@@ -1876,14 +1876,137 @@ module Aws::SageMaker
1876
1876
  params: params,
1877
1877
  config: config)
1878
1878
  context[:gem_name] = 'aws-sdk-sagemaker'
1879
- context[:gem_version] = '1.1.0'
1879
+ context[:gem_version] = '1.2.0'
1880
1880
  Seahorse::Client::Request.new(handlers, context)
1881
1881
  end
1882
1882
 
1883
+ # Polls an API operation until a resource enters a desired state.
1884
+ #
1885
+ # ## Basic Usage
1886
+ #
1887
+ # A waiter will call an API operation until:
1888
+ #
1889
+ # * It is successful
1890
+ # * It enters a terminal state
1891
+ # * It makes the maximum number of attempts
1892
+ #
1893
+ # In between attempts, the waiter will sleep.
1894
+ #
1895
+ # # polls in a loop, sleeping between attempts
1896
+ # client.waiter_until(waiter_name, params)
1897
+ #
1898
+ # ## Configuration
1899
+ #
1900
+ # You can configure the maximum number of polling attempts, and the
1901
+ # delay (in seconds) between each polling attempt. You can pass
1902
+ # configuration as the final arguments hash.
1903
+ #
1904
+ # # poll for ~25 seconds
1905
+ # client.wait_until(waiter_name, params, {
1906
+ # max_attempts: 5,
1907
+ # delay: 5,
1908
+ # })
1909
+ #
1910
+ # ## Callbacks
1911
+ #
1912
+ # You can be notified before each polling attempt and before each
1913
+ # delay. If you throw `:success` or `:failure` from these callbacks,
1914
+ # it will terminate the waiter.
1915
+ #
1916
+ # started_at = Time.now
1917
+ # client.wait_until(waiter_name, params, {
1918
+ #
1919
+ # # disable max attempts
1920
+ # max_attempts: nil,
1921
+ #
1922
+ # # poll for 1 hour, instead of a number of attempts
1923
+ # before_wait: -> (attempts, response) do
1924
+ # throw :failure if Time.now - started_at > 3600
1925
+ # end
1926
+ # })
1927
+ #
1928
+ # ## Handling Errors
1929
+ #
1930
+ # When a waiter is unsuccessful, it will raise an error.
1931
+ # All of the failure errors extend from
1932
+ # {Aws::Waiters::Errors::WaiterFailed}.
1933
+ #
1934
+ # begin
1935
+ # client.wait_until(...)
1936
+ # rescue Aws::Waiters::Errors::WaiterFailed
1937
+ # # resource did not enter the desired state in time
1938
+ # end
1939
+ #
1940
+ # ## Valid Waiters
1941
+ #
1942
+ # The following table lists the valid waiter names, the operations they call,
1943
+ # and the default `:delay` and `:max_attempts` values.
1944
+ #
1945
+ # | waiter_name | params | :delay | :max_attempts |
1946
+ # | --------------------------------- | ----------------------------- | -------- | ------------- |
1947
+ # | endpoint_deleted | {#describe_endpoint} | 30 | 60 |
1948
+ # | endpoint_in_service | {#describe_endpoint} | 30 | 120 |
1949
+ # | notebook_instance_deleted | {#describe_notebook_instance} | 30 | 60 |
1950
+ # | notebook_instance_in_service | {#describe_notebook_instance} | 30 | 60 |
1951
+ # | notebook_instance_stopped | {#describe_notebook_instance} | 30 | 60 |
1952
+ # | training_job_completed_or_stopped | {#describe_training_job} | 120 | 180 |
1953
+ #
1954
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
1955
+ # because the waiter has entered a state that it will not transition
1956
+ # out of, preventing success.
1957
+ #
1958
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
1959
+ # maximum number of attempts have been made, and the waiter is not
1960
+ # yet successful.
1961
+ #
1962
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
1963
+ # while polling for a resource that is not expected.
1964
+ #
1965
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
1966
+ # for an unknown state.
1967
+ #
1968
+ # @return [Boolean] Returns `true` if the waiter was successful.
1969
+ # @param [Symbol] waiter_name
1970
+ # @param [Hash] params ({})
1971
+ # @param [Hash] options ({})
1972
+ # @option options [Integer] :max_attempts
1973
+ # @option options [Integer] :delay
1974
+ # @option options [Proc] :before_attempt
1975
+ # @option options [Proc] :before_wait
1976
+ def wait_until(waiter_name, params = {}, options = {})
1977
+ w = waiter(waiter_name, options)
1978
+ yield(w.waiter) if block_given? # deprecated
1979
+ w.wait(params)
1980
+ end
1981
+
1883
1982
  # @api private
1884
1983
  # @deprecated
1885
1984
  def waiter_names
1886
- []
1985
+ waiters.keys
1986
+ end
1987
+
1988
+ private
1989
+
1990
+ # @param [Symbol] waiter_name
1991
+ # @param [Hash] options ({})
1992
+ def waiter(waiter_name, options = {})
1993
+ waiter_class = waiters[waiter_name]
1994
+ if waiter_class
1995
+ waiter_class.new(options.merge(client: self))
1996
+ else
1997
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
1998
+ end
1999
+ end
2000
+
2001
+ def waiters
2002
+ {
2003
+ endpoint_deleted: Waiters::EndpointDeleted,
2004
+ endpoint_in_service: Waiters::EndpointInService,
2005
+ notebook_instance_deleted: Waiters::NotebookInstanceDeleted,
2006
+ notebook_instance_in_service: Waiters::NotebookInstanceInService,
2007
+ notebook_instance_stopped: Waiters::NotebookInstanceStopped,
2008
+ training_job_completed_or_stopped: Waiters::TrainingJobCompletedOrStopped
2009
+ }
1887
2010
  end
1888
2011
 
1889
2012
  class << self
@@ -9,5 +9,283 @@ require 'aws-sdk-core/waiters'
9
9
 
10
10
  module Aws::SageMaker
11
11
  module Waiters
12
+
13
+ class EndpointDeleted
14
+
15
+ # @param [Hash] options
16
+ # @option options [required, Client] :client
17
+ # @option options [Integer] :max_attempts (60)
18
+ # @option options [Integer] :delay (30)
19
+ # @option options [Proc] :before_attempt
20
+ # @option options [Proc] :before_wait
21
+ def initialize(options)
22
+ @client = options.fetch(:client)
23
+ @waiter = Aws::Waiters::Waiter.new({
24
+ max_attempts: 60,
25
+ delay: 30,
26
+ poller: Aws::Waiters::Poller.new(
27
+ operation_name: :describe_endpoint,
28
+ acceptors: [
29
+ {
30
+ "expected" => "ValidationException",
31
+ "matcher" => "error",
32
+ "state" => "success"
33
+ },
34
+ {
35
+ "expected" => "Failed",
36
+ "matcher" => "path",
37
+ "state" => "failure",
38
+ "argument" => "endpoint_status"
39
+ }
40
+ ]
41
+ )
42
+ }.merge(options))
43
+ end
44
+
45
+ # @option (see Client#describe_endpoint)
46
+ # @return (see Client#describe_endpoint)
47
+ def wait(params = {})
48
+ @waiter.wait(client: @client, params: params)
49
+ end
50
+
51
+ # @api private
52
+ attr_reader :waiter
53
+
54
+ end
55
+
56
+ class EndpointInService
57
+
58
+ # @param [Hash] options
59
+ # @option options [required, Client] :client
60
+ # @option options [Integer] :max_attempts (120)
61
+ # @option options [Integer] :delay (30)
62
+ # @option options [Proc] :before_attempt
63
+ # @option options [Proc] :before_wait
64
+ def initialize(options)
65
+ @client = options.fetch(:client)
66
+ @waiter = Aws::Waiters::Waiter.new({
67
+ max_attempts: 120,
68
+ delay: 30,
69
+ poller: Aws::Waiters::Poller.new(
70
+ operation_name: :describe_endpoint,
71
+ acceptors: [
72
+ {
73
+ "expected" => "InService",
74
+ "matcher" => "path",
75
+ "state" => "success",
76
+ "argument" => "endpoint_status"
77
+ },
78
+ {
79
+ "expected" => "Failed",
80
+ "matcher" => "path",
81
+ "state" => "failure",
82
+ "argument" => "endpoint_status"
83
+ },
84
+ {
85
+ "expected" => "ValidationException",
86
+ "matcher" => "error",
87
+ "state" => "failure"
88
+ }
89
+ ]
90
+ )
91
+ }.merge(options))
92
+ end
93
+
94
+ # @option (see Client#describe_endpoint)
95
+ # @return (see Client#describe_endpoint)
96
+ def wait(params = {})
97
+ @waiter.wait(client: @client, params: params)
98
+ end
99
+
100
+ # @api private
101
+ attr_reader :waiter
102
+
103
+ end
104
+
105
+ class NotebookInstanceDeleted
106
+
107
+ # @param [Hash] options
108
+ # @option options [required, Client] :client
109
+ # @option options [Integer] :max_attempts (60)
110
+ # @option options [Integer] :delay (30)
111
+ # @option options [Proc] :before_attempt
112
+ # @option options [Proc] :before_wait
113
+ def initialize(options)
114
+ @client = options.fetch(:client)
115
+ @waiter = Aws::Waiters::Waiter.new({
116
+ max_attempts: 60,
117
+ delay: 30,
118
+ poller: Aws::Waiters::Poller.new(
119
+ operation_name: :describe_notebook_instance,
120
+ acceptors: [
121
+ {
122
+ "expected" => "ValidationException",
123
+ "matcher" => "error",
124
+ "state" => "success"
125
+ },
126
+ {
127
+ "expected" => "Failed",
128
+ "matcher" => "path",
129
+ "state" => "failure",
130
+ "argument" => "notebook_instance_status"
131
+ }
132
+ ]
133
+ )
134
+ }.merge(options))
135
+ end
136
+
137
+ # @option (see Client#describe_notebook_instance)
138
+ # @return (see Client#describe_notebook_instance)
139
+ def wait(params = {})
140
+ @waiter.wait(client: @client, params: params)
141
+ end
142
+
143
+ # @api private
144
+ attr_reader :waiter
145
+
146
+ end
147
+
148
+ class NotebookInstanceInService
149
+
150
+ # @param [Hash] options
151
+ # @option options [required, Client] :client
152
+ # @option options [Integer] :max_attempts (60)
153
+ # @option options [Integer] :delay (30)
154
+ # @option options [Proc] :before_attempt
155
+ # @option options [Proc] :before_wait
156
+ def initialize(options)
157
+ @client = options.fetch(:client)
158
+ @waiter = Aws::Waiters::Waiter.new({
159
+ max_attempts: 60,
160
+ delay: 30,
161
+ poller: Aws::Waiters::Poller.new(
162
+ operation_name: :describe_notebook_instance,
163
+ acceptors: [
164
+ {
165
+ "expected" => "InService",
166
+ "matcher" => "path",
167
+ "state" => "success",
168
+ "argument" => "notebook_instance_status"
169
+ },
170
+ {
171
+ "expected" => "Failed",
172
+ "matcher" => "path",
173
+ "state" => "failure",
174
+ "argument" => "notebook_instance_status"
175
+ }
176
+ ]
177
+ )
178
+ }.merge(options))
179
+ end
180
+
181
+ # @option (see Client#describe_notebook_instance)
182
+ # @return (see Client#describe_notebook_instance)
183
+ def wait(params = {})
184
+ @waiter.wait(client: @client, params: params)
185
+ end
186
+
187
+ # @api private
188
+ attr_reader :waiter
189
+
190
+ end
191
+
192
+ class NotebookInstanceStopped
193
+
194
+ # @param [Hash] options
195
+ # @option options [required, Client] :client
196
+ # @option options [Integer] :max_attempts (60)
197
+ # @option options [Integer] :delay (30)
198
+ # @option options [Proc] :before_attempt
199
+ # @option options [Proc] :before_wait
200
+ def initialize(options)
201
+ @client = options.fetch(:client)
202
+ @waiter = Aws::Waiters::Waiter.new({
203
+ max_attempts: 60,
204
+ delay: 30,
205
+ poller: Aws::Waiters::Poller.new(
206
+ operation_name: :describe_notebook_instance,
207
+ acceptors: [
208
+ {
209
+ "expected" => "Stopped",
210
+ "matcher" => "path",
211
+ "state" => "success",
212
+ "argument" => "notebook_instance_status"
213
+ },
214
+ {
215
+ "expected" => "Failed",
216
+ "matcher" => "path",
217
+ "state" => "failure",
218
+ "argument" => "notebook_instance_status"
219
+ }
220
+ ]
221
+ )
222
+ }.merge(options))
223
+ end
224
+
225
+ # @option (see Client#describe_notebook_instance)
226
+ # @return (see Client#describe_notebook_instance)
227
+ def wait(params = {})
228
+ @waiter.wait(client: @client, params: params)
229
+ end
230
+
231
+ # @api private
232
+ attr_reader :waiter
233
+
234
+ end
235
+
236
+ class TrainingJobCompletedOrStopped
237
+
238
+ # @param [Hash] options
239
+ # @option options [required, Client] :client
240
+ # @option options [Integer] :max_attempts (180)
241
+ # @option options [Integer] :delay (120)
242
+ # @option options [Proc] :before_attempt
243
+ # @option options [Proc] :before_wait
244
+ def initialize(options)
245
+ @client = options.fetch(:client)
246
+ @waiter = Aws::Waiters::Waiter.new({
247
+ max_attempts: 180,
248
+ delay: 120,
249
+ poller: Aws::Waiters::Poller.new(
250
+ operation_name: :describe_training_job,
251
+ acceptors: [
252
+ {
253
+ "expected" => "Completed",
254
+ "matcher" => "path",
255
+ "state" => "success",
256
+ "argument" => "training_job_status"
257
+ },
258
+ {
259
+ "expected" => "Stopped",
260
+ "matcher" => "path",
261
+ "state" => "success",
262
+ "argument" => "training_job_status"
263
+ },
264
+ {
265
+ "expected" => "Failed",
266
+ "matcher" => "path",
267
+ "state" => "failure",
268
+ "argument" => "training_job_status"
269
+ },
270
+ {
271
+ "expected" => "ValidationException",
272
+ "matcher" => "error",
273
+ "state" => "failure"
274
+ }
275
+ ]
276
+ )
277
+ }.merge(options))
278
+ end
279
+
280
+ # @option (see Client#describe_training_job)
281
+ # @return (see Client#describe_training_job)
282
+ def wait(params = {})
283
+ @waiter.wait(client: @client, params: params)
284
+ end
285
+
286
+ # @api private
287
+ attr_reader :waiter
288
+
289
+ end
12
290
  end
13
291
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-sagemaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.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: 2017-12-01 00:00:00.000000000 Z
11
+ date: 2017-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core