aws-sdk-neptunegraph 1.0.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.
@@ -0,0 +1,476 @@
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::NeptuneGraph
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
+ # | graph_available | {Client#get_graph} | 60 | 480 |
73
+ # | graph_deleted | {Client#get_graph} | 60 | 60 |
74
+ # | graph_snapshot_available | {Client#get_graph_snapshot} | 60 | 120 |
75
+ # | graph_snapshot_deleted | {Client#get_graph_snapshot} | 60 | 60 |
76
+ # | import_task_cancelled | {Client#get_import_task} | 60 | 60 |
77
+ # | import_task_successful | {Client#get_import_task} | 60 | 480 |
78
+ # | private_graph_endpoint_available | {Client#get_private_graph_endpoint} | 10 | 180 |
79
+ # | private_graph_endpoint_deleted | {Client#get_private_graph_endpoint} | 10 | 180 |
80
+ #
81
+ module Waiters
82
+
83
+ # Wait until Graph is Available
84
+ class GraphAvailable
85
+
86
+ # @param [Hash] options
87
+ # @option options [required, Client] :client
88
+ # @option options [Integer] :max_attempts (480)
89
+ # @option options [Integer] :delay (60)
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: 480,
96
+ delay: 60,
97
+ poller: Aws::Waiters::Poller.new(
98
+ operation_name: :get_graph,
99
+ acceptors: [
100
+ {
101
+ "matcher" => "path",
102
+ "argument" => "status",
103
+ "state" => "failure",
104
+ "expected" => "DELETING"
105
+ },
106
+ {
107
+ "matcher" => "path",
108
+ "argument" => "status",
109
+ "state" => "failure",
110
+ "expected" => "FAILED"
111
+ },
112
+ {
113
+ "matcher" => "path",
114
+ "argument" => "status",
115
+ "state" => "success",
116
+ "expected" => "AVAILABLE"
117
+ }
118
+ ]
119
+ )
120
+ }.merge(options))
121
+ end
122
+
123
+ # @option (see Client#get_graph)
124
+ # @return (see Client#get_graph)
125
+ def wait(params = {})
126
+ @waiter.wait(client: @client, params: params)
127
+ end
128
+
129
+ # @api private
130
+ attr_reader :waiter
131
+
132
+ end
133
+
134
+ # Wait until Graph is Deleted
135
+ class GraphDeleted
136
+
137
+ # @param [Hash] options
138
+ # @option options [required, Client] :client
139
+ # @option options [Integer] :max_attempts (60)
140
+ # @option options [Integer] :delay (60)
141
+ # @option options [Proc] :before_attempt
142
+ # @option options [Proc] :before_wait
143
+ def initialize(options)
144
+ @client = options.fetch(:client)
145
+ @waiter = Aws::Waiters::Waiter.new({
146
+ max_attempts: 60,
147
+ delay: 60,
148
+ poller: Aws::Waiters::Poller.new(
149
+ operation_name: :get_graph,
150
+ acceptors: [
151
+ {
152
+ "matcher" => "path",
153
+ "argument" => "status != 'DELETING'",
154
+ "state" => "failure",
155
+ "expected" => true
156
+ },
157
+ {
158
+ "matcher" => "error",
159
+ "state" => "success",
160
+ "expected" => "ResourceNotFoundException"
161
+ }
162
+ ]
163
+ )
164
+ }.merge(options))
165
+ end
166
+
167
+ # @option (see Client#get_graph)
168
+ # @return (see Client#get_graph)
169
+ def wait(params = {})
170
+ @waiter.wait(client: @client, params: params)
171
+ end
172
+
173
+ # @api private
174
+ attr_reader :waiter
175
+
176
+ end
177
+
178
+ # Wait until GraphSnapshot is Available
179
+ class GraphSnapshotAvailable
180
+
181
+ # @param [Hash] options
182
+ # @option options [required, Client] :client
183
+ # @option options [Integer] :max_attempts (120)
184
+ # @option options [Integer] :delay (60)
185
+ # @option options [Proc] :before_attempt
186
+ # @option options [Proc] :before_wait
187
+ def initialize(options)
188
+ @client = options.fetch(:client)
189
+ @waiter = Aws::Waiters::Waiter.new({
190
+ max_attempts: 120,
191
+ delay: 60,
192
+ poller: Aws::Waiters::Poller.new(
193
+ operation_name: :get_graph_snapshot,
194
+ acceptors: [
195
+ {
196
+ "matcher" => "path",
197
+ "argument" => "status",
198
+ "state" => "failure",
199
+ "expected" => "DELETING"
200
+ },
201
+ {
202
+ "matcher" => "path",
203
+ "argument" => "status",
204
+ "state" => "failure",
205
+ "expected" => "FAILED"
206
+ },
207
+ {
208
+ "matcher" => "path",
209
+ "argument" => "status",
210
+ "state" => "success",
211
+ "expected" => "AVAILABLE"
212
+ }
213
+ ]
214
+ )
215
+ }.merge(options))
216
+ end
217
+
218
+ # @option (see Client#get_graph_snapshot)
219
+ # @return (see Client#get_graph_snapshot)
220
+ def wait(params = {})
221
+ @waiter.wait(client: @client, params: params)
222
+ end
223
+
224
+ # @api private
225
+ attr_reader :waiter
226
+
227
+ end
228
+
229
+ # Wait until GraphSnapshot is Deleted
230
+ class GraphSnapshotDeleted
231
+
232
+ # @param [Hash] options
233
+ # @option options [required, Client] :client
234
+ # @option options [Integer] :max_attempts (60)
235
+ # @option options [Integer] :delay (60)
236
+ # @option options [Proc] :before_attempt
237
+ # @option options [Proc] :before_wait
238
+ def initialize(options)
239
+ @client = options.fetch(:client)
240
+ @waiter = Aws::Waiters::Waiter.new({
241
+ max_attempts: 60,
242
+ delay: 60,
243
+ poller: Aws::Waiters::Poller.new(
244
+ operation_name: :get_graph_snapshot,
245
+ acceptors: [
246
+ {
247
+ "matcher" => "path",
248
+ "argument" => "status != 'DELETING'",
249
+ "state" => "failure",
250
+ "expected" => true
251
+ },
252
+ {
253
+ "matcher" => "error",
254
+ "state" => "success",
255
+ "expected" => "ResourceNotFoundException"
256
+ }
257
+ ]
258
+ )
259
+ }.merge(options))
260
+ end
261
+
262
+ # @option (see Client#get_graph_snapshot)
263
+ # @return (see Client#get_graph_snapshot)
264
+ def wait(params = {})
265
+ @waiter.wait(client: @client, params: params)
266
+ end
267
+
268
+ # @api private
269
+ attr_reader :waiter
270
+
271
+ end
272
+
273
+ # Wait until Import Task is Cancelled
274
+ class ImportTaskCancelled
275
+
276
+ # @param [Hash] options
277
+ # @option options [required, Client] :client
278
+ # @option options [Integer] :max_attempts (60)
279
+ # @option options [Integer] :delay (60)
280
+ # @option options [Proc] :before_attempt
281
+ # @option options [Proc] :before_wait
282
+ def initialize(options)
283
+ @client = options.fetch(:client)
284
+ @waiter = Aws::Waiters::Waiter.new({
285
+ max_attempts: 60,
286
+ delay: 60,
287
+ poller: Aws::Waiters::Poller.new(
288
+ operation_name: :get_import_task,
289
+ acceptors: [
290
+ {
291
+ "matcher" => "path",
292
+ "argument" => "status != 'CANCELLING'",
293
+ "state" => "failure",
294
+ "expected" => true
295
+ },
296
+ {
297
+ "matcher" => "path",
298
+ "argument" => "status",
299
+ "state" => "success",
300
+ "expected" => "CANCELLED"
301
+ }
302
+ ]
303
+ )
304
+ }.merge(options))
305
+ end
306
+
307
+ # @option (see Client#get_import_task)
308
+ # @return (see Client#get_import_task)
309
+ def wait(params = {})
310
+ @waiter.wait(client: @client, params: params)
311
+ end
312
+
313
+ # @api private
314
+ attr_reader :waiter
315
+
316
+ end
317
+
318
+ # Wait until Import Task is Successful
319
+ class ImportTaskSuccessful
320
+
321
+ # @param [Hash] options
322
+ # @option options [required, Client] :client
323
+ # @option options [Integer] :max_attempts (480)
324
+ # @option options [Integer] :delay (60)
325
+ # @option options [Proc] :before_attempt
326
+ # @option options [Proc] :before_wait
327
+ def initialize(options)
328
+ @client = options.fetch(:client)
329
+ @waiter = Aws::Waiters::Waiter.new({
330
+ max_attempts: 480,
331
+ delay: 60,
332
+ poller: Aws::Waiters::Poller.new(
333
+ operation_name: :get_import_task,
334
+ acceptors: [
335
+ {
336
+ "matcher" => "path",
337
+ "argument" => "status",
338
+ "state" => "failure",
339
+ "expected" => "CANCELLING"
340
+ },
341
+ {
342
+ "matcher" => "path",
343
+ "argument" => "status",
344
+ "state" => "failure",
345
+ "expected" => "CANCELLED"
346
+ },
347
+ {
348
+ "matcher" => "path",
349
+ "argument" => "status",
350
+ "state" => "failure",
351
+ "expected" => "ROLLING_BACK"
352
+ },
353
+ {
354
+ "matcher" => "path",
355
+ "argument" => "status",
356
+ "state" => "failure",
357
+ "expected" => "FAILED"
358
+ },
359
+ {
360
+ "matcher" => "path",
361
+ "argument" => "status",
362
+ "state" => "success",
363
+ "expected" => "SUCCEEDED"
364
+ }
365
+ ]
366
+ )
367
+ }.merge(options))
368
+ end
369
+
370
+ # @option (see Client#get_import_task)
371
+ # @return (see Client#get_import_task)
372
+ def wait(params = {})
373
+ @waiter.wait(client: @client, params: params)
374
+ end
375
+
376
+ # @api private
377
+ attr_reader :waiter
378
+
379
+ end
380
+
381
+ # Wait until PrivateGraphEndpoint is Available
382
+ class PrivateGraphEndpointAvailable
383
+
384
+ # @param [Hash] options
385
+ # @option options [required, Client] :client
386
+ # @option options [Integer] :max_attempts (180)
387
+ # @option options [Integer] :delay (10)
388
+ # @option options [Proc] :before_attempt
389
+ # @option options [Proc] :before_wait
390
+ def initialize(options)
391
+ @client = options.fetch(:client)
392
+ @waiter = Aws::Waiters::Waiter.new({
393
+ max_attempts: 180,
394
+ delay: 10,
395
+ poller: Aws::Waiters::Poller.new(
396
+ operation_name: :get_private_graph_endpoint,
397
+ acceptors: [
398
+ {
399
+ "matcher" => "path",
400
+ "argument" => "status",
401
+ "state" => "failure",
402
+ "expected" => "DELETING"
403
+ },
404
+ {
405
+ "matcher" => "path",
406
+ "argument" => "status",
407
+ "state" => "failure",
408
+ "expected" => "FAILED"
409
+ },
410
+ {
411
+ "matcher" => "path",
412
+ "argument" => "status",
413
+ "state" => "success",
414
+ "expected" => "AVAILABLE"
415
+ }
416
+ ]
417
+ )
418
+ }.merge(options))
419
+ end
420
+
421
+ # @option (see Client#get_private_graph_endpoint)
422
+ # @return (see Client#get_private_graph_endpoint)
423
+ def wait(params = {})
424
+ @waiter.wait(client: @client, params: params)
425
+ end
426
+
427
+ # @api private
428
+ attr_reader :waiter
429
+
430
+ end
431
+
432
+ # Wait until PrivateGraphEndpoint is Deleted
433
+ class PrivateGraphEndpointDeleted
434
+
435
+ # @param [Hash] options
436
+ # @option options [required, Client] :client
437
+ # @option options [Integer] :max_attempts (180)
438
+ # @option options [Integer] :delay (10)
439
+ # @option options [Proc] :before_attempt
440
+ # @option options [Proc] :before_wait
441
+ def initialize(options)
442
+ @client = options.fetch(:client)
443
+ @waiter = Aws::Waiters::Waiter.new({
444
+ max_attempts: 180,
445
+ delay: 10,
446
+ poller: Aws::Waiters::Poller.new(
447
+ operation_name: :get_private_graph_endpoint,
448
+ acceptors: [
449
+ {
450
+ "matcher" => "path",
451
+ "argument" => "status != 'DELETING'",
452
+ "state" => "failure",
453
+ "expected" => true
454
+ },
455
+ {
456
+ "matcher" => "error",
457
+ "state" => "success",
458
+ "expected" => "ResourceNotFoundException"
459
+ }
460
+ ]
461
+ )
462
+ }.merge(options))
463
+ end
464
+
465
+ # @option (see Client#get_private_graph_endpoint)
466
+ # @return (see Client#get_private_graph_endpoint)
467
+ def wait(params = {})
468
+ @waiter.wait(client: @client, params: params)
469
+ end
470
+
471
+ # @api private
472
+ attr_reader :waiter
473
+
474
+ end
475
+ end
476
+ end
@@ -16,6 +16,7 @@ require_relative 'aws-sdk-neptunegraph/client_api'
16
16
  require_relative 'aws-sdk-neptunegraph/plugins/endpoints.rb'
17
17
  require_relative 'aws-sdk-neptunegraph/client'
18
18
  require_relative 'aws-sdk-neptunegraph/errors'
19
+ require_relative 'aws-sdk-neptunegraph/waiters'
19
20
  require_relative 'aws-sdk-neptunegraph/resource'
20
21
  require_relative 'aws-sdk-neptunegraph/endpoint_parameters'
21
22
  require_relative 'aws-sdk-neptunegraph/endpoint_provider'
@@ -52,6 +53,6 @@ require_relative 'aws-sdk-neptunegraph/customizations'
52
53
  # @!group service
53
54
  module Aws::NeptuneGraph
54
55
 
55
- GEM_VERSION = '1.0.0'
56
+ GEM_VERSION = '1.2.0'
56
57
 
57
58
  end