aws-sdk-proton 1.0.0 → 1.1.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
  SHA256:
3
- metadata.gz: 72bd27242b366b260531c5db225966fa7c884cbc5c11177889cc41862f6115bb
4
- data.tar.gz: 14485e3ecc45a0c019ee3cbf836c991504a0b3d9c3a059db5a05fce5b40cbb40
3
+ metadata.gz: 74aa5afb9c8569e90b900a049ba377cba55999b4c851bbab79b3983f57e7f0b0
4
+ data.tar.gz: 95004813b6014ce85aa9809e0c537e47f739ac8a484c93de24359c744c780af4
5
5
  SHA512:
6
- metadata.gz: '058f1387af421e8b26b3cb09423cf722a7194fb093fb23891603a0652290deac1fc21b02d5d300fdb26e6308a85deb5212a4b305b6529e083362d460e1f1e96b'
7
- data.tar.gz: 1ac1a0a5df9a36c89b14b7680667dca610a8f82a771dfd2ef12fd0f31df1535df8125fec3219c731176e7ac0ae41c45561355537864dd9c4914f7f850b1b46ee
6
+ metadata.gz: 5d20167348156a29b01535fb836099e895e11fc136cfac0687f504a8461888c9573d903f880028a5349bd9295f6a580394c6d3d8368a56de0c6a9061ca8c7521
7
+ data.tar.gz: 90e25b4eb9da531285e978f4f6a76d36b5f6e6ddd30d0461b776b515a832754f1df220bfba0ee1bb1c2d2c68a181cc317d65ab748df536144ba594a9e365302d
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.1.0 (2021-06-25)
5
+ ------------------
6
+
7
+ * Feature - Added waiters for template registration, service operations, and environment deployments.
8
+
4
9
  1.0.0 (2021-06-09)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.1.0
@@ -15,6 +15,7 @@ require_relative 'aws-sdk-proton/types'
15
15
  require_relative 'aws-sdk-proton/client_api'
16
16
  require_relative 'aws-sdk-proton/client'
17
17
  require_relative 'aws-sdk-proton/errors'
18
+ require_relative 'aws-sdk-proton/waiters'
18
19
  require_relative 'aws-sdk-proton/resource'
19
20
  require_relative 'aws-sdk-proton/customizations'
20
21
 
@@ -48,6 +49,6 @@ require_relative 'aws-sdk-proton/customizations'
48
49
  # @!group service
49
50
  module Aws::Proton
50
51
 
51
- GEM_VERSION = '1.0.0'
52
+ GEM_VERSION = '1.1.0'
52
53
 
53
54
  end
@@ -1617,6 +1617,11 @@ module Aws::Proton
1617
1617
  # resp.environment.template_minor_version #=> String
1618
1618
  # resp.environment.template_name #=> String
1619
1619
  #
1620
+ #
1621
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
1622
+ #
1623
+ # * environment_deployed
1624
+ #
1620
1625
  # @see http://docs.aws.amazon.com/goto/WebAPI/proton-2020-07-20/GetEnvironment AWS API Documentation
1621
1626
  #
1622
1627
  # @overload get_environment(params = {})
@@ -1744,6 +1749,11 @@ module Aws::Proton
1744
1749
  # resp.environment_template_version.status_message #=> String
1745
1750
  # resp.environment_template_version.template_name #=> String
1746
1751
  #
1752
+ #
1753
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
1754
+ #
1755
+ # * environment_template_version_registered
1756
+ #
1747
1757
  # @see http://docs.aws.amazon.com/goto/WebAPI/proton-2020-07-20/GetEnvironmentTemplateVersion AWS API Documentation
1748
1758
  #
1749
1759
  # @overload get_environment_template_version(params = {})
@@ -1793,6 +1803,14 @@ module Aws::Proton
1793
1803
  # resp.service.status_message #=> String
1794
1804
  # resp.service.template_name #=> String
1795
1805
  #
1806
+ #
1807
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
1808
+ #
1809
+ # * service_created
1810
+ # * service_deleted
1811
+ # * service_pipeline_deployed
1812
+ # * service_updated
1813
+ #
1796
1814
  # @see http://docs.aws.amazon.com/goto/WebAPI/proton-2020-07-20/GetService AWS API Documentation
1797
1815
  #
1798
1816
  # @overload get_service(params = {})
