aws-sdk-ssmincidents 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,184 @@
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::SSMIncidents
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
+ # | wait_for_replication_set_active | {Client#get_replication_set} | 30 | 5 |
73
+ # | wait_for_replication_set_deleted | {Client#get_replication_set} | 30 | 5 |
74
+ #
75
+ module Waiters
76
+
77
+ # Wait for a replication set to become ACTIVE
78
+ class WaitForReplicationSetActive
79
+
80
+ # @param [Hash] options
81
+ # @option options [required, Client] :client
82
+ # @option options [Integer] :max_attempts (5)
83
+ # @option options [Integer] :delay (30)
84
+ # @option options [Proc] :before_attempt
85
+ # @option options [Proc] :before_wait
86
+ def initialize(options)
87
+ @client = options.fetch(:client)
88
+ @waiter = Aws::Waiters::Waiter.new({
89
+ max_attempts: 5,
90
+ delay: 30,
91
+ poller: Aws::Waiters::Poller.new(
92
+ operation_name: :get_replication_set,
93
+ acceptors: [
94
+ {
95
+ "matcher" => "path",
96
+ "argument" => "replication_set.status",
97
+ "state" => "success",
98
+ "expected" => "ACTIVE"
99
+ },
100
+ {
101
+ "matcher" => "path",
102
+ "argument" => "replication_set.status",
103
+ "state" => "retry",
104
+ "expected" => "CREATING"
105
+ },
106
+ {
107
+ "matcher" => "path",
108
+ "argument" => "replication_set.status",
109
+ "state" => "retry",
110
+ "expected" => "UPDATING"
111
+ },
112
+ {
113
+ "matcher" => "path",
114
+ "argument" => "replication_set.status",
115
+ "state" => "failure",
116
+ "expected" => "FAILED"
117
+ }
118
+ ]
119
+ )
120
+ }.merge(options))
121
+ end
122
+
123
+ # @option (see Client#get_replication_set)
124
+ # @return (see Client#get_replication_set)
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 for a replication set to be deleted
135
+ class WaitForReplicationSetDeleted
136
+
137
+ # @param [Hash] options
138
+ # @option options [required, Client] :client
139
+ # @option options [Integer] :max_attempts (5)
140
+ # @option options [Integer] :delay (30)
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: 5,
147
+ delay: 30,
148
+ poller: Aws::Waiters::Poller.new(
149
+ operation_name: :get_replication_set,
150
+ acceptors: [
151
+ {
152
+ "matcher" => "error",
153
+ "state" => "success",
154
+ "expected" => "ResourceNotFoundException"
155
+ },
156
+ {
157
+ "matcher" => "path",
158
+ "argument" => "replication_set.status",
159
+ "state" => "retry",
160
+ "expected" => "DELETING"
161
+ },
162
+ {
163
+ "matcher" => "path",
164
+ "argument" => "replication_set.status",
165
+ "state" => "failure",
166
+ "expected" => "FAILED"
167
+ }
168
+ ]
169
+ )
170
+ }.merge(options))
171
+ end
172
+
173
+ # @option (see Client#get_replication_set)
174
+ # @return (see Client#get_replication_set)
175
+ def wait(params = {})
176
+ @waiter.wait(client: @client, params: params)
177
+ end
178
+
179
+ # @api private
180
+ attr_reader :waiter
181
+
182
+ end
183
+ end
184
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-ssmincidents
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-05-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.112.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.112.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: aws-sigv4
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.1'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.1'
47
+ description: Official AWS Ruby gem for AWS Systems Manager Incident Manager (SSM Incidents).
48
+ This gem is part of the AWS SDK for Ruby.
49
+ email:
50
+ - aws-dr-rubygems@amazon.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - CHANGELOG.md
56
+ - LICENSE.txt
57
+ - VERSION
58
+ - lib/aws-sdk-ssmincidents.rb
59
+ - lib/aws-sdk-ssmincidents/client.rb
60
+ - lib/aws-sdk-ssmincidents/client_api.rb
61
+ - lib/aws-sdk-ssmincidents/customizations.rb
62
+ - lib/aws-sdk-ssmincidents/errors.rb
63
+ - lib/aws-sdk-ssmincidents/resource.rb
64
+ - lib/aws-sdk-ssmincidents/types.rb
65
+ - lib/aws-sdk-ssmincidents/waiters.rb
66
+ homepage: https://github.com/aws/aws-sdk-ruby
67
+ licenses:
68
+ - Apache-2.0
69
+ metadata:
70
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-ssmincidents
71
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-ssmincidents/CHANGELOG.md
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubygems_version: 3.1.6
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: AWS SDK for Ruby - SSM Incidents
91
+ test_files: []