aws-sdk-cloudwatch 1.33.0 → 1.38.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/aws-sdk-cloudwatch.rb +7 -4
- data/lib/aws-sdk-cloudwatch/alarm.rb +19 -14
- data/lib/aws-sdk-cloudwatch/client.rb +157 -33
- data/lib/aws-sdk-cloudwatch/client_api.rb +5 -3
- data/lib/aws-sdk-cloudwatch/composite_alarm.rb +19 -14
- data/lib/aws-sdk-cloudwatch/errors.rb +35 -13
- data/lib/aws-sdk-cloudwatch/metric.rb +15 -12
- data/lib/aws-sdk-cloudwatch/resource.rb +12 -0
- data/lib/aws-sdk-cloudwatch/types.rb +72 -11
- data/lib/aws-sdk-cloudwatch/waiters.rb +62 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d8eba7875acb25028fa366e64b02a2ba6726566e8904808b6d1ce2543e820a5c
|
4
|
+
data.tar.gz: 62386addd91c088a25ce9f5ed0d12e05f782e57a7eee987c2b1036477aa1e3fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b8c503f9e5ba75f28e9b480442c26c7b810accc9a99ee5cf55b97521971d878c97f2b1d92f48f8001c43218e7d6e046068d12fce4537a89b53b607c7ee49db6
|
7
|
+
data.tar.gz: 45a3c71136ff2257399f99b5e79fb1918a591523807508d44ca50ac9ae04f64676fec73a2e37bddecfad930b1f6451d76f683eb9cbf10049dab5223e044ccc70
|
data/lib/aws-sdk-cloudwatch.rb
CHANGED
@@ -28,17 +28,20 @@ require_relative 'aws-sdk-cloudwatch/customizations'
|
|
28
28
|
# methods each accept a hash of request parameters and return a response
|
29
29
|
# structure.
|
30
30
|
#
|
31
|
+
# cloud_watch = Aws::CloudWatch::Client.new
|
32
|
+
# resp = cloud_watch.delete_alarms(params)
|
33
|
+
#
|
31
34
|
# See {Client} for more information.
|
32
35
|
#
|
33
36
|
# # Errors
|
34
37
|
#
|
35
|
-
# Errors returned from Amazon CloudWatch
|
36
|
-
# extend {Errors::ServiceError}.
|
38
|
+
# Errors returned from Amazon CloudWatch are defined in the
|
39
|
+
# {Errors} module and all extend {Errors::ServiceError}.
|
37
40
|
#
|
38
41
|
# begin
|
39
42
|
# # do stuff
|
40
43
|
# rescue Aws::CloudWatch::Errors::ServiceError
|
41
|
-
# # rescues all
|
44
|
+
# # rescues all Amazon CloudWatch API errors
|
42
45
|
# end
|
43
46
|
#
|
44
47
|
# See {Errors} for more information.
|
@@ -46,6 +49,6 @@ require_relative 'aws-sdk-cloudwatch/customizations'
|
|
46
49
|
# @service
|
47
50
|
module Aws::CloudWatch
|
48
51
|
|
49
|
-
GEM_VERSION = '1.
|
52
|
+
GEM_VERSION = '1.38.0'
|
50
53
|
|
51
54
|
end
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::CloudWatch
|
9
|
+
|
9
10
|
class Alarm
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -282,7 +283,8 @@ module Aws::CloudWatch
|
|
282
283
|
# Waiter polls an API operation until a resource enters a desired
|
283
284
|
# state.
|
284
285
|
#
|
285
|
-
# @note The waiting operation is performed on a copy. The original resource
|
286
|
+
# @note The waiting operation is performed on a copy. The original resource
|
287
|
+
# remains unchanged.
|
286
288
|
#
|
287
289
|
# ## Basic Usage
|
288
290
|
#
|
@@ -295,13 +297,15 @@ module Aws::CloudWatch
|
|
295
297
|
#
|
296
298
|
# ## Example
|
297
299
|
#
|
298
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
300
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
301
|
+
# instance.state.name == 'running'
|
302
|
+
# end
|
299
303
|
#
|
300
304
|
# ## Configuration
|
301
305
|
#
|
302
306
|
# You can configure the maximum number of polling attempts, and the
|
303
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
304
|
-
# by passing a block to {#wait_until}:
|
307
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
308
|
+
# set by passing a block to {#wait_until}:
|
305
309
|
#
|
306
310
|
# # poll for ~25 seconds
|
307
311
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -332,17 +336,16 @@ module Aws::CloudWatch
|
|
332
336
|
# # resource did not enter the desired state in time
|
333
337
|
# end
|
334
338
|
#
|
339
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
335
340
|
#
|
336
|
-
# @
|
337
|
-
#
|
338
|
-
#
|
339
|
-
# because the waiter has entered a state that it will not transition
|
340
|
-
# out of, preventing success.
|
341
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
342
|
+
# terminates because the waiter has entered a state that it will not
|
343
|
+
# transition out of, preventing success.
|
341
344
|
#
|
342
345
|
# yet successful.
|
343
346
|
#
|
344
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
345
|
-
# while polling for a resource that is not expected.
|
347
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
348
|
+
# encountered while polling for a resource that is not expected.
|
346
349
|
#
|
347
350
|
# @raise [NotImplementedError] Raised when the resource does not
|
348
351
|
#
|
@@ -511,8 +514,8 @@ module Aws::CloudWatch
|
|
511
514
|
|
512
515
|
def yield_waiter_and_warn(waiter, &block)
|
513
516
|
if !@waiter_block_warned
|
514
|
-
msg = "pass options to configure the waiter; "
|
515
|
-
|
517
|
+
msg = "pass options to configure the waiter; "\
|
518
|
+
"yielding the waiter is deprecated"
|
516
519
|
warn(msg)
|
517
520
|
@waiter_block_warned = true
|
518
521
|
end
|
@@ -520,7 +523,9 @@ module Aws::CloudWatch
|
|
520
523
|
end
|
521
524
|
|
522
525
|
def separate_params_and_options(options)
|
523
|
-
opts = Set.new(
|
526
|
+
opts = Set.new(
|
527
|
+
[:client, :max_attempts, :delay, :before_attempt, :before_wait]
|
528
|
+
)
|
524
529
|
waiter_opts = {}
|
525
530
|
waiter_params = {}
|
526
531
|
options.each_pair do |key, value|
|
@@ -30,6 +30,18 @@ require 'aws-sdk-core/plugins/protocols/query.rb'
|
|
30
30
|
Aws::Plugins::GlobalConfiguration.add_identifier(:cloudwatch)
|
31
31
|
|
32
32
|
module Aws::CloudWatch
|
33
|
+
# An API client for CloudWatch. To construct a client, you need to configure a `:region` and `:credentials`.
|
34
|
+
#
|
35
|
+
# client = Aws::CloudWatch::Client.new(
|
36
|
+
# region: region_name,
|
37
|
+
# credentials: credentials,
|
38
|
+
# # ...
|
39
|
+
# )
|
40
|
+
#
|
41
|
+
# For details on configuring region and credentials see
|
42
|
+
# the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
|
43
|
+
#
|
44
|
+
# See {#initialize} for a full list of supported configuration options.
|
33
45
|
class Client < Seahorse::Client::Base
|
34
46
|
|
35
47
|
include Aws::ClientStubs
|
@@ -93,7 +105,7 @@ module Aws::CloudWatch
|
|
93
105
|
# @option options [required, String] :region
|
94
106
|
# The AWS region to connect to. The configured `:region` is
|
95
107
|
# used to determine the service `:endpoint`. When not passed,
|
96
|
-
# a default `:region` is
|
108
|
+
# a default `:region` is searched for in the following locations:
|
97
109
|
#
|
98
110
|
# * `Aws.config[:region]`
|
99
111
|
# * `ENV['AWS_REGION']`
|
@@ -108,6 +120,12 @@ module Aws::CloudWatch
|
|
108
120
|
# When set to `true`, a thread polling for endpoints will be running in
|
109
121
|
# the background every 60 secs (default). Defaults to `false`.
|
110
122
|
#
|
123
|
+
# @option options [Boolean] :adaptive_retry_wait_to_fill (true)
|
124
|
+
# Used only in `adaptive` retry mode. When true, the request will sleep
|
125
|
+
# until there is sufficent client side capacity to retry the request.
|
126
|
+
# When false, the request will raise a `RetryCapacityNotAvailableError` and will
|
127
|
+
# not retry instead of sleeping.
|
128
|
+
#
|
111
129
|
# @option options [Boolean] :client_side_monitoring (false)
|
112
130
|
# When `true`, client-side metrics will be collected for all API requests from
|
113
131
|
# this client.
|
@@ -132,6 +150,10 @@ module Aws::CloudWatch
|
|
132
150
|
# When `true`, an attempt is made to coerce request parameters into
|
133
151
|
# the required types.
|
134
152
|
#
|
153
|
+
# @option options [Boolean] :correct_clock_skew (true)
|
154
|
+
# Used only in `standard` and adaptive retry modes. Specifies whether to apply
|
155
|
+
# a clock skew correction and retry requests with skewed client clocks.
|
156
|
+
#
|
135
157
|
# @option options [Boolean] :disable_host_prefix_injection (false)
|
136
158
|
# Set to true to disable SDK automatically adding host prefix
|
137
159
|
# to default service endpoint when available.
|
@@ -139,7 +161,7 @@ module Aws::CloudWatch
|
|
139
161
|
# @option options [String] :endpoint
|
140
162
|
# The client endpoint is normally constructed from the `:region`
|
141
163
|
# option. You should only configure an `:endpoint` when connecting
|
142
|
-
# to test endpoints. This should be
|
164
|
+
# to test endpoints. This should be a valid HTTP(S) URI.
|
143
165
|
#
|
144
166
|
# @option options [Integer] :endpoint_cache_max_entries (1000)
|
145
167
|
# Used for the maximum size limit of the LRU cache storing endpoints data
|
@@ -154,7 +176,7 @@ module Aws::CloudWatch
|
|
154
176
|
# requests fetching endpoints information. Defaults to 60 sec.
|
155
177
|
#
|
156
178
|
# @option options [Boolean] :endpoint_discovery (false)
|
157
|
-
# When set to `true`, endpoint discovery will be enabled for operations when available.
|
179
|
+
# When set to `true`, endpoint discovery will be enabled for operations when available.
|
158
180
|
#
|
159
181
|
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
160
182
|
# The log formatter.
|
@@ -166,15 +188,29 @@ module Aws::CloudWatch
|
|
166
188
|
# The Logger instance to send log messages to. If this option
|
167
189
|
# is not set, logging will be disabled.
|
168
190
|
#
|
191
|
+
# @option options [Integer] :max_attempts (3)
|
192
|
+
# An integer representing the maximum number attempts that will be made for
|
193
|
+
# a single request, including the initial attempt. For example,
|
194
|
+
# setting this value to 5 will result in a request being retried up to
|
195
|
+
# 4 times. Used in `standard` and `adaptive` retry modes.
|
196
|
+
#
|
169
197
|
# @option options [String] :profile ("default")
|
170
198
|
# Used when loading credentials from the shared credentials file
|
171
199
|
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
172
200
|
#
|
201
|
+
# @option options [Proc] :retry_backoff
|
202
|
+
# A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
|
203
|
+
# This option is only used in the `legacy` retry mode.
|
204
|
+
#
|
173
205
|
# @option options [Float] :retry_base_delay (0.3)
|
174
|
-
# The base delay in seconds used by the default backoff function.
|
206
|
+
# The base delay in seconds used by the default backoff function. This option
|
207
|
+
# is only used in the `legacy` retry mode.
|
175
208
|
#
|
176
209
|
# @option options [Symbol] :retry_jitter (:none)
|
177
|
-
# A delay randomiser function used by the default backoff function.
|
210
|
+
# A delay randomiser function used by the default backoff function.
|
211
|
+
# Some predefined functions can be referenced by name - :none, :equal, :full,
|
212
|
+
# otherwise a Proc that takes and returns a number. This option is only used
|
213
|
+
# in the `legacy` retry mode.
|
178
214
|
#
|
179
215
|
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
180
216
|
#
|
@@ -182,11 +218,30 @@ module Aws::CloudWatch
|
|
182
218
|
# The maximum number of times to retry failed requests. Only
|
183
219
|
# ~ 500 level server errors and certain ~ 400 level client errors
|
184
220
|
# are retried. Generally, these are throttling errors, data
|
185
|
-
# checksum errors, networking errors, timeout errors
|
186
|
-
# errors from expired credentials.
|
221
|
+
# checksum errors, networking errors, timeout errors, auth errors,
|
222
|
+
# endpoint discovery, and errors from expired credentials.
|
223
|
+
# This option is only used in the `legacy` retry mode.
|
187
224
|
#
|
188
225
|
# @option options [Integer] :retry_max_delay (0)
|
189
|
-
# The maximum number of seconds to delay between retries (0 for no limit)
|
226
|
+
# The maximum number of seconds to delay between retries (0 for no limit)
|
227
|
+
# used by the default backoff function. This option is only used in the
|
228
|
+
# `legacy` retry mode.
|
229
|
+
#
|
230
|
+
# @option options [String] :retry_mode ("legacy")
|
231
|
+
# Specifies which retry algorithm to use. Values are:
|
232
|
+
#
|
233
|
+
# * `legacy` - The pre-existing retry behavior. This is default value if
|
234
|
+
# no retry mode is provided.
|
235
|
+
#
|
236
|
+
# * `standard` - A standardized set of retry rules across the AWS SDKs.
|
237
|
+
# This includes support for retry quotas, which limit the number of
|
238
|
+
# unsuccessful retries a client can make.
|
239
|
+
#
|
240
|
+
# * `adaptive` - An experimental retry mode that includes all the
|
241
|
+
# functionality of `standard` mode along with automatic client side
|
242
|
+
# throttling. This is a provisional mode that may change behavior
|
243
|
+
# in the future.
|
244
|
+
#
|
190
245
|
#
|
191
246
|
# @option options [String] :secret_access_key
|
192
247
|
#
|
@@ -209,16 +264,15 @@ module Aws::CloudWatch
|
|
209
264
|
# requests through. Formatted like 'http://proxy.com:123'.
|
210
265
|
#
|
211
266
|
# @option options [Float] :http_open_timeout (15) The number of
|
212
|
-
# seconds to wait when opening a HTTP session before
|
267
|
+
# seconds to wait when opening a HTTP session before raising a
|
213
268
|
# `Timeout::Error`.
|
214
269
|
#
|
215
270
|
# @option options [Integer] :http_read_timeout (60) The default
|
216
271
|
# number of seconds to wait for response data. This value can
|
217
|
-
# safely be set
|
218
|
-
# per-request on the session yeidled by {#session_for}.
|
272
|
+
# safely be set per-request on the session.
|
219
273
|
#
|
220
274
|
# @option options [Float] :http_idle_timeout (5) The number of
|
221
|
-
# seconds a connection is allowed to sit
|
275
|
+
# seconds a connection is allowed to sit idle before it is
|
222
276
|
# considered stale. Stale connections are closed and removed
|
223
277
|
# from the pool before making a request.
|
224
278
|
#
|
@@ -227,7 +281,7 @@ module Aws::CloudWatch
|
|
227
281
|
# request body. This option has no effect unless the request has
|
228
282
|
# "Expect" header set to "100-continue". Defaults to `nil` which
|
229
283
|
# disables this behaviour. This value can safely be set per
|
230
|
-
# request on the session
|
284
|
+
# request on the session.
|
231
285
|
#
|
232
286
|
# @option options [Boolean] :http_wire_trace (false) When `true`,
|
233
287
|
# HTTP debug output will be sent to the `:logger`.
|
@@ -328,7 +382,7 @@ module Aws::CloudWatch
|
|
328
382
|
# value: "DimensionValue", # required
|
329
383
|
# },
|
330
384
|
# ],
|
331
|
-
# stat: "
|
385
|
+
# stat: "AnomalyDetectorMetricStat", # required
|
332
386
|
# })
|
333
387
|
#
|
334
388
|
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAnomalyDetector AWS API Documentation
|
@@ -448,6 +502,8 @@ module Aws::CloudWatch
|
|
448
502
|
# * {Types::DescribeAlarmHistoryOutput#alarm_history_items #alarm_history_items} => Array<Types::AlarmHistoryItem>
|
449
503
|
# * {Types::DescribeAlarmHistoryOutput#next_token #next_token} => String
|
450
504
|
#
|
505
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
506
|
+
#
|
451
507
|
# @example Request syntax with placeholder values
|
452
508
|
#
|
453
509
|
# resp = client.describe_alarm_history({
|
@@ -563,6 +619,8 @@ module Aws::CloudWatch
|
|
563
619
|
# * {Types::DescribeAlarmsOutput#metric_alarms #metric_alarms} => Array<Types::MetricAlarm>
|
564
620
|
# * {Types::DescribeAlarmsOutput#next_token #next_token} => String
|
565
621
|
#
|
622
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
623
|
+
#
|
566
624
|
# @example Request syntax with placeholder values
|
567
625
|
#
|
568
626
|
# resp = client.describe_alarms({
|
@@ -644,6 +702,12 @@ module Aws::CloudWatch
|
|
644
702
|
# resp.metric_alarms[0].threshold_metric_id #=> String
|
645
703
|
# resp.next_token #=> String
|
646
704
|
#
|
705
|
+
#
|
706
|
+
# The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
|
707
|
+
#
|
708
|
+
# * alarm_exists
|
709
|
+
# * composite_alarm_exists
|
710
|
+
#
|
647
711
|
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms AWS API Documentation
|
648
712
|
#
|
649
713
|
# @overload describe_alarms(params = {})
|
@@ -859,6 +923,8 @@ module Aws::CloudWatch
|
|
859
923
|
# * {Types::DescribeInsightRulesOutput#next_token #next_token} => String
|
860
924
|
# * {Types::DescribeInsightRulesOutput#insight_rules #insight_rules} => Array<Types::InsightRule>
|
861
925
|
#
|
926
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
927
|
+
#
|
862
928
|
# @example Request syntax with placeholder values
|
863
929
|
#
|
864
930
|
# resp = client.describe_insight_rules({
|
@@ -1311,6 +1377,8 @@ module Aws::CloudWatch
|
|
1311
1377
|
# * {Types::GetMetricDataOutput#next_token #next_token} => String
|
1312
1378
|
# * {Types::GetMetricDataOutput#messages #messages} => Array<Types::MessageData>
|
1313
1379
|
#
|
1380
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
1381
|
+
#
|
1314
1382
|
# @example Request syntax with placeholder values
|
1315
1383
|
#
|
1316
1384
|
# resp = client.get_metric_data({
|
@@ -1702,6 +1770,8 @@ module Aws::CloudWatch
|
|
1702
1770
|
# * {Types::ListDashboardsOutput#dashboard_entries #dashboard_entries} => Array<Types::DashboardEntry>
|
1703
1771
|
# * {Types::ListDashboardsOutput#next_token #next_token} => String
|
1704
1772
|
#
|
1773
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
1774
|
+
#
|
1705
1775
|
# @example Request syntax with placeholder values
|
1706
1776
|
#
|
1707
1777
|
# resp = client.list_dashboards({
|
@@ -1761,6 +1831,8 @@ module Aws::CloudWatch
|
|
1761
1831
|
# * {Types::ListMetricsOutput#metrics #metrics} => Array<Types::Metric>
|
1762
1832
|
# * {Types::ListMetricsOutput#next_token #next_token} => String
|
1763
1833
|
#
|
1834
|
+
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
|
1835
|
+
#
|
1764
1836
|
# @example Request syntax with placeholder values
|
1765
1837
|
#
|
1766
1838
|
# resp = client.list_metrics({
|
@@ -1794,17 +1866,24 @@ module Aws::CloudWatch
|
|
1794
1866
|
req.send_request(options)
|
1795
1867
|
end
|
1796
1868
|
|
1797
|
-
# Displays the tags associated with a CloudWatch resource.
|
1798
|
-
# support tagging.
|
1869
|
+
# Displays the tags associated with a CloudWatch resource. Currently,
|
1870
|
+
# alarms and Contributor Insights rules support tagging.
|
1799
1871
|
#
|
1800
1872
|
# @option params [required, String] :resource_arn
|
1801
|
-
# The ARN of the CloudWatch resource that you want to view tags for.
|
1802
|
-
# more information on ARN format, see [Example ARNs][1] in the *Amazon
|
1803
|
-
# Web Services General Reference*.
|
1873
|
+
# The ARN of the CloudWatch resource that you want to view tags for.
|
1804
1874
|
#
|
1875
|
+
# The ARN format of an alarm is
|
1876
|
+
# `arn:aws:cloudwatch:Region:account-id:alarm:alarm-name `
|
1805
1877
|
#
|
1878
|
+
# The ARN format of a Contributor Insights rule is
|
1879
|
+
# `arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name `
|
1806
1880
|
#
|
1807
|
-
# [
|
1881
|
+
# For more information on ARN format, see [ Resource Types Defined by
|
1882
|
+
# Amazon CloudWatch][1] in the *Amazon Web Services General Reference*.
|
1883
|
+
#
|
1884
|
+
#
|
1885
|
+
#
|
1886
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies
|
1808
1887
|
#
|
1809
1888
|
# @return [Types::ListTagsForResourceOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
1810
1889
|
#
|
@@ -1876,7 +1955,7 @@ module Aws::CloudWatch
|
|
1876
1955
|
# value: "DimensionValue", # required
|
1877
1956
|
# },
|
1878
1957
|
# ],
|
1879
|
-
# stat: "
|
1958
|
+
# stat: "AnomalyDetectorMetricStat", # required
|
1880
1959
|
# configuration: {
|
1881
1960
|
# excluded_time_ranges: [
|
1882
1961
|
# {
|
@@ -2163,6 +2242,26 @@ module Aws::CloudWatch
|
|
2163
2242
|
#
|
2164
2243
|
# [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html
|
2165
2244
|
#
|
2245
|
+
# @option params [Array<Types::Tag>] :tags
|
2246
|
+
# A list of key-value pairs to associate with the Contributor Insights
|
2247
|
+
# rule. You can associate as many as 50 tags with a rule.
|
2248
|
+
#
|
2249
|
+
# Tags can help you organize and categorize your resources. You can also
|
2250
|
+
# use them to scope user permissions, by granting a user permission to
|
2251
|
+
# access or change only the resources that have certain tag values.
|
2252
|
+
#
|
2253
|
+
# To be able to associate tags with a rule, you must have the
|
2254
|
+
# `cloudwatch:TagResource` permission in addition to the
|
2255
|
+
# `cloudwatch:PutInsightRule` permission.
|
2256
|
+
#
|
2257
|
+
# If you are using this operation to update an existing Contributor
|
2258
|
+
# Insights rule, any tags you specify in this parameter are ignored. To
|
2259
|
+
# change the tags of an existing rule, use [TagResource][1].
|
2260
|
+
#
|
2261
|
+
#
|
2262
|
+
#
|
2263
|
+
# [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html
|
2264
|
+
#
|
2166
2265
|
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
2167
2266
|
#
|
2168
2267
|
# @example Request syntax with placeholder values
|
@@ -2171,6 +2270,12 @@ module Aws::CloudWatch
|
|
2171
2270
|
# rule_name: "InsightRuleName", # required
|
2172
2271
|
# rule_state: "InsightRuleState",
|
2173
2272
|
# rule_definition: "InsightRuleDefinition", # required
|
2273
|
+
# tags: [
|
2274
|
+
# {
|
2275
|
+
# key: "TagKey", # required
|
2276
|
+
# value: "TagValue", # required
|
2277
|
+
# },
|
2278
|
+
# ],
|
2174
2279
|
# })
|
2175
2280
|
#
|
2176
2281
|
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutInsightRule AWS API Documentation
|
@@ -2729,7 +2834,7 @@ module Aws::CloudWatch
|
|
2729
2834
|
|
2730
2835
|
# Assigns one or more tags (key-value pairs) to the specified CloudWatch
|
2731
2836
|
# resource. Currently, the only CloudWatch resources that can be tagged
|
2732
|
-
# are alarms.
|
2837
|
+
# are alarms and Contributor Insights rules.
|
2733
2838
|
#
|
2734
2839
|
# Tags can help you organize and categorize your resources. You can also
|
2735
2840
|
# use them to scope user permissions, by granting a user permission to
|
@@ -2744,11 +2849,23 @@ module Aws::CloudWatch
|
|
2744
2849
|
# key that is already associated with the alarm, the new tag value that
|
2745
2850
|
# you specify replaces the previous value for that tag.
|
2746
2851
|
#
|
2747
|
-
# You can associate as many as 50 tags with a resource.
|
2852
|
+
# You can associate as many as 50 tags with a CloudWatch resource.
|
2748
2853
|
#
|
2749
2854
|
# @option params [required, String] :resource_arn
|
2750
|
-
# The ARN of the CloudWatch
|
2751
|
-
#
|
2855
|
+
# The ARN of the CloudWatch resource that you're adding tags to.
|
2856
|
+
#
|
2857
|
+
# The ARN format of an alarm is
|
2858
|
+
# `arn:aws:cloudwatch:Region:account-id:alarm:alarm-name `
|
2859
|
+
#
|
2860
|
+
# The ARN format of a Contributor Insights rule is
|
2861
|
+
# `arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name `
|
2862
|
+
#
|
2863
|
+
# For more information on ARN format, see [ Resource Types Defined by
|
2864
|
+
# Amazon CloudWatch][1] in the *Amazon Web Services General Reference*.
|
2865
|
+
#
|
2866
|
+
#
|
2867
|
+
#
|
2868
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies
|
2752
2869
|
#
|
2753
2870
|
# @option params [required, Array<Types::Tag>] :tags
|
2754
2871
|
# The list of key-value pairs to associate with the alarm.
|
@@ -2780,12 +2897,19 @@ module Aws::CloudWatch
|
|
2780
2897
|
#
|
2781
2898
|
# @option params [required, String] :resource_arn
|
2782
2899
|
# The ARN of the CloudWatch resource that you're removing tags from.
|
2783
|
-
#
|
2784
|
-
#
|
2900
|
+
#
|
2901
|
+
# The ARN format of an alarm is
|
2902
|
+
# `arn:aws:cloudwatch:Region:account-id:alarm:alarm-name `
|
2903
|
+
#
|
2904
|
+
# The ARN format of a Contributor Insights rule is
|
2905
|
+
# `arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name `
|
2906
|
+
#
|
2907
|
+
# For more information on ARN format, see [ Resource Types Defined by
|
2908
|
+
# Amazon CloudWatch][1] in the *Amazon Web Services General Reference*.
|
2785
2909
|
#
|
2786
2910
|
#
|
2787
2911
|
#
|
2788
|
-
# [1]: https://docs.aws.amazon.com/
|
2912
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies
|
2789
2913
|
#
|
2790
2914
|
# @option params [required, Array<String>] :tag_keys
|
2791
2915
|
# The list of tag keys to remove from the resource.
|
@@ -2821,7 +2945,7 @@ module Aws::CloudWatch
|
|
2821
2945
|
params: params,
|
2822
2946
|
config: config)
|
2823
2947
|
context[:gem_name] = 'aws-sdk-cloudwatch'
|
2824
|
-
context[:gem_version] = '1.
|
2948
|
+
context[:gem_version] = '1.38.0'
|
2825
2949
|
Seahorse::Client::Request.new(handlers, context)
|
2826
2950
|
end
|
2827
2951
|
|
@@ -2887,10 +3011,10 @@ module Aws::CloudWatch
|
|
2887
3011
|
# The following table lists the valid waiter names, the operations they call,
|
2888
3012
|
# and the default `:delay` and `:max_attempts` values.
|
2889
3013
|
#
|
2890
|
-
# | waiter_name | params
|
2891
|
-
# | ---------------------- |
|
2892
|
-
# | alarm_exists | {#describe_alarms} | 5 | 40 |
|
2893
|
-
# | composite_alarm_exists | {#describe_alarms} | 5 | 40 |
|
3014
|
+
# | waiter_name | params | :delay | :max_attempts |
|
3015
|
+
# | ---------------------- | ------------------------ | -------- | ------------- |
|
3016
|
+
# | alarm_exists | {Client#describe_alarms} | 5 | 40 |
|
3017
|
+
# | composite_alarm_exists | {Client#describe_alarms} | 5 | 40 |
|
2894
3018
|
#
|
2895
3019
|
# @raise [Errors::FailureStateError] Raised when the waiter terminates
|
2896
3020
|
# because the waiter has entered a state that it will not transition
|
@@ -27,6 +27,7 @@ module Aws::CloudWatch
|
|
27
27
|
AnomalyDetector = Shapes::StructureShape.new(name: 'AnomalyDetector')
|
28
28
|
AnomalyDetectorConfiguration = Shapes::StructureShape.new(name: 'AnomalyDetectorConfiguration')
|
29
29
|
AnomalyDetectorExcludedTimeRanges = Shapes::ListShape.new(name: 'AnomalyDetectorExcludedTimeRanges')
|
30
|
+
AnomalyDetectorMetricStat = Shapes::StringShape.new(name: 'AnomalyDetectorMetricStat')
|
30
31
|
AnomalyDetectorMetricTimezone = Shapes::StringShape.new(name: 'AnomalyDetectorMetricTimezone')
|
31
32
|
AnomalyDetectorStateValue = Shapes::StringShape.new(name: 'AnomalyDetectorStateValue')
|
32
33
|
AnomalyDetectors = Shapes::ListShape.new(name: 'AnomalyDetectors')
|
@@ -240,7 +241,7 @@ module Aws::CloudWatch
|
|
240
241
|
AnomalyDetector.add_member(:namespace, Shapes::ShapeRef.new(shape: Namespace, location_name: "Namespace"))
|
241
242
|
AnomalyDetector.add_member(:metric_name, Shapes::ShapeRef.new(shape: MetricName, location_name: "MetricName"))
|
242
243
|
AnomalyDetector.add_member(:dimensions, Shapes::ShapeRef.new(shape: Dimensions, location_name: "Dimensions"))
|
243
|
-
AnomalyDetector.add_member(:stat, Shapes::ShapeRef.new(shape:
|
244
|
+
AnomalyDetector.add_member(:stat, Shapes::ShapeRef.new(shape: AnomalyDetectorMetricStat, location_name: "Stat"))
|
244
245
|
AnomalyDetector.add_member(:configuration, Shapes::ShapeRef.new(shape: AnomalyDetectorConfiguration, location_name: "Configuration"))
|
245
246
|
AnomalyDetector.add_member(:state_value, Shapes::ShapeRef.new(shape: AnomalyDetectorStateValue, location_name: "StateValue"))
|
246
247
|
AnomalyDetector.struct_class = Types::AnomalyDetector
|
@@ -322,7 +323,7 @@ module Aws::CloudWatch
|
|
322
323
|
DeleteAnomalyDetectorInput.add_member(:namespace, Shapes::ShapeRef.new(shape: Namespace, required: true, location_name: "Namespace"))
|
323
324
|
DeleteAnomalyDetectorInput.add_member(:metric_name, Shapes::ShapeRef.new(shape: MetricName, required: true, location_name: "MetricName"))
|
324
325
|
DeleteAnomalyDetectorInput.add_member(:dimensions, Shapes::ShapeRef.new(shape: Dimensions, location_name: "Dimensions"))
|
325
|
-
DeleteAnomalyDetectorInput.add_member(:stat, Shapes::ShapeRef.new(shape:
|
326
|
+
DeleteAnomalyDetectorInput.add_member(:stat, Shapes::ShapeRef.new(shape: AnomalyDetectorMetricStat, required: true, location_name: "Stat"))
|
326
327
|
DeleteAnomalyDetectorInput.struct_class = Types::DeleteAnomalyDetectorInput
|
327
328
|
|
328
329
|
DeleteAnomalyDetectorOutput.struct_class = Types::DeleteAnomalyDetectorOutput
|
@@ -671,7 +672,7 @@ module Aws::CloudWatch
|
|
671
672
|
PutAnomalyDetectorInput.add_member(:namespace, Shapes::ShapeRef.new(shape: Namespace, required: true, location_name: "Namespace"))
|
672
673
|
PutAnomalyDetectorInput.add_member(:metric_name, Shapes::ShapeRef.new(shape: MetricName, required: true, location_name: "MetricName"))
|
673
674
|
PutAnomalyDetectorInput.add_member(:dimensions, Shapes::ShapeRef.new(shape: Dimensions, location_name: "Dimensions"))
|
674
|
-
PutAnomalyDetectorInput.add_member(:stat, Shapes::ShapeRef.new(shape:
|
675
|
+
PutAnomalyDetectorInput.add_member(:stat, Shapes::ShapeRef.new(shape: AnomalyDetectorMetricStat, required: true, location_name: "Stat"))
|
675
676
|
PutAnomalyDetectorInput.add_member(:configuration, Shapes::ShapeRef.new(shape: AnomalyDetectorConfiguration, location_name: "Configuration"))
|
676
677
|
PutAnomalyDetectorInput.struct_class = Types::PutAnomalyDetectorInput
|
677
678
|
|
@@ -697,6 +698,7 @@ module Aws::CloudWatch
|
|
697
698
|
PutInsightRuleInput.add_member(:rule_name, Shapes::ShapeRef.new(shape: InsightRuleName, required: true, location_name: "RuleName"))
|
698
699
|
PutInsightRuleInput.add_member(:rule_state, Shapes::ShapeRef.new(shape: InsightRuleState, location_name: "RuleState"))
|
699
700
|
PutInsightRuleInput.add_member(:rule_definition, Shapes::ShapeRef.new(shape: InsightRuleDefinition, required: true, location_name: "RuleDefinition"))
|
701
|
+
PutInsightRuleInput.add_member(:tags, Shapes::ShapeRef.new(shape: TagList, location_name: "Tags"))
|
700
702
|
PutInsightRuleInput.struct_class = Types::PutInsightRuleInput
|
701
703
|
|
702
704
|
PutInsightRuleOutput.struct_class = Types::PutInsightRuleOutput
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::CloudWatch
|
9
|
+
|
9
10
|
class CompositeAlarm
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -182,7 +183,8 @@ module Aws::CloudWatch
|
|
182
183
|
# Waiter polls an API operation until a resource enters a desired
|
183
184
|
# state.
|
184
185
|
#
|
185
|
-
# @note The waiting operation is performed on a copy. The original resource
|
186
|
+
# @note The waiting operation is performed on a copy. The original resource
|
187
|
+
# remains unchanged.
|
186
188
|
#
|
187
189
|
# ## Basic Usage
|
188
190
|
#
|
@@ -195,13 +197,15 @@ module Aws::CloudWatch
|
|
195
197
|
#
|
196
198
|
# ## Example
|
197
199
|
#
|
198
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
200
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
201
|
+
# instance.state.name == 'running'
|
202
|
+
# end
|
199
203
|
#
|
200
204
|
# ## Configuration
|
201
205
|
#
|
202
206
|
# You can configure the maximum number of polling attempts, and the
|
203
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
204
|
-
# by passing a block to {#wait_until}:
|
207
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
208
|
+
# set by passing a block to {#wait_until}:
|
205
209
|
#
|
206
210
|
# # poll for ~25 seconds
|
207
211
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -232,17 +236,16 @@ module Aws::CloudWatch
|
|
232
236
|
# # resource did not enter the desired state in time
|
233
237
|
# end
|
234
238
|
#
|
239
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
235
240
|
#
|
236
|
-
# @
|
237
|
-
#
|
238
|
-
#
|
239
|
-
# because the waiter has entered a state that it will not transition
|
240
|
-
# out of, preventing success.
|
241
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
242
|
+
# terminates because the waiter has entered a state that it will not
|
243
|
+
# transition out of, preventing success.
|
241
244
|
#
|
242
245
|
# yet successful.
|
243
246
|
#
|
244
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
245
|
-
# while polling for a resource that is not expected.
|
247
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
248
|
+
# encountered while polling for a resource that is not expected.
|
246
249
|
#
|
247
250
|
# @raise [NotImplementedError] Raised when the resource does not
|
248
251
|
#
|
@@ -396,8 +399,8 @@ module Aws::CloudWatch
|
|
396
399
|
|
397
400
|
def yield_waiter_and_warn(waiter, &block)
|
398
401
|
if !@waiter_block_warned
|
399
|
-
msg = "pass options to configure the waiter; "
|
400
|
-
|
402
|
+
msg = "pass options to configure the waiter; "\
|
403
|
+
"yielding the waiter is deprecated"
|
401
404
|
warn(msg)
|
402
405
|
@waiter_block_warned = true
|
403
406
|
end
|
@@ -405,7 +408,9 @@ module Aws::CloudWatch
|
|
405
408
|
end
|
406
409
|
|
407
410
|
def separate_params_and_options(options)
|
408
|
-
opts = Set.new(
|
411
|
+
opts = Set.new(
|
412
|
+
[:client, :max_attempts, :delay, :before_attempt, :before_wait]
|
413
|
+
)
|
409
414
|
waiter_opts = {}
|
410
415
|
waiter_params = {}
|
411
416
|
options.each_pair do |key, value|
|
@@ -6,6 +6,41 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::CloudWatch
|
9
|
+
|
10
|
+
# When CloudWatch returns an error response, the Ruby SDK constructs and raises an error.
|
11
|
+
# These errors all extend Aws::CloudWatch::Errors::ServiceError < {Aws::Errors::ServiceError}
|
12
|
+
#
|
13
|
+
# You can rescue all CloudWatch errors using ServiceError:
|
14
|
+
#
|
15
|
+
# begin
|
16
|
+
# # do stuff
|
17
|
+
# rescue Aws::CloudWatch::Errors::ServiceError
|
18
|
+
# # rescues all CloudWatch API errors
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
#
|
22
|
+
# ## Request Context
|
23
|
+
# ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
|
24
|
+
# information about the request that generated the error.
|
25
|
+
# See {Seahorse::Client::RequestContext} for more information.
|
26
|
+
#
|
27
|
+
# ## Error Classes
|
28
|
+
# * {ConcurrentModificationException}
|
29
|
+
# * {DashboardInvalidInputError}
|
30
|
+
# * {DashboardNotFoundError}
|
31
|
+
# * {InternalServiceFault}
|
32
|
+
# * {InvalidFormatFault}
|
33
|
+
# * {InvalidNextToken}
|
34
|
+
# * {InvalidParameterCombinationException}
|
35
|
+
# * {InvalidParameterValueException}
|
36
|
+
# * {LimitExceededException}
|
37
|
+
# * {LimitExceededFault}
|
38
|
+
# * {MissingRequiredParameterException}
|
39
|
+
# * {ResourceNotFound}
|
40
|
+
# * {ResourceNotFoundException}
|
41
|
+
#
|
42
|
+
# Additionally, error classes are dynamically generated for service errors based on the error code
|
43
|
+
# if they are not defined above.
|
9
44
|
module Errors
|
10
45
|
|
11
46
|
extend Aws::Errors::DynamicErrors
|
@@ -18,7 +53,6 @@ module Aws::CloudWatch
|
|
18
53
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
19
54
|
super(context, message, data)
|
20
55
|
end
|
21
|
-
|
22
56
|
end
|
23
57
|
|
24
58
|
class DashboardInvalidInputError < ServiceError
|
@@ -39,7 +73,6 @@ module Aws::CloudWatch
|
|
39
73
|
def dashboard_validation_messages
|
40
74
|
@data[:dashboard_validation_messages]
|
41
75
|
end
|
42
|
-
|
43
76
|
end
|
44
77
|
|
45
78
|
class DashboardNotFoundError < ServiceError
|
@@ -55,7 +88,6 @@ module Aws::CloudWatch
|
|
55
88
|
def message
|
56
89
|
@message || @data[:message]
|
57
90
|
end
|
58
|
-
|
59
91
|
end
|
60
92
|
|
61
93
|
class InternalServiceFault < ServiceError
|
@@ -71,7 +103,6 @@ module Aws::CloudWatch
|
|
71
103
|
def message
|
72
104
|
@message || @data[:message]
|
73
105
|
end
|
74
|
-
|
75
106
|
end
|
76
107
|
|
77
108
|
class InvalidFormatFault < ServiceError
|
@@ -87,7 +118,6 @@ module Aws::CloudWatch
|
|
87
118
|
def message
|
88
119
|
@message || @data[:message]
|
89
120
|
end
|
90
|
-
|
91
121
|
end
|
92
122
|
|
93
123
|
class InvalidNextToken < ServiceError
|
@@ -103,7 +133,6 @@ module Aws::CloudWatch
|
|
103
133
|
def message
|
104
134
|
@message || @data[:message]
|
105
135
|
end
|
106
|
-
|
107
136
|
end
|
108
137
|
|
109
138
|
class InvalidParameterCombinationException < ServiceError
|
@@ -119,7 +148,6 @@ module Aws::CloudWatch
|
|
119
148
|
def message
|
120
149
|
@message || @data[:message]
|
121
150
|
end
|
122
|
-
|
123
151
|
end
|
124
152
|
|
125
153
|
class InvalidParameterValueException < ServiceError
|
@@ -135,7 +163,6 @@ module Aws::CloudWatch
|
|
135
163
|
def message
|
136
164
|
@message || @data[:message]
|
137
165
|
end
|
138
|
-
|
139
166
|
end
|
140
167
|
|
141
168
|
class LimitExceededException < ServiceError
|
@@ -146,7 +173,6 @@ module Aws::CloudWatch
|
|
146
173
|
def initialize(context, message, data = Aws::EmptyStructure.new)
|
147
174
|
super(context, message, data)
|
148
175
|
end
|
149
|
-
|
150
176
|
end
|
151
177
|
|
152
178
|
class LimitExceededFault < ServiceError
|
@@ -162,7 +188,6 @@ module Aws::CloudWatch
|
|
162
188
|
def message
|
163
189
|
@message || @data[:message]
|
164
190
|
end
|
165
|
-
|
166
191
|
end
|
167
192
|
|
168
193
|
class MissingRequiredParameterException < ServiceError
|
@@ -178,7 +203,6 @@ module Aws::CloudWatch
|
|
178
203
|
def message
|
179
204
|
@message || @data[:message]
|
180
205
|
end
|
181
|
-
|
182
206
|
end
|
183
207
|
|
184
208
|
class ResourceNotFound < ServiceError
|
@@ -194,7 +218,6 @@ module Aws::CloudWatch
|
|
194
218
|
def message
|
195
219
|
@message || @data[:message]
|
196
220
|
end
|
197
|
-
|
198
221
|
end
|
199
222
|
|
200
223
|
class ResourceNotFoundException < ServiceError
|
@@ -215,7 +238,6 @@ module Aws::CloudWatch
|
|
215
238
|
def resource_id
|
216
239
|
@data[:resource_id]
|
217
240
|
end
|
218
|
-
|
219
241
|
end
|
220
242
|
|
221
243
|
end
|
@@ -6,6 +6,7 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::CloudWatch
|
9
|
+
|
9
10
|
class Metric
|
10
11
|
|
11
12
|
extend Aws::Deprecations
|
@@ -89,7 +90,8 @@ module Aws::CloudWatch
|
|
89
90
|
# Waiter polls an API operation until a resource enters a desired
|
90
91
|
# state.
|
91
92
|
#
|
92
|
-
# @note The waiting operation is performed on a copy. The original resource
|
93
|
+
# @note The waiting operation is performed on a copy. The original resource
|
94
|
+
# remains unchanged.
|
93
95
|
#
|
94
96
|
# ## Basic Usage
|
95
97
|
#
|
@@ -102,13 +104,15 @@ module Aws::CloudWatch
|
|
102
104
|
#
|
103
105
|
# ## Example
|
104
106
|
#
|
105
|
-
# instance.wait_until(max_attempts:10, delay:5)
|
107
|
+
# instance.wait_until(max_attempts:10, delay:5) do |instance|
|
108
|
+
# instance.state.name == 'running'
|
109
|
+
# end
|
106
110
|
#
|
107
111
|
# ## Configuration
|
108
112
|
#
|
109
113
|
# You can configure the maximum number of polling attempts, and the
|
110
|
-
# delay (in seconds) between each polling attempt. The waiting condition is
|
111
|
-
# by passing a block to {#wait_until}:
|
114
|
+
# delay (in seconds) between each polling attempt. The waiting condition is
|
115
|
+
# set by passing a block to {#wait_until}:
|
112
116
|
#
|
113
117
|
# # poll for ~25 seconds
|
114
118
|
# resource.wait_until(max_attempts:5,delay:5) {|resource|...}
|
@@ -139,17 +143,16 @@ module Aws::CloudWatch
|
|
139
143
|
# # resource did not enter the desired state in time
|
140
144
|
# end
|
141
145
|
#
|
146
|
+
# @yieldparam [Resource] resource to be used in the waiting condition.
|
142
147
|
#
|
143
|
-
# @
|
144
|
-
#
|
145
|
-
#
|
146
|
-
# because the waiter has entered a state that it will not transition
|
147
|
-
# out of, preventing success.
|
148
|
+
# @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
|
149
|
+
# terminates because the waiter has entered a state that it will not
|
150
|
+
# transition out of, preventing success.
|
148
151
|
#
|
149
152
|
# yet successful.
|
150
153
|
#
|
151
|
-
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
152
|
-
# while polling for a resource that is not expected.
|
154
|
+
# @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
|
155
|
+
# encountered while polling for a resource that is not expected.
|
153
156
|
#
|
154
157
|
# @raise [NotImplementedError] Raised when the resource does not
|
155
158
|
#
|
@@ -583,7 +586,7 @@ module Aws::CloudWatch
|
|
583
586
|
namespace: @namespace,
|
584
587
|
metric_name: @name
|
585
588
|
)
|
586
|
-
|
589
|
+
@client.put_metric_alarm(options)
|
587
590
|
Alarm.new(
|
588
591
|
name: options[:alarm_name],
|
589
592
|
client: @client
|
@@ -6,6 +6,18 @@
|
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
8
|
module Aws::CloudWatch
|
9
|
+
|
10
|
+
# This class provides a resource oriented interface for CloudWatch.
|
11
|
+
# To create a resource object:
|
12
|
+
#
|
13
|
+
# resource = Aws::CloudWatch::Resource.new(region: 'us-west-2')
|
14
|
+
#
|
15
|
+
# You can supply a client object with custom configuration that will be used for all resource operations.
|
16
|
+
# If you do not pass `:client`, a default client will be constructed.
|
17
|
+
#
|
18
|
+
# client = Aws::CloudWatch::Client.new(region: 'us-west-2')
|
19
|
+
# resource = Aws::CloudWatch::Resource.new(client: client)
|
20
|
+
#
|
9
21
|
class Resource
|
10
22
|
|
11
23
|
# @param options ({})
|
@@ -378,7 +378,7 @@ module Aws::CloudWatch
|
|
378
378
|
# value: "DimensionValue", # required
|
379
379
|
# },
|
380
380
|
# ],
|
381
|
-
# stat: "
|
381
|
+
# stat: "AnomalyDetectorMetricStat", # required
|
382
382
|
# }
|
383
383
|
#
|
384
384
|
# @!attribute [rw] namespace
|
@@ -1995,12 +1995,21 @@ module Aws::CloudWatch
|
|
1995
1995
|
#
|
1996
1996
|
# @!attribute [rw] resource_arn
|
1997
1997
|
# The ARN of the CloudWatch resource that you want to view tags for.
|
1998
|
-
#
|
1999
|
-
#
|
1998
|
+
#
|
1999
|
+
# The ARN format of an alarm is
|
2000
|
+
# `arn:aws:cloudwatch:Region:account-id:alarm:alarm-name `
|
2001
|
+
#
|
2002
|
+
# The ARN format of a Contributor Insights rule is
|
2003
|
+
# `arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name
|
2004
|
+
# `
|
2005
|
+
#
|
2006
|
+
# For more information on ARN format, see [ Resource Types Defined by
|
2007
|
+
# Amazon CloudWatch][1] in the *Amazon Web Services General
|
2008
|
+
# Reference*.
|
2000
2009
|
#
|
2001
2010
|
#
|
2002
2011
|
#
|
2003
|
-
# [1]: https://docs.aws.amazon.com/
|
2012
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies
|
2004
2013
|
# @return [String]
|
2005
2014
|
#
|
2006
2015
|
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/ListTagsForResourceInput AWS API Documentation
|
@@ -2689,7 +2698,7 @@ module Aws::CloudWatch
|
|
2689
2698
|
# value: "DimensionValue", # required
|
2690
2699
|
# },
|
2691
2700
|
# ],
|
2692
|
-
# stat: "
|
2701
|
+
# stat: "AnomalyDetectorMetricStat", # required
|
2693
2702
|
# configuration: {
|
2694
2703
|
# excluded_time_ranges: [
|
2695
2704
|
# {
|
@@ -2948,6 +2957,12 @@ module Aws::CloudWatch
|
|
2948
2957
|
# rule_name: "InsightRuleName", # required
|
2949
2958
|
# rule_state: "InsightRuleState",
|
2950
2959
|
# rule_definition: "InsightRuleDefinition", # required
|
2960
|
+
# tags: [
|
2961
|
+
# {
|
2962
|
+
# key: "TagKey", # required
|
2963
|
+
# value: "TagValue", # required
|
2964
|
+
# },
|
2965
|
+
# ],
|
2951
2966
|
# }
|
2952
2967
|
#
|
2953
2968
|
# @!attribute [rw] rule_name
|
@@ -2967,12 +2982,35 @@ module Aws::CloudWatch
|
|
2967
2982
|
# [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html
|
2968
2983
|
# @return [String]
|
2969
2984
|
#
|
2985
|
+
# @!attribute [rw] tags
|
2986
|
+
# A list of key-value pairs to associate with the Contributor Insights
|
2987
|
+
# rule. You can associate as many as 50 tags with a rule.
|
2988
|
+
#
|
2989
|
+
# Tags can help you organize and categorize your resources. You can
|
2990
|
+
# also use them to scope user permissions, by granting a user
|
2991
|
+
# permission to access or change only the resources that have certain
|
2992
|
+
# tag values.
|
2993
|
+
#
|
2994
|
+
# To be able to associate tags with a rule, you must have the
|
2995
|
+
# `cloudwatch:TagResource` permission in addition to the
|
2996
|
+
# `cloudwatch:PutInsightRule` permission.
|
2997
|
+
#
|
2998
|
+
# If you are using this operation to update an existing Contributor
|
2999
|
+
# Insights rule, any tags you specify in this parameter are ignored.
|
3000
|
+
# To change the tags of an existing rule, use [TagResource][1].
|
3001
|
+
#
|
3002
|
+
#
|
3003
|
+
#
|
3004
|
+
# [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html
|
3005
|
+
# @return [Array<Types::Tag>]
|
3006
|
+
#
|
2970
3007
|
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutInsightRuleInput AWS API Documentation
|
2971
3008
|
#
|
2972
3009
|
class PutInsightRuleInput < Struct.new(
|
2973
3010
|
:rule_name,
|
2974
3011
|
:rule_state,
|
2975
|
-
:rule_definition
|
3012
|
+
:rule_definition,
|
3013
|
+
:tags)
|
2976
3014
|
include Aws::Structure
|
2977
3015
|
end
|
2978
3016
|
|
@@ -3578,8 +3616,22 @@ module Aws::CloudWatch
|
|
3578
3616
|
# }
|
3579
3617
|
#
|
3580
3618
|
# @!attribute [rw] resource_arn
|
3581
|
-
# The ARN of the CloudWatch
|
3582
|
-
#
|
3619
|
+
# The ARN of the CloudWatch resource that you're adding tags to.
|
3620
|
+
#
|
3621
|
+
# The ARN format of an alarm is
|
3622
|
+
# `arn:aws:cloudwatch:Region:account-id:alarm:alarm-name `
|
3623
|
+
#
|
3624
|
+
# The ARN format of a Contributor Insights rule is
|
3625
|
+
# `arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name
|
3626
|
+
# `
|
3627
|
+
#
|
3628
|
+
# For more information on ARN format, see [ Resource Types Defined by
|
3629
|
+
# Amazon CloudWatch][1] in the *Amazon Web Services General
|
3630
|
+
# Reference*.
|
3631
|
+
#
|
3632
|
+
#
|
3633
|
+
#
|
3634
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies
|
3583
3635
|
# @return [String]
|
3584
3636
|
#
|
3585
3637
|
# @!attribute [rw] tags
|
@@ -3608,12 +3660,21 @@ module Aws::CloudWatch
|
|
3608
3660
|
#
|
3609
3661
|
# @!attribute [rw] resource_arn
|
3610
3662
|
# The ARN of the CloudWatch resource that you're removing tags from.
|
3611
|
-
#
|
3612
|
-
#
|
3663
|
+
#
|
3664
|
+
# The ARN format of an alarm is
|
3665
|
+
# `arn:aws:cloudwatch:Region:account-id:alarm:alarm-name `
|
3666
|
+
#
|
3667
|
+
# The ARN format of a Contributor Insights rule is
|
3668
|
+
# `arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name
|
3669
|
+
# `
|
3670
|
+
#
|
3671
|
+
# For more information on ARN format, see [ Resource Types Defined by
|
3672
|
+
# Amazon CloudWatch][1] in the *Amazon Web Services General
|
3673
|
+
# Reference*.
|
3613
3674
|
#
|
3614
3675
|
#
|
3615
3676
|
#
|
3616
|
-
# [1]: https://docs.aws.amazon.com/
|
3677
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatch.html#amazoncloudwatch-resources-for-iam-policies
|
3617
3678
|
# @return [String]
|
3618
3679
|
#
|
3619
3680
|
# @!attribute [rw] tag_keys
|
@@ -8,6 +8,68 @@
|
|
8
8
|
require 'aws-sdk-core/waiters'
|
9
9
|
|
10
10
|
module Aws::CloudWatch
|
11
|
+
# Waiters are utility methods that poll for a particular state to occur
|
12
|
+
# on a client. Waiters can fail after a number of attempts at a polling
|
13
|
+
# interval defined for the service client.
|
14
|
+
#
|
15
|
+
# For a list of operations that can be waited for and the
|
16
|
+
# client methods called for each operation, see the table below or the
|
17
|
+
# {Client#wait_until} field documentation for the {Client}.
|
18
|
+
#
|
19
|
+
# # Invoking a Waiter
|
20
|
+
# To invoke a waiter, call #wait_until on a {Client}. The first parameter
|
21
|
+
# is the waiter name, which is specific to the service client and indicates
|
22
|
+
# which operation is being waited for. The second parameter is a hash of
|
23
|
+
# parameters that are passed to the client method called by the waiter,
|
24
|
+
# which varies according to the waiter name.
|
25
|
+
#
|
26
|
+
# # Wait Failures
|
27
|
+
# To catch errors in a waiter, use WaiterFailed,
|
28
|
+
# as shown in the following example.
|
29
|
+
#
|
30
|
+
# rescue rescue Aws::Waiters::Errors::WaiterFailed => error
|
31
|
+
# puts "failed waiting for instance running: #{error.message}
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# # Configuring a Waiter
|
35
|
+
# Each waiter has a default polling interval and a maximum number of
|
36
|
+
# attempts it will make before returning control to your program.
|
37
|
+
# To set these values, use the `max_attempts` and `delay` parameters
|
38
|
+
# in your `#wait_until` call.
|
39
|
+
# The following example waits for up to 25 seconds, polling every five seconds.
|
40
|
+
#
|
41
|
+
# client.wait_until(...) do |w|
|
42
|
+
# w.max_attempts = 5
|
43
|
+
# w.delay = 5
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# To disable wait failures, set the value of either of these parameters
|
47
|
+
# to `nil`.
|
48
|
+
#
|
49
|
+
# # Extending a Waiter
|
50
|
+
# To modify the behavior of waiters, you can register callbacks that are
|
51
|
+
# triggered before each polling attempt and before waiting.
|
52
|
+
#
|
53
|
+
# The following example implements an exponential backoff in a waiter
|
54
|
+
# by doubling the amount of time to wait on every attempt.
|
55
|
+
#
|
56
|
+
# client.wait_until(...) do |w|
|
57
|
+
# w.interval = 0 # disable normal sleep
|
58
|
+
# w.before_wait do |n, resp|
|
59
|
+
# sleep(n ** 2)
|
60
|
+
# end
|
61
|
+
# end
|
62
|
+
#
|
63
|
+
# # Available Waiters
|
64
|
+
#
|
65
|
+
# The following table lists the valid waiter names, the operations they call,
|
66
|
+
# and the default `:delay` and `:max_attempts` values.
|
67
|
+
#
|
68
|
+
# | waiter_name | params | :delay | :max_attempts |
|
69
|
+
# | ---------------------- | ------------------------ | -------- | ------------- |
|
70
|
+
# | alarm_exists | {Client#describe_alarms} | 5 | 40 |
|
71
|
+
# | composite_alarm_exists | {Client#describe_alarms} | 5 | 40 |
|
72
|
+
#
|
11
73
|
module Waiters
|
12
74
|
|
13
75
|
class AlarmExists
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-cloudwatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.38.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: 2020-
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.7.6.2
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: AWS SDK for Ruby - CloudWatch
|