@@ -1840,6 +1858,11 @@ module Aws::Proton
1840
1858
  # resp.service_instance.template_minor_version #=> String
1841
1859
  # resp.service_instance.template_name #=> String
1842
1860
  #
1861
+ #
1862
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
1863
+ #
1864
+ # * service_instance_deployed
1865
+ #
1843
1866
  # @see http://docs.aws.amazon.com/goto/WebAPI/proton-2020-07-20/GetServiceInstance AWS API Documentation
1844
1867
  #
1845
1868
  # @overload get_service_instance(params = {})
@@ -1927,6 +1950,11 @@ module Aws::Proton
1927
1950
  # resp.service_template_version.status_message #=> String
1928
1951
  # resp.service_template_version.template_name #=> String
1929
1952
  #
1953
+ #
1954
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
1955
+ #
1956
+ # * service_template_version_registered
1957
+ #
1930
1958
  # @see http://docs.aws.amazon.com/goto/WebAPI/proton-2020-07-20/GetServiceTemplateVersion AWS API Documentation
1931
1959
  #
1932
1960
  # @overload get_service_template_version(params = {})
@@ -3364,14 +3392,141 @@ module Aws::Proton
3364
3392
  params: params,
3365
3393
  config: config)
3366
3394
  context[:gem_name] = 'aws-sdk-proton'
3367
- context[:gem_version] = '1.0.0'
3395
+ context[:gem_version] = '1.1.0'
3368
3396
  Seahorse::Client::Request.new(handlers, context)
3369
3397
  end
3370
3398
 
3399
+ # Polls an API operation until a resource enters a desired state.
3400
+ #
3401
+ # ## Basic Usage
3402
+ #
3403
+ # A waiter will call an API operation until:
3404
+ #
3405
+ # * It is successful
3406
+ # * It enters a terminal state
3407
+ # * It makes the maximum number of attempts
3408
+ #
3409
+ # In between attempts, the waiter will sleep.
3410
+ #
3411
+ # # polls in a loop, sleeping between attempts
3412
+ # client.wait_until(waiter_name, params)
3413
+ #
3414
+ # ## Configuration
3415
+ #
3416
+ # You can configure the maximum number of polling attempts, and the
3417
+ # delay (in seconds) between each polling attempt. You can pass
3418
+ # configuration as the final arguments hash.
3419
+ #
3420
+ # # poll for ~25 seconds
3421
+ # client.wait_until(waiter_name, params, {
3422
+ # max_attempts: 5,
3423
+ # delay: 5,
3424
+ # })
3425
+ #
3426
+ # ## Callbacks
3427
+ #
3428
+ # You can be notified before each polling attempt and before each
3429
+ # delay. If you throw `:success` or `:failure` from these callbacks,
3430
+ # it will terminate the waiter.
3431
+ #
3432
+ # started_at = Time.now
3433
+ # client.wait_until(waiter_name, params, {
3434
+ #
3435
+ # # disable max attempts
3436
+ # max_attempts: nil,
3437
+ #
3438
+ # # poll for 1 hour, instead of a number of attempts
3439
+ # before_wait: -> (attempts, response) do
3440
+ # throw :failure if Time.now - started_at > 3600
3441
+ # end
3442
+ # })
3443
+ #
3444
+ # ## Handling Errors
3445
+ #
3446
+ # When a waiter is unsuccessful, it will raise an error.
3447
+ # All of the failure errors extend from
3448
+ # {Aws::Waiters::Errors::WaiterFailed}.
3449
+ #
3450
+ # begin
3451
+ # client.wait_until(...)
3452
+ # rescue Aws::Waiters::Errors::WaiterFailed
3453
+ # # resource did not enter the desired state in time
3454
+ # end
3455
+ #
3456
+ # ## Valid Waiters
3457
+ #
3458
+ # The following table lists the valid waiter names, the operations they call,
3459
+ # and the default `:delay` and `:max_attempts` values.
3460
+ #
3461
+ # | waiter_name | params | :delay | :max_attempts |
3462
+ # | --------------------------------------- | ----------------------------------------- | -------- | ------------- |
3463
+ # | environment_deployed | {Client#get_environment} | 5 | 999 |
3464
+ # | environment_template_version_registered | {Client#get_environment_template_version} | 2 | 150 |
3465
+ # | service_created | {Client#get_service} | 5 | 999 |
3466
+ # | service_deleted | {Client#get_service} | 5 | 999 |
3467
+ # | service_instance_deployed | {Client#get_service_instance} | 5 | 999 |
3468
+ # | service_pipeline_deployed | {Client#get_service} | 10 | 360 |
3469
+ # | service_template_version_registered | {Client#get_service_template_version} | 2 | 150 |
3470
+ # | service_updated | {Client#get_service} | 5 | 999 |
3471
+ #
3472
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
3473
+ # because the waiter has entered a state that it will not transition
3474
+ # out of, preventing success.
3475
+ #
3476
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
3477
+ # maximum number of attempts have been made, and the waiter is not
3478
+ # yet successful.
3479
+ #
3480
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
3481
+ # while polling for a resource that is not expected.
3482
+ #
3483
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
3484
+ # for an unknown state.
3485
+ #
3486
+ # @return [Boolean] Returns `true` if the waiter was successful.
3487
+ # @param [Symbol] waiter_name
3488
+ # @param [Hash] params ({})
3489
+ # @param [Hash] options ({})
3490
+ # @option options [Integer] :max_attempts
3491
+ # @option options [Integer] :delay
3492
+ # @option options [Proc] :before_attempt
3493
+ # @option options [Proc] :before_wait
3494
+ def wait_until(waiter_name, params = {}, options = {})
3495
+ w = waiter(waiter_name, options)
3496
+ yield(w.waiter) if block_given? # deprecated
3497
+ w.wait(params)
3498
+ end
3499
+
3371
3500
  # @api private
