aws-sdk-cloudcontrolapi 1.0.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,127 @@
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::CloudControlApi
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
+ # | resource_request_success | {Client#get_resource_request_status} | 5 | 720 |
73
+ #
74
+ module Waiters
75
+
76
+ # Wait until resource operation request is successful
77
+ class ResourceRequestSuccess
78
+
79
+ # @param [Hash] options
80
+ # @option options [required, Client] :client
81
+ # @option options [Integer] :max_attempts (720)
82
+ # @option options [Integer] :delay (5)
83
+ # @option options [Proc] :before_attempt
84
+ # @option options [Proc] :before_wait
85
+ def initialize(options)
86
+ @client = options.fetch(:client)
87
+ @waiter = Aws::Waiters::Waiter.new({
88
+ max_attempts: 720,
89
+ delay: 5,
90
+ poller: Aws::Waiters::Poller.new(
91
+ operation_name: :get_resource_request_status,
92
+ acceptors: [
93
+ {
94
+ "state" => "success",
95
+ "matcher" => "path",
96
+ "argument" => "progress_event.operation_status",
97
+ "expected" => "SUCCESS"
98
+ },
99
+ {
100
+ "state" => "failure",
101
+ "matcher" => "path",
102
+ "argument" => "progress_event.operation_status",
103
+ "expected" => "FAILED"
104
+ },
105
+ {
106
+ "state" => "failure",
107
+ "matcher" => "path",
108
+ "argument" => "progress_event.operation_status",
109
+ "expected" => "CANCEL_COMPLETE"
110
+ }
111
+ ]
112
+ )
113
+ }.merge(options))
114
+ end
115
+
116
+ # @option (see Client#get_resource_request_status)
117
+ # @return (see Client#get_resource_request_status)
118
+ def wait(params = {})
119
+ @waiter.wait(client: @client, params: params)
120
+ end
121
+
122
+ # @api private
123
+ attr_reader :waiter
124
+
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,54 @@
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
+
11
+ require 'aws-sdk-core'
12
+ require 'aws-sigv4'
13
+
14
+ require_relative 'aws-sdk-cloudcontrolapi/types'
15
+ require_relative 'aws-sdk-cloudcontrolapi/client_api'
16
+ require_relative 'aws-sdk-cloudcontrolapi/client'
17
+ require_relative 'aws-sdk-cloudcontrolapi/errors'
18
+ require_relative 'aws-sdk-cloudcontrolapi/waiters'
19
+ require_relative 'aws-sdk-cloudcontrolapi/resource'
20
+ require_relative 'aws-sdk-cloudcontrolapi/customizations'
21
+
22
+ # This module provides support for AWS Cloud Control API. This module is available in the
23
+ # `aws-sdk-cloudcontrolapi` gem.
24
+ #
25
+ # # Client
26
+ #
27
+ # The {Client} class provides one method for each API operation. Operation
28
+ # methods each accept a hash of request parameters and return a response
29
+ # structure.
30
+ #
31
+ # cloud_control_api = Aws::CloudControlApi::Client.new
32
+ # resp = cloud_control_api.cancel_resource_request(params)
33
+ #
34
+ # See {Client} for more information.
35
+ #
36
+ # # Errors
37
+ #
38
+ # Errors returned from AWS Cloud Control API are defined in the
39
+ # {Errors} module and all extend {Errors::ServiceError}.
40
+ #
41
+ # begin
42
+ # # do stuff
43
+ # rescue Aws::CloudControlApi::Errors::ServiceError
44
+ # # rescues all AWS Cloud Control API API errors
45
+ # end
46
+ #
47
+ # See {Errors} for more information.
48
+ #
49
+ # @!group service
50
+ module Aws::CloudControlApi
51
+
52
+ GEM_VERSION = '1.0.0'
53
+
54
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-cloudcontrolapi
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-09-30 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.120.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.120.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 Cloud Control API (CloudControlApi). This
48
+ 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-cloudcontrolapi.rb
59
+ - lib/aws-sdk-cloudcontrolapi/client.rb
60
+ - lib/aws-sdk-cloudcontrolapi/client_api.rb
61
+ - lib/aws-sdk-cloudcontrolapi/customizations.rb
62
+ - lib/aws-sdk-cloudcontrolapi/errors.rb
63
+ - lib/aws-sdk-cloudcontrolapi/resource.rb
64
+ - lib/aws-sdk-cloudcontrolapi/types.rb
65
+ - lib/aws-sdk-cloudcontrolapi/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-cloudcontrolapi
71
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-cloudcontrolapi/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: '2.3'
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 - CloudControlApi
91
+ test_files: []