3372
3501
  # @deprecated
3373
3502
  def waiter_names
3374
- []
3503
+ waiters.keys
3504
+ end
3505
+
3506
+ private
3507
+
3508
+ # @param [Symbol] waiter_name
3509
+ # @param [Hash] options ({})
3510
+ def waiter(waiter_name, options = {})
3511
+ waiter_class = waiters[waiter_name]
3512
+ if waiter_class
3513
+ waiter_class.new(options.merge(client: self))
3514
+ else
3515
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
3516
+ end
3517
+ end
3518
+
3519
+ def waiters
3520
+ {
3521
+ environment_deployed: Waiters::EnvironmentDeployed,
3522
+ environment_template_version_registered: Waiters::EnvironmentTemplateVersionRegistered,
3523
+ service_created: Waiters::ServiceCreated,
3524
+ service_deleted: Waiters::ServiceDeleted,
3525
+ service_instance_deployed: Waiters::ServiceInstanceDeployed,
3526
+ service_pipeline_deployed: Waiters::ServicePipelineDeployed,
3527
+ service_template_version_registered: Waiters::ServiceTemplateVersionRegistered,
3528
+ service_updated: Waiters::ServiceUpdated
3529
+ }
3375
3530
  end
3376
3531
 
3377
3532
  class << self
@@ -0,0 +1,484 @@
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::Proton
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
+ # | environment_deployed | {Client#get_environment} | 5 | 999 |
73
+ # | environment_template_version_registered | {Client#get_environment_template_version} | 2 | 150 |
74
+ # | service_created | {Client#get_service} | 5 | 999 |
75
+ # | service_deleted | {Client#get_service} | 5 | 999 |
76
+ # | service_instance_deployed | {Client#get_service_instance} | 5 | 999 |
77
+ # | service_pipeline_deployed | {Client#get_service} | 10 | 360 |
78
+ # | service_template_version_registered | {Client#get_service_template_version} | 2 | 150 |
79
+ # | service_updated | {Client#get_service} | 5 | 999 |
80
+ #
81
+ module Waiters
82
+
83
+ # Wait until an Environment is deployed. Use this after invoking CreateEnvironment or UpdateEnvironment
84
+ class EnvironmentDeployed
85
+
86
+ # @param [Hash] options
87
+ # @option options [required, Client] :client
88
+ # @option options [Integer] :max_attempts (999)
89
+ # @option options [Integer] :delay (5)
90
+ # @option options [Proc] :before_attempt
91
+ # @option options [Proc] :before_wait
92
+ def initialize(options)
93
+ @client = options.fetch(:client)
94
+ @waiter = Aws::Waiters::Waiter.new({
95
+ max_attempts: 999,
96
+ delay: 5,
97
+ poller: Aws::Waiters::Poller.new(
98
+ operation_name: :get_environment,
99
+ acceptors: [
100
+ {
101
+ "matcher" => "path",
102
+ "argument" => "environment.deployment_status",
103
+ "state" => "success",
104
+ "expected" => "SUCCEEDED"
105
+ },
106
+ {
107
+ "matcher" => "path",
108
+ "argument" => "environment.deployment_status",
109
+ "state" => "failure",
110
+ "expected" => "FAILED"
111
+ }
112
+ ]
113
+ )
114
+ }.merge(options))
115
+ end
116
+
117
+ # @option (see Client#get_environment)
118
+ # @return (see Client#get_environment)
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
+ # Wait until an EnvironmentTemplateVersion is registered. Use this after invoking CreateEnvironmentTemplateVersion
129
+ class EnvironmentTemplateVersionRegistered
130
+
131
+ # @param [Hash] options
132
+ # @option options [required, Client] :client
133
+ # @option options [Integer] :max_attempts (150)
134
+ # @option options [Integer] :delay (2)
135
+ # @option options [Proc] :before_attempt
136
+ # @option options [Proc] :before_wait
137
+ def initialize(options)
138
+ @client = options.fetch(:client)
139
+ @waiter = Aws::Waiters::Waiter.new({
140
+ max_attempts: 150,
141
+ delay: 2,
142
+ poller: Aws::Waiters::Poller.new(
143
+ operation_name: :get_environment_template_version,
144
+ acceptors: [
145
+ {
146
+ "matcher" => "path",
147
+ "argument" => "environment_template_version.status",
148
+ "state" => "success",
149
+ "expected" => "DRAFT"
150
+ },
151
+ {
152
+ "matcher" => "path",
153
+ "argument" => "environment_template_version.status",
154
+ "state" => "success",
155
+ "expected" => "PUBLISHED"
156
+ },
157
+ {
158
+ "matcher" => "path",
159
+ "argument" => "environment_template_version.status",
160
+ "state" => "failure",
161
+ "expected" => "REGISTRATION_FAILED"
162
+ }
163
+ ]
164
+ )
165
+ }.merge(options))
166
+ end
167
+
168
+ # @option (see Client#get_environment_template_version)
169
+ # @return (see Client#get_environment_template_version)
170
+ def wait(params = {})
171
+ @waiter.wait(client: @client, params: params)
172
+ end
173
+
174
+ # @api private
175
+ attr_reader :waiter
176
+
177
+ end
178
+
179
+ # Wait until an Service has deployed its instances and possibly pipeline. Use this after invoking CreateService
180
+ class ServiceCreated
181
+
182
+ # @param [Hash] options
183
+ # @option options [required, Client] :client
184
+ # @option options [Integer] :max_attempts (999)
185
+ # @option options [Integer] :delay (5)
186
+ # @option options [Proc] :before_attempt
187
+ # @option options [Proc] :before_wait
188
+ def initialize(options)
189
+ @client = options.fetch(:client)
190
+ @waiter = Aws::Waiters::Waiter.new({
191
+ max_attempts: 999,
192
+ delay: 5,
193
+ poller: Aws::Waiters::Poller.new(
194
+ operation_name: :get_service,
195
+ acceptors: [
196
+ {
197
+ "matcher" => "path",
198
+ "argument" => "service.status",
199
+ "state" => "success",
200
+ "expected" => "ACTIVE"
201
+ },
202
+ {
203
+ "matcher" => "path",
204
+ "argument" => "service.status",
205
+ "state" => "failure",
206
+ "expected" => "CREATE_FAILED_CLEANUP_COMPLETE"
207
+ },
208
+ {
209
+ "matcher" => "path",
210
+ "argument" => "service.status",
211
+ "state" => "failure",
212
+ "expected" => "CREATE_FAILED_CLEANUP_FAILED"
213
+ },
214
+ {
215
+ "matcher" => "path",
216
+ "argument" => "service.status",
217
+ "state" => "failure",
218
+ "expected" => "CREATE_FAILED"
219
+ }
220
+ ]
221
+ )
222
+ }.merge(options))
223
+ end
224
+
225
+ # @option (see Client#get_service)
226
+ # @return (see Client#get_service)
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
+ # Wait until a Service, its instances, and possibly pipeline have been deleted after DeleteService is invoked
237
+ class ServiceDeleted
238
+
239
+ # @param [Hash] options
240
+ # @option options [required, Client] :client
241
+ # @option options [Integer] :max_attempts (999)
242
+ # @option options [Integer] :delay (5)
243
+ # @option options [Proc] :before_attempt
244
+ # @option options [Proc] :before_wait
245
+ def initialize(options)
246
+ @client = options.fetch(:client)
247
+ @waiter = Aws::Waiters::Waiter.new({
248
+ max_attempts: 999,
249
+ delay: 5,
250
+ poller: Aws::Waiters::Poller.new(
251
+ operation_name: :get_service,
252
+ acceptors: [
253
+ {
254
+ "matcher" => "error",
255
+ "state" => "success",
256
+ "expected" => "ResourceNotFoundException"
257
+ },
258
+ {
259
+ "matcher" => "path",
260
+ "argument" => "service.status",
261
+ "state" => "failure",
262
+ "expected" => "DELETE_FAILED"
263
+ }
264
+ ]
265
+ )
266
+ }.merge(options))
267
+ end
268
+
269
+ # @option (see Client#get_service)
270
+ # @return (see Client#get_service)
271
+ def wait(params = {})
272
+ @waiter.wait(client: @client, params: params)
273
+ end
274
+
275
+ # @api private
276
+ attr_reader :waiter
277
+
278
+ end
279
+
280
+ # Wait until a ServiceInstance is deployed. Use this after invoking CreateService or UpdateServiceInstance
281
+ class ServiceInstanceDeployed
282
+
283
+ # @param [Hash] options
284
+ # @option options [required, Client] :client
285
+ # @option options [Integer] :max_attempts (999)
286
+ # @option options [Integer] :delay (5)
287
+ # @option options [Proc] :before_attempt
288
+ # @option options [Proc] :before_wait
289
+ def initialize(options)
290
+ @client = options.fetch(:client)
291
+ @waiter = Aws::Waiters::Waiter.new({
292
+ max_attempts: 999,
293
+ delay: 5,
294
+ poller: Aws::Waiters::Poller.new(
295
+ operation_name: :get_service_instance,
296
+ acceptors: [
297
+ {
298
+ "matcher" => "path",
299
+ "argument" => "service_instance.deployment_status",
300
+ "state" => "success",
301
+ "expected" => "SUCCEEDED"
302
+ },
303
+ {
304
+ "matcher" => "path",
305
+ "argument" => "service_instance.deployment_status",
306
+ "state" => "failure",
307
+ "expected" => "FAILED"
308
+ }
309
+ ]
310
+ )
311
+ }.merge(options))
312
+ end
313
+
314
+ # @option (see Client#get_service_instance)
315
+ # @return (see Client#get_service_instance)
316
+ def wait(params = {})
317
+ @waiter.wait(client: @client, params: params)
318
+ end
319
+
320
+ # @api private
321
+ attr_reader :waiter
322
+
323
+ end
324
+
325
+ # Wait until an ServicePipeline is deployed. Use this after invoking CreateService or UpdateServicePipeline
326
+ class ServicePipelineDeployed
327
+
328
+ # @param [Hash] options
329
+ # @option options [required, Client] :client
330
+ # @option options [Integer] :max_attempts (360)
331
+ # @option options [Integer] :delay (10)
332
+ # @option options [Proc] :before_attempt
333
+ # @option options [Proc] :before_wait
334
+ def initialize(options)
335
+ @client = options.fetch(:client)
336
+ @waiter = Aws::Waiters::Waiter.new({
337
+ max_attempts: 360,
338
+ delay: 10,
339
+ poller: Aws::Waiters::Poller.new(
340
+ operation_name: :get_service,
341
+ acceptors: [
342
+ {
343
+ "matcher" => "path",
344
+ "argument" => "service.pipeline.deployment_status",
345
+ "state" => "success",
346
+ "expected" => "SUCCEEDED"
347
+ },
348
+ {
349
+ "matcher" => "path",
350
+ "argument" => "service.pipeline.deployment_status",
351
+ "state" => "failure",
352
+ "expected" => "FAILED"
353
+ }
354
+ ]
355
+ )
356
+ }.merge(options))
357
+ end
358
+
359
+ # @option (see Client#get_service)
360
+ # @return (see Client#get_service)
361
+ def wait(params = {})
362
+ @waiter.wait(client: @client, params: params)
363
+ end
364
+
365
+ # @api private
366
+ attr_reader :waiter
367
+
368
+ end
369
+
370
+ # Wait until a ServiceTemplateVersion is registered. Use this after invoking CreateServiceTemplateVersion
371
+ class ServiceTemplateVersionRegistered
372
+
373
+ # @param [Hash] options
374
+ # @option options [required, Client] :client
375
+ # @option options [Integer] :max_attempts (150)
376
+ # @option options [Integer] :delay (2)
377
+ # @option options [Proc] :before_attempt
378
+ # @option options [Proc] :before_wait
379
+ def initialize(options)
380
+ @client = options.fetch(:client)
381
+ @waiter = Aws::Waiters::Waiter.new({
382
+ max_attempts: 150,
383
+ delay: 2,
384
+ poller: Aws::Waiters::Poller.new(
385
+ operation_name: :get_service_template_version,
386
+ acceptors: [
387
+ {
388
+ "matcher" => "path",
389
+ "argument" => "service_template_version.status",
390
+ "state" => "success",
391
+ "expected" => "DRAFT"
392
+ },
393
+ {
394
+ "matcher" => "path",
395
+ "argument" => "service_template_version.status",
396
+ "state" => "success",
397
+ "expected" => "PUBLISHED"
398
+ },
399
+ {
400
+ "matcher" => "path",
401
+ "argument" => "service_template_version.status",
402
+ "state" => "failure",
403
+ "expected" => "REGISTRATION_FAILED"
404
+ }
405
+ ]
406
+ )
407
+ }.merge(options))
408
+ end
409
+
410
+ # @option (see Client#get_service_template_version)
411
+ # @return (see Client#get_service_template_version)
412
+ def wait(params = {})
413
+ @waiter.wait(client: @client, params: params)
414
+ end
415
+
416
+ # @api private
417
+ attr_reader :waiter
418
+
419
+ end
420
+
421
+ # Wait until a Service, its instances, and possibly pipeline have been deployed after UpdateService is invoked
422
+ class ServiceUpdated
423
+
424
+ # @param [Hash] options
425
+ # @option options [required, Client] :client
426
+ # @option options [Integer] :max_attempts (999)
427
+ # @option options [Integer] :delay (5)
428
+ # @option options [Proc] :before_attempt
429
+ # @option options [Proc] :before_wait
430
+ def initialize(options)
431
+ @client = options.fetch(:client)
432
+ @waiter = Aws::Waiters::Waiter.new({
433
+ max_attempts: 999,
434
+ delay: 5,
435
+ poller: Aws::Waiters::Poller.new(
436
+ operation_name: :get_service,
437
+ acceptors: [
438
+ {
439
+ "matcher" => "path",
440
+ "argument" => "service.status",
441
+ "state" => "success",
442
+ "expected" => "ACTIVE"
443
+ },
444
+ {
445
+ "matcher" => "path",
446
+ "argument" => "service.status",
447
+ "state" => "failure",
448
+ "expected" => "UPDATE_FAILED_CLEANUP_COMPLETE"
449
+ },
450
+ {
451
+ "matcher" => "path",
452
+ "argument" => "service.status",
453
+ "state" => "failure",
454
+ "expected" => "UPDATE_FAILED_CLEANUP_FAILED"
455
+ },
456
+ {
457
+ "matcher" => "path",
458
+ "argument" => "service.status",
459
+ "state" => "failure",
460
+ "expected" => "UPDATE_FAILED"
461
+ },
462
+ {
463
+ "matcher" => "path",
464
+ "argument" => "service.status",
465
+ "state" => "failure",
466
+ "expected" => "UPDATE_COMPLETE_CLEANUP_FAILED"
467
+ }
468
+ ]
469
+ )
470
+ }.merge(options))
471
+ end
472
+
473
+ # @option (see Client#get_service)
474
+ # @return (see Client#get_service)
475
+ def wait(params = {})
476
+ @waiter.wait(client: @client, params: params)
477
+ end
478
+
479
+ # @api private
480
+ attr_reader :waiter
481
+
482
+ end
483
+ end
484
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-proton
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.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: 2021-06-09 00:00:00.000000000 Z
11
+ date: 2021-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -62,6 +62,7 @@ files:
62
62
  - lib/aws-sdk-proton/errors.rb
63
63
  - lib/aws-sdk-proton/resource.rb
64
64
  - lib/aws-sdk-proton/types.rb
65
+ - lib/aws-sdk-proton/waiters.rb
65
66
  homepage: https://github.com/aws/aws-sdk-ruby
66
67
  licenses:
67
68
  - Apache-2.0