aws-sdk-cloudwatch 0.0.6 → 1.0.0.rc1
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.
- checksums.yaml +7 -0
- data/lib/aws-sdk-cloudwatch.rb +50 -0
- data/lib/aws-sdk-cloudwatch/alarm.rb +451 -0
- data/lib/aws-sdk-cloudwatch/client.rb +986 -0
- data/lib/aws-sdk-cloudwatch/client_api.rb +421 -0
- data/lib/aws-sdk-cloudwatch/customizations.rb +7 -0
- data/lib/aws-sdk-cloudwatch/errors.rb +23 -0
- data/lib/aws-sdk-cloudwatch/metric.rb +424 -0
- data/lib/aws-sdk-cloudwatch/resource.rb +123 -0
- data/lib/aws-sdk-cloudwatch/types.rb +1024 -0
- data/lib/aws-sdk-cloudwatch/waiters.rb +50 -0
- metadata +35 -106
- data/.gitignore +0 -4
- data/CHANGELOG +0 -6
- data/Gemfile +0 -18
- data/LICENSE.txt +0 -202
- data/NOTICE.txt +0 -2
- data/README.rdoc +0 -41
- data/Rakefile +0 -23
- data/aws-sdk-cloudwatch.gemspec +0 -36
- data/lib/aws/api_config/CloudWatch-2010-08-01.yml +0 -359
- data/lib/aws/cloud_watch.rb +0 -31
- data/lib/aws/cloud_watch/client.rb +0 -57
- data/lib/aws/cloud_watch/config.rb +0 -19
- data/lib/aws/cloud_watch/ec2.rb +0 -58
- data/lib/aws/cloud_watch/errors.rb +0 -23
- data/lib/aws/cloud_watch/metric.rb +0 -97
- data/lib/aws/cloud_watch/metric_base.rb +0 -100
- data/lib/aws/cloud_watch/metric_collection.rb +0 -48
- data/lib/aws/cloud_watch/request.rb +0 -30
- data/lib/aws/core/option_grammar/double.rb +0 -29
- data/licence.rb +0 -14
- data/spec/cloud_watch_client_spec.rb +0 -27
- data/spec/cloud_watch_ec2_spec.rb +0 -70
- data/spec/metric_base_spec.rb +0 -50
- data/spec/metric_collection_spec.rb +0 -46
- data/spec/metric_spec.rb +0 -159
@@ -0,0 +1,986 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
require 'seahorse/client/plugins/content_length.rb'
|
9
|
+
require 'aws-sdk-core/plugins/credentials_configuration.rb'
|
10
|
+
require 'aws-sdk-core/plugins/logging.rb'
|
11
|
+
require 'aws-sdk-core/plugins/param_converter.rb'
|
12
|
+
require 'aws-sdk-core/plugins/param_validator.rb'
|
13
|
+
require 'aws-sdk-core/plugins/user_agent.rb'
|
14
|
+
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
|
15
|
+
require 'aws-sdk-core/plugins/retry_errors.rb'
|
16
|
+
require 'aws-sdk-core/plugins/global_configuration.rb'
|
17
|
+
require 'aws-sdk-core/plugins/regional_endpoint.rb'
|
18
|
+
require 'aws-sdk-core/plugins/response_paging.rb'
|
19
|
+
require 'aws-sdk-core/plugins/stub_responses.rb'
|
20
|
+
require 'aws-sdk-core/plugins/idempotency_token.rb'
|
21
|
+
require 'aws-sdk-core/plugins/signature_v4.rb'
|
22
|
+
require 'aws-sdk-core/plugins/protocols/query.rb'
|
23
|
+
|
24
|
+
Aws::Plugins::GlobalConfiguration.add_identifier(:cloudwatch)
|
25
|
+
|
26
|
+
module Aws
|
27
|
+
module CloudWatch
|
28
|
+
class Client < Seahorse::Client::Base
|
29
|
+
|
30
|
+
include Aws::ClientStubs
|
31
|
+
|
32
|
+
@identifier = :cloudwatch
|
33
|
+
|
34
|
+
set_api(ClientApi::API)
|
35
|
+
|
36
|
+
add_plugin(Seahorse::Client::Plugins::ContentLength)
|
37
|
+
add_plugin(Aws::Plugins::CredentialsConfiguration)
|
38
|
+
add_plugin(Aws::Plugins::Logging)
|
39
|
+
add_plugin(Aws::Plugins::ParamConverter)
|
40
|
+
add_plugin(Aws::Plugins::ParamValidator)
|
41
|
+
add_plugin(Aws::Plugins::UserAgent)
|
42
|
+
add_plugin(Aws::Plugins::HelpfulSocketErrors)
|
43
|
+
add_plugin(Aws::Plugins::RetryErrors)
|
44
|
+
add_plugin(Aws::Plugins::GlobalConfiguration)
|
45
|
+
add_plugin(Aws::Plugins::RegionalEndpoint)
|
46
|
+
add_plugin(Aws::Plugins::ResponsePaging)
|
47
|
+
add_plugin(Aws::Plugins::StubResponses)
|
48
|
+
add_plugin(Aws::Plugins::IdempotencyToken)
|
49
|
+
add_plugin(Aws::Plugins::SignatureV4)
|
50
|
+
add_plugin(Aws::Plugins::Protocols::Query)
|
51
|
+
|
52
|
+
# @option options [required, Aws::CredentialProvider] :credentials
|
53
|
+
# Your AWS credentials. This can be an instance of any one of the
|
54
|
+
# following classes:
|
55
|
+
#
|
56
|
+
# * `Aws::Credentials` - Used for configuring static, non-refreshing
|
57
|
+
# credentials.
|
58
|
+
#
|
59
|
+
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
|
60
|
+
# from an EC2 IMDS on an EC2 instance.
|
61
|
+
#
|
62
|
+
# * `Aws::SharedCredentials` - Used for loading credentials from a
|
63
|
+
# shared file, such as `~/.aws/config`.
|
64
|
+
#
|
65
|
+
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
|
66
|
+
#
|
67
|
+
# When `:credentials` are not configured directly, the following
|
68
|
+
# locations will be searched for credentials:
|
69
|
+
#
|
70
|
+
# * `Aws.config[:credentials]`
|
71
|
+
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
72
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
73
|
+
# * `~/.aws/credentials`
|
74
|
+
# * `~/.aws/config`
|
75
|
+
# * EC2 IMDS instance profile - When used by default, the timeouts are
|
76
|
+
# very aggressive. Construct and pass an instance of
|
77
|
+
# `Aws::InstanceProfileCredentails` to enable retries and extended
|
78
|
+
# timeouts.
|
79
|
+
# @option options [required, String] :region
|
80
|
+
# The AWS region to connect to. The configured `:region` is
|
81
|
+
# used to determine the service `:endpoint`. When not passed,
|
82
|
+
# a default `:region` is search for in the following locations:
|
83
|
+
#
|
84
|
+
# * `Aws.config[:region]`
|
85
|
+
# * `ENV['AWS_REGION']`
|
86
|
+
# * `ENV['AMAZON_REGION']`
|
87
|
+
# * `ENV['AWS_DEFAULT_REGION']`
|
88
|
+
# * `~/.aws/credentials`
|
89
|
+
# * `~/.aws/config`
|
90
|
+
# @option options [String] :access_key_id
|
91
|
+
# @option options [Boolean] :convert_params (true)
|
92
|
+
# When `true`, an attempt is made to coerce request parameters into
|
93
|
+
# the required types.
|
94
|
+
# @option options [String] :endpoint
|
95
|
+
# The client endpoint is normally constructed from the `:region`
|
96
|
+
# option. You should only configure an `:endpoint` when connecting
|
97
|
+
# to test endpoints. This should be avalid HTTP(S) URI.
|
98
|
+
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
99
|
+
# The log formatter.
|
100
|
+
# @option options [Symbol] :log_level (:info)
|
101
|
+
# The log level to send messages to the `:logger` at.
|
102
|
+
# @option options [Logger] :logger
|
103
|
+
# The Logger instance to send log messages to. If this option
|
104
|
+
# is not set, logging will be disabled.
|
105
|
+
# @option options [String] :profile ("default")
|
106
|
+
# Used when loading credentials from the shared credentials file
|
107
|
+
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
108
|
+
# @option options [Integer] :retry_limit (3)
|
109
|
+
# The maximum number of times to retry failed requests. Only
|
110
|
+
# ~ 500 level server errors and certain ~ 400 level client errors
|
111
|
+
# are retried. Generally, these are throttling errors, data
|
112
|
+
# checksum errors, networking errors, timeout errors and auth
|
113
|
+
# errors from expired credentials.
|
114
|
+
# @option options [String] :secret_access_key
|
115
|
+
# @option options [String] :session_token
|
116
|
+
# @option options [Boolean] :stub_responses (false)
|
117
|
+
# Causes the client to return stubbed responses. By default
|
118
|
+
# fake responses are generated and returned. You can specify
|
119
|
+
# the response data to return or errors to raise by calling
|
120
|
+
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
121
|
+
#
|
122
|
+
# ** Please note ** When response stubbing is enabled, no HTTP
|
123
|
+
# requests are made, and retries are disabled.
|
124
|
+
# @option options [Boolean] :validate_params (true)
|
125
|
+
# When `true`, request parameters are validated before
|
126
|
+
# sending the request.
|
127
|
+
def initialize(*args)
|
128
|
+
super
|
129
|
+
end
|
130
|
+
|
131
|
+
# @!group API Operations
|
132
|
+
|
133
|
+
# Deletes the specified alarms. In the event of an error, no alarms are
|
134
|
+
# deleted.
|
135
|
+
# @option params [required, Array<String>] :alarm_names
|
136
|
+
# The alarms to be deleted.
|
137
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
138
|
+
#
|
139
|
+
# @example Request syntax with placeholder values
|
140
|
+
# resp = client.delete_alarms({
|
141
|
+
# alarm_names: ["AlarmName"], # required
|
142
|
+
# })
|
143
|
+
# @overload delete_alarms(params = {})
|
144
|
+
# @param [Hash] params ({})
|
145
|
+
def delete_alarms(params = {}, options = {})
|
146
|
+
req = build_request(:delete_alarms, params)
|
147
|
+
req.send_request(options)
|
148
|
+
end
|
149
|
+
|
150
|
+
# Retrieves the history for the specified alarm. You can filter the
|
151
|
+
# results by date range or item type. If an alarm name is not specified,
|
152
|
+
# the histories for all alarms are returned.
|
153
|
+
#
|
154
|
+
# Note that Amazon CloudWatch retains the history of an alarm even if
|
155
|
+
# you delete the alarm.
|
156
|
+
# @option params [String] :alarm_name
|
157
|
+
# The name of the alarm.
|
158
|
+
# @option params [String] :history_item_type
|
159
|
+
# The type of alarm histories to retrieve.
|
160
|
+
# @option params [Time,DateTime,Date,Integer,String] :start_date
|
161
|
+
# The starting date to retrieve alarm history.
|
162
|
+
# @option params [Time,DateTime,Date,Integer,String] :end_date
|
163
|
+
# The ending date to retrieve alarm history.
|
164
|
+
# @option params [Integer] :max_records
|
165
|
+
# The maximum number of alarm history records to retrieve.
|
166
|
+
# @option params [String] :next_token
|
167
|
+
# The token returned by a previous call to indicate that there is more
|
168
|
+
# data available.
|
169
|
+
# @return [Types::DescribeAlarmHistoryOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
170
|
+
#
|
171
|
+
# * {Types::DescribeAlarmHistoryOutput#alarm_history_items #AlarmHistoryItems} => Array<Types::AlarmHistoryItem>
|
172
|
+
# * {Types::DescribeAlarmHistoryOutput#next_token #NextToken} => String
|
173
|
+
#
|
174
|
+
# @example Request syntax with placeholder values
|
175
|
+
# resp = client.describe_alarm_history({
|
176
|
+
# alarm_name: "AlarmName",
|
177
|
+
# history_item_type: "ConfigurationUpdate", # accepts ConfigurationUpdate, StateUpdate, Action
|
178
|
+
# start_date: Time.now,
|
179
|
+
# end_date: Time.now,
|
180
|
+
# max_records: 1,
|
181
|
+
# next_token: "NextToken",
|
182
|
+
# })
|
183
|
+
#
|
184
|
+
# @example Response structure
|
185
|
+
# resp.alarm_history_items #=> Array
|
186
|
+
# resp.alarm_history_items[0].alarm_name #=> String
|
187
|
+
# resp.alarm_history_items[0].timestamp #=> Time
|
188
|
+
# resp.alarm_history_items[0].history_item_type #=> String, one of "ConfigurationUpdate", "StateUpdate", "Action"
|
189
|
+
# resp.alarm_history_items[0].history_summary #=> String
|
190
|
+
# resp.alarm_history_items[0].history_data #=> String
|
191
|
+
# resp.next_token #=> String
|
192
|
+
# @overload describe_alarm_history(params = {})
|
193
|
+
# @param [Hash] params ({})
|
194
|
+
def describe_alarm_history(params = {}, options = {})
|
195
|
+
req = build_request(:describe_alarm_history, params)
|
196
|
+
req.send_request(options)
|
197
|
+
end
|
198
|
+
|
199
|
+
# Retrieves the specified alarms. If no alarms are specified, all alarms
|
200
|
+
# are returned. Alarms can be retrieved by using only a prefix for the
|
201
|
+
# alarm name, the alarm state, or a prefix for any action.
|
202
|
+
# @option params [Array<String>] :alarm_names
|
203
|
+
# The names of the alarms.
|
204
|
+
# @option params [String] :alarm_name_prefix
|
205
|
+
# The alarm name prefix. You cannot specify `AlarmNames` if this
|
206
|
+
# parameter is specified.
|
207
|
+
# @option params [String] :state_value
|
208
|
+
# The state value to be used in matching alarms.
|
209
|
+
# @option params [String] :action_prefix
|
210
|
+
# The action name prefix.
|
211
|
+
# @option params [Integer] :max_records
|
212
|
+
# The maximum number of alarm descriptions to retrieve.
|
213
|
+
# @option params [String] :next_token
|
214
|
+
# The token returned by a previous call to indicate that there is more
|
215
|
+
# data available.
|
216
|
+
# @return [Types::DescribeAlarmsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
217
|
+
#
|
218
|
+
# * {Types::DescribeAlarmsOutput#metric_alarms #MetricAlarms} => Array<Types::MetricAlarm>
|
219
|
+
# * {Types::DescribeAlarmsOutput#next_token #NextToken} => String
|
220
|
+
#
|
221
|
+
# @example Request syntax with placeholder values
|
222
|
+
# resp = client.describe_alarms({
|
223
|
+
# alarm_names: ["AlarmName"],
|
224
|
+
# alarm_name_prefix: "AlarmNamePrefix",
|
225
|
+
# state_value: "OK", # accepts OK, ALARM, INSUFFICIENT_DATA
|
226
|
+
# action_prefix: "ActionPrefix",
|
227
|
+
# max_records: 1,
|
228
|
+
# next_token: "NextToken",
|
229
|
+
# })
|
230
|
+
#
|
231
|
+
# @example Response structure
|
232
|
+
# resp.metric_alarms #=> Array
|
233
|
+
# resp.metric_alarms[0].alarm_name #=> String
|
234
|
+
# resp.metric_alarms[0].alarm_arn #=> String
|
235
|
+
# resp.metric_alarms[0].alarm_description #=> String
|
236
|
+
# resp.metric_alarms[0].alarm_configuration_updated_timestamp #=> Time
|
237
|
+
# resp.metric_alarms[0].actions_enabled #=> Boolean
|
238
|
+
# resp.metric_alarms[0].ok_actions #=> Array
|
239
|
+
# resp.metric_alarms[0].ok_actions[0] #=> String
|
240
|
+
# resp.metric_alarms[0].alarm_actions #=> Array
|
241
|
+
# resp.metric_alarms[0].alarm_actions[0] #=> String
|
242
|
+
# resp.metric_alarms[0].insufficient_data_actions #=> Array
|
243
|
+
# resp.metric_alarms[0].insufficient_data_actions[0] #=> String
|
244
|
+
# resp.metric_alarms[0].state_value #=> String, one of "OK", "ALARM", "INSUFFICIENT_DATA"
|
245
|
+
# resp.metric_alarms[0].state_reason #=> String
|
246
|
+
# resp.metric_alarms[0].state_reason_data #=> String
|
247
|
+
# resp.metric_alarms[0].state_updated_timestamp #=> Time
|
248
|
+
# resp.metric_alarms[0].metric_name #=> String
|
249
|
+
# resp.metric_alarms[0].namespace #=> String
|
250
|
+
# resp.metric_alarms[0].statistic #=> String, one of "SampleCount", "Average", "Sum", "Minimum", "Maximum"
|
251
|
+
# resp.metric_alarms[0].extended_statistic #=> String
|
252
|
+
# resp.metric_alarms[0].dimensions #=> Array
|
253
|
+
# resp.metric_alarms[0].dimensions[0].name #=> String
|
254
|
+
# resp.metric_alarms[0].dimensions[0].value #=> String
|
255
|
+
# resp.metric_alarms[0].period #=> Integer
|
256
|
+
# resp.metric_alarms[0].unit #=> String, one of "Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None"
|
257
|
+
# resp.metric_alarms[0].evaluation_periods #=> Integer
|
258
|
+
# resp.metric_alarms[0].threshold #=> Float
|
259
|
+
# resp.metric_alarms[0].comparison_operator #=> String, one of "GreaterThanOrEqualToThreshold", "GreaterThanThreshold", "LessThanThreshold", "LessThanOrEqualToThreshold"
|
260
|
+
# resp.next_token #=> String
|
261
|
+
# @overload describe_alarms(params = {})
|
262
|
+
# @param [Hash] params ({})
|
263
|
+
def describe_alarms(params = {}, options = {})
|
264
|
+
req = build_request(:describe_alarms, params)
|
265
|
+
req.send_request(options)
|
266
|
+
end
|
267
|
+
|
268
|
+
# Retrieves the alarms for the specified metric. Specify a statistic,
|
269
|
+
# period, or unit to filter the results.
|
270
|
+
# @option params [required, String] :metric_name
|
271
|
+
# The name of the metric.
|
272
|
+
# @option params [required, String] :namespace
|
273
|
+
# The namespace of the metric.
|
274
|
+
# @option params [String] :statistic
|
275
|
+
# The statistic for the metric, other than percentiles. For percentile
|
276
|
+
# statistics, use `ExtendedStatistics`.
|
277
|
+
# @option params [String] :extended_statistic
|
278
|
+
# The percentile statistic for the metric. Specify a value between p0.0
|
279
|
+
# and p100.
|
280
|
+
# @option params [Array<Types::Dimension>] :dimensions
|
281
|
+
# The dimensions associated with the metric. If the metric has any
|
282
|
+
# associated dimensions, you must specify them in order for the call to
|
283
|
+
# succeed.
|
284
|
+
# @option params [Integer] :period
|
285
|
+
# The period, in seconds, over which the statistic is applied.
|
286
|
+
# @option params [String] :unit
|
287
|
+
# The unit for the metric.
|
288
|
+
# @return [Types::DescribeAlarmsForMetricOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
289
|
+
#
|
290
|
+
# * {Types::DescribeAlarmsForMetricOutput#metric_alarms #MetricAlarms} => Array<Types::MetricAlarm>
|
291
|
+
#
|
292
|
+
# @example Request syntax with placeholder values
|
293
|
+
# resp = client.describe_alarms_for_metric({
|
294
|
+
# metric_name: "MetricName", # required
|
295
|
+
# namespace: "Namespace", # required
|
296
|
+
# statistic: "SampleCount", # accepts SampleCount, Average, Sum, Minimum, Maximum
|
297
|
+
# extended_statistic: "ExtendedStatistic",
|
298
|
+
# dimensions: [
|
299
|
+
# {
|
300
|
+
# name: "DimensionName", # required
|
301
|
+
# value: "DimensionValue", # required
|
302
|
+
# },
|
303
|
+
# ],
|
304
|
+
# period: 1,
|
305
|
+
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
|
306
|
+
# })
|
307
|
+
#
|
308
|
+
# @example Response structure
|
309
|
+
# resp.metric_alarms #=> Array
|
310
|
+
# resp.metric_alarms[0].alarm_name #=> String
|
311
|
+
# resp.metric_alarms[0].alarm_arn #=> String
|
312
|
+
# resp.metric_alarms[0].alarm_description #=> String
|
313
|
+
# resp.metric_alarms[0].alarm_configuration_updated_timestamp #=> Time
|
314
|
+
# resp.metric_alarms[0].actions_enabled #=> Boolean
|
315
|
+
# resp.metric_alarms[0].ok_actions #=> Array
|
316
|
+
# resp.metric_alarms[0].ok_actions[0] #=> String
|
317
|
+
# resp.metric_alarms[0].alarm_actions #=> Array
|
318
|
+
# resp.metric_alarms[0].alarm_actions[0] #=> String
|
319
|
+
# resp.metric_alarms[0].insufficient_data_actions #=> Array
|
320
|
+
# resp.metric_alarms[0].insufficient_data_actions[0] #=> String
|
321
|
+
# resp.metric_alarms[0].state_value #=> String, one of "OK", "ALARM", "INSUFFICIENT_DATA"
|
322
|
+
# resp.metric_alarms[0].state_reason #=> String
|
323
|
+
# resp.metric_alarms[0].state_reason_data #=> String
|
324
|
+
# resp.metric_alarms[0].state_updated_timestamp #=> Time
|
325
|
+
# resp.metric_alarms[0].metric_name #=> String
|
326
|
+
# resp.metric_alarms[0].namespace #=> String
|
327
|
+
# resp.metric_alarms[0].statistic #=> String, one of "SampleCount", "Average", "Sum", "Minimum", "Maximum"
|
328
|
+
# resp.metric_alarms[0].extended_statistic #=> String
|
329
|
+
# resp.metric_alarms[0].dimensions #=> Array
|
330
|
+
# resp.metric_alarms[0].dimensions[0].name #=> String
|
331
|
+
# resp.metric_alarms[0].dimensions[0].value #=> String
|
332
|
+
# resp.metric_alarms[0].period #=> Integer
|
333
|
+
# resp.metric_alarms[0].unit #=> String, one of "Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None"
|
334
|
+
# resp.metric_alarms[0].evaluation_periods #=> Integer
|
335
|
+
# resp.metric_alarms[0].threshold #=> Float
|
336
|
+
# resp.metric_alarms[0].comparison_operator #=> String, one of "GreaterThanOrEqualToThreshold", "GreaterThanThreshold", "LessThanThreshold", "LessThanOrEqualToThreshold"
|
337
|
+
# @overload describe_alarms_for_metric(params = {})
|
338
|
+
# @param [Hash] params ({})
|
339
|
+
def describe_alarms_for_metric(params = {}, options = {})
|
340
|
+
req = build_request(:describe_alarms_for_metric, params)
|
341
|
+
req.send_request(options)
|
342
|
+
end
|
343
|
+
|
344
|
+
# Disables the actions for the specified alarms. When an alarm's
|
345
|
+
# actions are disabled, the alarm actions do not execute when the alarm
|
346
|
+
# state changes.
|
347
|
+
# @option params [required, Array<String>] :alarm_names
|
348
|
+
# The names of the alarms.
|
349
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
350
|
+
#
|
351
|
+
# @example Request syntax with placeholder values
|
352
|
+
# resp = client.disable_alarm_actions({
|
353
|
+
# alarm_names: ["AlarmName"], # required
|
354
|
+
# })
|
355
|
+
# @overload disable_alarm_actions(params = {})
|
356
|
+
# @param [Hash] params ({})
|
357
|
+
def disable_alarm_actions(params = {}, options = {})
|
358
|
+
req = build_request(:disable_alarm_actions, params)
|
359
|
+
req.send_request(options)
|
360
|
+
end
|
361
|
+
|
362
|
+
# Enables the actions for the specified alarms.
|
363
|
+
# @option params [required, Array<String>] :alarm_names
|
364
|
+
# The names of the alarms.
|
365
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
366
|
+
#
|
367
|
+
# @example Request syntax with placeholder values
|
368
|
+
# resp = client.enable_alarm_actions({
|
369
|
+
# alarm_names: ["AlarmName"], # required
|
370
|
+
# })
|
371
|
+
# @overload enable_alarm_actions(params = {})
|
372
|
+
# @param [Hash] params ({})
|
373
|
+
def enable_alarm_actions(params = {}, options = {})
|
374
|
+
req = build_request(:enable_alarm_actions, params)
|
375
|
+
req.send_request(options)
|
376
|
+
end
|
377
|
+
|
378
|
+
# Gets statistics for the specified metric.
|
379
|
+
#
|
380
|
+
# Amazon CloudWatch retains metric data as follows:
|
381
|
+
#
|
382
|
+
# * Data points with a period of 60 seconds (1 minute) are available for
|
383
|
+
# 15 days
|
384
|
+
#
|
385
|
+
# * Data points with a period of 300 seconds (5 minute) are available
|
386
|
+
# for 63 days
|
387
|
+
#
|
388
|
+
# * Data points with a period of 3600 seconds (1 hour) are available for
|
389
|
+
# 455 days (15 months)
|
390
|
+
#
|
391
|
+
# Note that CloudWatch started retaining 5-minute and 1-hour metric data
|
392
|
+
# as of 9 July 2016.
|
393
|
+
#
|
394
|
+
# The maximum number of data points returned from a single call is
|
395
|
+
# 1,440. If you request more than 1,440 data points, Amazon CloudWatch
|
396
|
+
# returns an error. To reduce the number of data points, you can narrow
|
397
|
+
# the specified time range and make multiple requests across adjacent
|
398
|
+
# time ranges, or you can increase the specified period. A period can be
|
399
|
+
# as short as one minute (60 seconds). Note that data points are not
|
400
|
+
# returned in chronological order.
|
401
|
+
#
|
402
|
+
# Amazon CloudWatch aggregates data points based on the length of the
|
403
|
+
# period that you specify. For example, if you request statistics with a
|
404
|
+
# one-hour period, Amazon CloudWatch aggregates all data points with
|
405
|
+
# time stamps that fall within each one-hour period. Therefore, the
|
406
|
+
# number of values aggregated by CloudWatch is larger than the number of
|
407
|
+
# data points returned.
|
408
|
+
#
|
409
|
+
# For a list of metrics and dimensions supported by AWS services, see
|
410
|
+
# the [Amazon CloudWatch Metrics and Dimensions Reference][1] in the
|
411
|
+
# *Amazon CloudWatch User Guide*.
|
412
|
+
#
|
413
|
+
#
|
414
|
+
#
|
415
|
+
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html
|
416
|
+
# @option params [required, String] :namespace
|
417
|
+
# The namespace of the metric, with or without spaces.
|
418
|
+
# @option params [required, String] :metric_name
|
419
|
+
# The name of the metric, with or without spaces.
|
420
|
+
# @option params [Array<Types::Dimension>] :dimensions
|
421
|
+
# The dimensions. CloudWatch treats each unique combination of
|
422
|
+
# dimensions as a separate metric. You can't retrieve statistics using
|
423
|
+
# combinations of dimensions that were not specially published. You must
|
424
|
+
# specify the same dimensions that were used when the metrics were
|
425
|
+
# created. For an example, see [Dimension Combinations][1] in the
|
426
|
+
# *Amazon CloudWatch User Guide*.
|
427
|
+
#
|
428
|
+
#
|
429
|
+
#
|
430
|
+
# [1]: http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#dimension-combinations
|
431
|
+
# @option params [required, Time,DateTime,Date,Integer,String] :start_time
|
432
|
+
# The time stamp that determines the first data point to return. Note
|
433
|
+
# that start times are evaluated relative to the time that CloudWatch
|
434
|
+
# receives the request.
|
435
|
+
#
|
436
|
+
# The value specified is inclusive; results include data points with the
|
437
|
+
# specified time stamp. The time stamp must be in ISO 8601 UTC format
|
438
|
+
# (for example, 2016-10-03T23:00:00Z).
|
439
|
+
#
|
440
|
+
# CloudWatch rounds the specified time stamp as follows:
|
441
|
+
#
|
442
|
+
# * Start time less than 15 days ago - Round down to the nearest whole
|
443
|
+
# minute. For example, 12:32:34 is rounded down to 12:32:00.
|
444
|
+
#
|
445
|
+
# * Start time between 15 and 63 days ago - Round down to the nearest
|
446
|
+
# 5-minute clock interval. For example, 12:32:34 is rounded down to
|
447
|
+
# 12:30:00.
|
448
|
+
#
|
449
|
+
# * Start time greater than 63 days ago - Round down to the nearest
|
450
|
+
# 1-hour clock interval. For example, 12:32:34 is rounded down to
|
451
|
+
# 12:00:00.
|
452
|
+
# @option params [required, Time,DateTime,Date,Integer,String] :end_time
|
453
|
+
# The time stamp that determines the last data point to return.
|
454
|
+
#
|
455
|
+
# The value specified is exclusive; results will include data points up
|
456
|
+
# to the specified time stamp. The time stamp must be in ISO 8601 UTC
|
457
|
+
# format (for example, 2016-10-10T23:00:00Z).
|
458
|
+
# @option params [required, Integer] :period
|
459
|
+
# The granularity, in seconds, of the returned data points. A period can
|
460
|
+
# be as short as one minute (60 seconds) and must be a multiple of 60.
|
461
|
+
# The default value is 60.
|
462
|
+
#
|
463
|
+
# If the `StartTime` parameter specifies a time stamp that is greater
|
464
|
+
# than 15 days ago, you must specify the period as follows or no data
|
465
|
+
# points in that time range is returned:
|
466
|
+
#
|
467
|
+
# * Start time between 15 and 63 days ago - Use a multiple of 300
|
468
|
+
# seconds (5 minutes).
|
469
|
+
#
|
470
|
+
# * Start time greater than 63 days ago - Use a multiple of 3600 seconds
|
471
|
+
# (1 hour).
|
472
|
+
# @option params [Array<String>] :statistics
|
473
|
+
# The metric statistics, other than percentile. For percentile
|
474
|
+
# statistics, use `ExtendedStatistic`.
|
475
|
+
# @option params [Array<String>] :extended_statistics
|
476
|
+
# The percentile statistics. Specify values between p0.0 and p100.
|
477
|
+
# @option params [String] :unit
|
478
|
+
# The unit for a given metric. Metrics may be reported in multiple
|
479
|
+
# units. Not supplying a unit results in all units being returned. If
|
480
|
+
# the metric only ever reports one unit, specifying a unit has no
|
481
|
+
# effect.
|
482
|
+
# @return [Types::GetMetricStatisticsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
483
|
+
#
|
484
|
+
# * {Types::GetMetricStatisticsOutput#label #Label} => String
|
485
|
+
# * {Types::GetMetricStatisticsOutput#datapoints #Datapoints} => Array<Types::Datapoint>
|
486
|
+
#
|
487
|
+
# @example Request syntax with placeholder values
|
488
|
+
# resp = client.get_metric_statistics({
|
489
|
+
# namespace: "Namespace", # required
|
490
|
+
# metric_name: "MetricName", # required
|
491
|
+
# dimensions: [
|
492
|
+
# {
|
493
|
+
# name: "DimensionName", # required
|
494
|
+
# value: "DimensionValue", # required
|
495
|
+
# },
|
496
|
+
# ],
|
497
|
+
# start_time: Time.now, # required
|
498
|
+
# end_time: Time.now, # required
|
499
|
+
# period: 1, # required
|
500
|
+
# statistics: ["SampleCount"], # accepts SampleCount, Average, Sum, Minimum, Maximum
|
501
|
+
# extended_statistics: ["ExtendedStatistic"],
|
502
|
+
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
|
503
|
+
# })
|
504
|
+
#
|
505
|
+
# @example Response structure
|
506
|
+
# resp.label #=> String
|
507
|
+
# resp.datapoints #=> Array
|
508
|
+
# resp.datapoints[0].timestamp #=> Time
|
509
|
+
# resp.datapoints[0].sample_count #=> Float
|
510
|
+
# resp.datapoints[0].average #=> Float
|
511
|
+
# resp.datapoints[0].sum #=> Float
|
512
|
+
# resp.datapoints[0].minimum #=> Float
|
513
|
+
# resp.datapoints[0].maximum #=> Float
|
514
|
+
# resp.datapoints[0].unit #=> String, one of "Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None"
|
515
|
+
# resp.datapoints[0].extended_statistics #=> Hash
|
516
|
+
# resp.datapoints[0].extended_statistics["ExtendedStatistic"] #=> Float
|
517
|
+
# @overload get_metric_statistics(params = {})
|
518
|
+
# @param [Hash] params ({})
|
519
|
+
def get_metric_statistics(params = {}, options = {})
|
520
|
+
req = build_request(:get_metric_statistics, params)
|
521
|
+
req.send_request(options)
|
522
|
+
end
|
523
|
+
|
524
|
+
# List the specified metrics. You can use the returned metrics with
|
525
|
+
# GetMetricStatistics to obtain statistical data.
|
526
|
+
#
|
527
|
+
# Up to 500 results are returned for any one call. To retrieve
|
528
|
+
# additional results, use the returned token with subsequent calls.
|
529
|
+
#
|
530
|
+
# After you create a metric, allow up to fifteen minutes before the
|
531
|
+
# metric appears. Statistics about the metric, however, are available
|
532
|
+
# sooner using GetMetricStatistics.
|
533
|
+
# @option params [String] :namespace
|
534
|
+
# The namespace to filter against.
|
535
|
+
# @option params [String] :metric_name
|
536
|
+
# The name of the metric to filter against.
|
537
|
+
# @option params [Array<Types::DimensionFilter>] :dimensions
|
538
|
+
# The dimensions to filter against.
|
539
|
+
# @option params [String] :next_token
|
540
|
+
# The token returned by a previous call to indicate that there is more
|
541
|
+
# data available.
|
542
|
+
# @return [Types::ListMetricsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
543
|
+
#
|
544
|
+
# * {Types::ListMetricsOutput#metrics #Metrics} => Array<Types::Metric>
|
545
|
+
# * {Types::ListMetricsOutput#next_token #NextToken} => String
|
546
|
+
#
|
547
|
+
# @example Request syntax with placeholder values
|
548
|
+
# resp = client.list_metrics({
|
549
|
+
# namespace: "Namespace",
|
550
|
+
# metric_name: "MetricName",
|
551
|
+
# dimensions: [
|
552
|
+
# {
|
553
|
+
# name: "DimensionName", # required
|
554
|
+
# value: "DimensionValue",
|
555
|
+
# },
|
556
|
+
# ],
|
557
|
+
# next_token: "NextToken",
|
558
|
+
# })
|
559
|
+
#
|
560
|
+
# @example Response structure
|
561
|
+
# resp.metrics #=> Array
|
562
|
+
# resp.metrics[0].namespace #=> String
|
563
|
+
# resp.metrics[0].metric_name #=> String
|
564
|
+
# resp.metrics[0].dimensions #=> Array
|
565
|
+
# resp.metrics[0].dimensions[0].name #=> String
|
566
|
+
# resp.metrics[0].dimensions[0].value #=> String
|
567
|
+
# resp.next_token #=> String
|
568
|
+
# @overload list_metrics(params = {})
|
569
|
+
# @param [Hash] params ({})
|
570
|
+
def list_metrics(params = {}, options = {})
|
571
|
+
req = build_request(:list_metrics, params)
|
572
|
+
req.send_request(options)
|
573
|
+
end
|
574
|
+
|
575
|
+
# Creates or updates an alarm and associates it with the specified
|
576
|
+
# metric. Optionally, this operation can associate one or more Amazon
|
577
|
+
# SNS resources with the alarm.
|
578
|
+
#
|
579
|
+
# When this operation creates an alarm, the alarm state is immediately
|
580
|
+
# set to `INSUFFICIENT_DATA`. The alarm is evaluated and its state is
|
581
|
+
# set appropriately. Any actions associated with the state are then
|
582
|
+
# executed.
|
583
|
+
#
|
584
|
+
# When you update an existing alarm, its state is left unchanged, but
|
585
|
+
# the update completely overwrites the previous configuration of the
|
586
|
+
# alarm.
|
587
|
+
#
|
588
|
+
# If you are an AWS Identity and Access Management (IAM) user, you must
|
589
|
+
# have Amazon EC2 permissions for some operations:
|
590
|
+
#
|
591
|
+
# * `ec2:DescribeInstanceStatus` and `ec2:DescribeInstances` for all
|
592
|
+
# alarms on EC2 instance status metrics
|
593
|
+
#
|
594
|
+
# * `ec2:StopInstances` for alarms with stop actions
|
595
|
+
#
|
596
|
+
# * `ec2:TerminateInstances` for alarms with terminate actions
|
597
|
+
#
|
598
|
+
# * `ec2:DescribeInstanceRecoveryAttribute` and `ec2:RecoverInstances`
|
599
|
+
# for alarms with recover actions
|
600
|
+
#
|
601
|
+
# If you have read/write permissions for Amazon CloudWatch but not for
|
602
|
+
# Amazon EC2, you can still create an alarm, but the stop or terminate
|
603
|
+
# actions won't be performed. However, if you are later granted the
|
604
|
+
# required permissions, the alarm actions that you created earlier will
|
605
|
+
# be performed.
|
606
|
+
#
|
607
|
+
# If you are using an IAM role (for example, an Amazon EC2 instance
|
608
|
+
# profile), you cannot stop or terminate the instance using alarm
|
609
|
+
# actions. However, you can still see the alarm state and perform any
|
610
|
+
# other actions such as Amazon SNS notifications or Auto Scaling
|
611
|
+
# policies.
|
612
|
+
#
|
613
|
+
# If you are using temporary security credentials granted using the AWS
|
614
|
+
# Security Token Service (AWS STS), you cannot stop or terminate an
|
615
|
+
# Amazon EC2 instance using alarm actions.
|
616
|
+
#
|
617
|
+
# Note that you must create at least one stop, terminate, or reboot
|
618
|
+
# alarm using the Amazon EC2 or CloudWatch console to create the
|
619
|
+
# **EC2ActionsAccess** IAM role. After this IAM role is created, you can
|
620
|
+
# create stop, terminate, or reboot alarms using a command-line
|
621
|
+
# interface or an API.
|
622
|
+
# @option params [required, String] :alarm_name
|
623
|
+
# The name for the alarm. This name must be unique within the AWS
|
624
|
+
# account.
|
625
|
+
# @option params [String] :alarm_description
|
626
|
+
# The description for the alarm.
|
627
|
+
# @option params [Boolean] :actions_enabled
|
628
|
+
# Indicates whether actions should be executed during any changes to the
|
629
|
+
# alarm state.
|
630
|
+
# @option params [Array<String>] :ok_actions
|
631
|
+
# The actions to execute when this alarm transitions to an `OK` state
|
632
|
+
# from any other state. Each action is specified as an Amazon Resource
|
633
|
+
# Name (ARN).
|
634
|
+
#
|
635
|
+
# Valid Values: arn:aws:automate:*region*\:ec2:stop \|
|
636
|
+
# arn:aws:automate:*region*\:ec2:terminate \|
|
637
|
+
# arn:aws:automate:*region*\:ec2:recover
|
638
|
+
#
|
639
|
+
# Valid Values (for use with IAM roles):
|
640
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Stop/1.0
|
641
|
+
# \|
|
642
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Terminate/1.0
|
643
|
+
# \|
|
644
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Reboot/1.0
|
645
|
+
# @option params [Array<String>] :alarm_actions
|
646
|
+
# The actions to execute when this alarm transitions to the `ALARM`
|
647
|
+
# state from any other state. Each action is specified as an Amazon
|
648
|
+
# Resource Name (ARN).
|
649
|
+
#
|
650
|
+
# Valid Values: arn:aws:automate:*region*\:ec2:stop \|
|
651
|
+
# arn:aws:automate:*region*\:ec2:terminate \|
|
652
|
+
# arn:aws:automate:*region*\:ec2:recover
|
653
|
+
#
|
654
|
+
# Valid Values (for use with IAM roles):
|
655
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Stop/1.0
|
656
|
+
# \|
|
657
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Terminate/1.0
|
658
|
+
# \|
|
659
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Reboot/1.0
|
660
|
+
# @option params [Array<String>] :insufficient_data_actions
|
661
|
+
# The actions to execute when this alarm transitions to the
|
662
|
+
# `INSUFFICIENT_DATA` state from any other state. Each action is
|
663
|
+
# specified as an Amazon Resource Name (ARN).
|
664
|
+
#
|
665
|
+
# Valid Values: arn:aws:automate:*region*\:ec2:stop \|
|
666
|
+
# arn:aws:automate:*region*\:ec2:terminate \|
|
667
|
+
# arn:aws:automate:*region*\:ec2:recover
|
668
|
+
#
|
669
|
+
# Valid Values (for use with IAM roles):
|
670
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Stop/1.0
|
671
|
+
# \|
|
672
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Terminate/1.0
|
673
|
+
# \|
|
674
|
+
# arn:aws:swf:us-east-1:\\\{*customer-account*\\}:action/actions/AWS\_EC2.InstanceId.Reboot/1.0
|
675
|
+
# @option params [required, String] :metric_name
|
676
|
+
# The name for the metric associated with the alarm.
|
677
|
+
# @option params [required, String] :namespace
|
678
|
+
# The namespace for the metric associated with the alarm.
|
679
|
+
# @option params [String] :statistic
|
680
|
+
# The statistic for the metric associated with the alarm, other than
|
681
|
+
# percentile. For percentile statistics, use `ExtendedStatistic`.
|
682
|
+
# @option params [String] :extended_statistic
|
683
|
+
# The percentile statistic for the metric associated with the alarm.
|
684
|
+
# Specify a value between p0.0 and p100.
|
685
|
+
# @option params [Array<Types::Dimension>] :dimensions
|
686
|
+
# The dimensions for the metric associated with the alarm.
|
687
|
+
# @option params [required, Integer] :period
|
688
|
+
# The period, in seconds, over which the specified statistic is applied.
|
689
|
+
# @option params [String] :unit
|
690
|
+
# The unit of measure for the statistic. For example, the units for the
|
691
|
+
# Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the
|
692
|
+
# number of bytes that an instance receives on all network interfaces.
|
693
|
+
# You can also specify a unit when you create a custom metric. Units
|
694
|
+
# help provide conceptual meaning to your data. Metric data points that
|
695
|
+
# specify a unit of measure, such as Percent, are aggregated separately.
|
696
|
+
#
|
697
|
+
# If you specify a unit, you must use a unit that is appropriate for the
|
698
|
+
# metric. Otherwise, the Amazon CloudWatch alarm can get stuck in the
|
699
|
+
# `INSUFFICIENT DATA` state.
|
700
|
+
# @option params [required, Integer] :evaluation_periods
|
701
|
+
# The number of periods over which data is compared to the specified
|
702
|
+
# threshold.
|
703
|
+
# @option params [required, Float] :threshold
|
704
|
+
# The value against which the specified statistic is compared.
|
705
|
+
# @option params [required, String] :comparison_operator
|
706
|
+
# The arithmetic operation to use when comparing the specified statistic
|
707
|
+
# and threshold. The specified statistic value is used as the first
|
708
|
+
# operand.
|
709
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
710
|
+
#
|
711
|
+
# @example Request syntax with placeholder values
|
712
|
+
# resp = client.put_metric_alarm({
|
713
|
+
# alarm_name: "AlarmName", # required
|
714
|
+
# alarm_description: "AlarmDescription",
|
715
|
+
# actions_enabled: false,
|
716
|
+
# ok_actions: ["ResourceName"],
|
717
|
+
# alarm_actions: ["ResourceName"],
|
718
|
+
# insufficient_data_actions: ["ResourceName"],
|
719
|
+
# metric_name: "MetricName", # required
|
720
|
+
# namespace: "Namespace", # required
|
721
|
+
# statistic: "SampleCount", # accepts SampleCount, Average, Sum, Minimum, Maximum
|
722
|
+
# extended_statistic: "ExtendedStatistic",
|
723
|
+
# dimensions: [
|
724
|
+
# {
|
725
|
+
# name: "DimensionName", # required
|
726
|
+
# value: "DimensionValue", # required
|
727
|
+
# },
|
728
|
+
# ],
|
729
|
+
# period: 1, # required
|
730
|
+
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
|
731
|
+
# evaluation_periods: 1, # required
|
732
|
+
# threshold: 1.0, # required
|
733
|
+
# comparison_operator: "GreaterThanOrEqualToThreshold", # required, accepts GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold
|
734
|
+
# })
|
735
|
+
# @overload put_metric_alarm(params = {})
|
736
|
+
# @param [Hash] params ({})
|
737
|
+
def put_metric_alarm(params = {}, options = {})
|
738
|
+
req = build_request(:put_metric_alarm, params)
|
739
|
+
req.send_request(options)
|
740
|
+
end
|
741
|
+
|
742
|
+
# Publishes metric data points to Amazon CloudWatch. Amazon CloudWatch
|
743
|
+
# associates the data points with the specified metric. If the specified
|
744
|
+
# metric does not exist, Amazon CloudWatch creates the metric. When
|
745
|
+
# Amazon CloudWatch creates a metric, it can take up to fifteen minutes
|
746
|
+
# for the metric to appear in calls to ListMetrics.
|
747
|
+
#
|
748
|
+
# Each `PutMetricData` request is limited to 8 KB in size for HTTP GET
|
749
|
+
# requests and is limited to 40 KB in size for HTTP POST requests.
|
750
|
+
#
|
751
|
+
# Although the `Value` parameter accepts numbers of type `Double`,
|
752
|
+
# Amazon CloudWatch rejects values that are either too small or too
|
753
|
+
# large. Values must be in the range of 8.515920e-109 to 1.174271e+108
|
754
|
+
# (Base 10) or 2e-360 to 2e360 (Base 2). In addition, special values
|
755
|
+
# (e.g., NaN, +Infinity, -Infinity) are not supported.
|
756
|
+
#
|
757
|
+
# Data points with time stamps from 24 hours ago or longer can take at
|
758
|
+
# least 48 hours to become available for GetMetricStatistics from the
|
759
|
+
# time they are submitted.
|
760
|
+
# @option params [required, String] :namespace
|
761
|
+
# The namespace for the metric data.
|
762
|
+
#
|
763
|
+
# You cannot specify a namespace that begins with "AWS/". Namespaces
|
764
|
+
# that begin with "AWS/" are reserved for use by Amazon Web Services
|
765
|
+
# products.
|
766
|
+
# @option params [required, Array<Types::MetricDatum>] :metric_data
|
767
|
+
# The data for the metric.
|
768
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
769
|
+
#
|
770
|
+
# @example Request syntax with placeholder values
|
771
|
+
# resp = client.put_metric_data({
|
772
|
+
# namespace: "Namespace", # required
|
773
|
+
# metric_data: [ # required
|
774
|
+
# {
|
775
|
+
# metric_name: "MetricName", # required
|
776
|
+
# dimensions: [
|
777
|
+
# {
|
778
|
+
# name: "DimensionName", # required
|
779
|
+
# value: "DimensionValue", # required
|
780
|
+
# },
|
781
|
+
# ],
|
782
|
+
# timestamp: Time.now,
|
783
|
+
# value: 1.0,
|
784
|
+
# statistic_values: {
|
785
|
+
# sample_count: 1.0, # required
|
786
|
+
# sum: 1.0, # required
|
787
|
+
# minimum: 1.0, # required
|
788
|
+
# maximum: 1.0, # required
|
789
|
+
# },
|
790
|
+
# unit: "Seconds", # accepts Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, None
|
791
|
+
# },
|
792
|
+
# ],
|
793
|
+
# })
|
794
|
+
# @overload put_metric_data(params = {})
|
795
|
+
# @param [Hash] params ({})
|
796
|
+
def put_metric_data(params = {}, options = {})
|
797
|
+
req = build_request(:put_metric_data, params)
|
798
|
+
req.send_request(options)
|
799
|
+
end
|
800
|
+
|
801
|
+
# Temporarily sets the state of an alarm for testing purposes. When the
|
802
|
+
# updated state differs from the previous value, the action configured
|
803
|
+
# for the appropriate state is invoked. For example, if your alarm is
|
804
|
+
# configured to send an Amazon SNS message when an alarm is triggered,
|
805
|
+
# temporarily changing the alarm state to `ALARM` sends an Amazon SNS
|
806
|
+
# message. The alarm returns to its actual state (often within seconds).
|
807
|
+
# Because the alarm state change happens very quickly, it is typically
|
808
|
+
# only visible in the alarm's **History** tab in the Amazon CloudWatch
|
809
|
+
# console or through DescribeAlarmHistory.
|
810
|
+
# @option params [required, String] :alarm_name
|
811
|
+
# The name for the alarm. This name must be unique within the AWS
|
812
|
+
# account. The maximum length is 255 characters.
|
813
|
+
# @option params [required, String] :state_value
|
814
|
+
# The value of the state.
|
815
|
+
# @option params [required, String] :state_reason
|
816
|
+
# The reason that this alarm is set to this specific state, in text
|
817
|
+
# format.
|
818
|
+
# @option params [String] :state_reason_data
|
819
|
+
# The reason that this alarm is set to this specific state, in JSON
|
820
|
+
# format.
|
821
|
+
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
|
822
|
+
#
|
823
|
+
# @example Request syntax with placeholder values
|
824
|
+
# resp = client.set_alarm_state({
|
825
|
+
# alarm_name: "AlarmName", # required
|
826
|
+
# state_value: "OK", # required, accepts OK, ALARM, INSUFFICIENT_DATA
|
827
|
+
# state_reason: "StateReason", # required
|
828
|
+
# state_reason_data: "StateReasonData",
|
829
|
+
# })
|
830
|
+
# @overload set_alarm_state(params = {})
|
831
|
+
# @param [Hash] params ({})
|
832
|
+
def set_alarm_state(params = {}, options = {})
|
833
|
+
req = build_request(:set_alarm_state, params)
|
834
|
+
req.send_request(options)
|
835
|
+
end
|
836
|
+
|
837
|
+
# @!endgroup
|
838
|
+
|
839
|
+
# @param params ({})
|
840
|
+
# @api private
|
841
|
+
def build_request(operation_name, params = {})
|
842
|
+
handlers = @handlers.for(operation_name)
|
843
|
+
context = Seahorse::Client::RequestContext.new(
|
844
|
+
operation_name: operation_name,
|
845
|
+
operation: config.api.operation(operation_name),
|
846
|
+
client: self,
|
847
|
+
params: params,
|
848
|
+
config: config)
|
849
|
+
context[:gem_name] = 'aws-sdk-cloudwatch'
|
850
|
+
context[:gem_version] = '1.0.0.rc1'
|
851
|
+
Seahorse::Client::Request.new(handlers, context)
|
852
|
+
end
|
853
|
+
|
854
|
+
# Polls an API operation until a resource enters a desired state.
|
855
|
+
#
|
856
|
+
# ## Basic Usage
|
857
|
+
#
|
858
|
+
# A waiter will call an API operation until:
|
859
|
+
#
|
860
|
+
# * It is successful
|
861
|
+
# * It enters a terminal state
|
862
|
+
# * It makes the maximum number of attempts
|
863
|
+
#
|
864
|
+
# In between attempts, the waiter will sleep.
|
865
|
+
#
|
866
|
+
# # polls in a loop, sleeping between attempts
|
867
|
+
# client.waiter_until(waiter_name, params)
|
868
|
+
#
|
869
|
+
# ## Configuration
|
870
|
+
#
|
871
|
+
# You can configure the maximum number of polling attempts, and the
|
872
|
+
# delay (in seconds) between each polling attempt. You can pass
|
873
|
+
# configuration as the final arguments hash.
|
874
|
+
#
|
875
|
+
# # poll for ~25 seconds
|
876
|
+
# client.wait_until(waiter_name, params, {
|
877
|
+
# max_attempts: 5,
|
878
|
+
# delay: 5,
|
879
|
+
# })
|
880
|
+
#
|
881
|
+
# ## Callbacks
|
882
|
+
#
|
883
|
+
# You can be notified before each polling attempt and before each
|
884
|
+
# delay. If you throw `:success` or `:failure` from these callbacks,
|
885
|
+
# it will terminate the waiter.
|
886
|
+
#
|
887
|
+
# started_at = Time.now
|
888
|
+
# client.wait_until(waiter_name, params, {
|
889
|
+
#
|
890
|
+
# # disable max attempts
|
891
|
+
# max_attempts: nil,
|
892
|
+
#
|
893
|
+
# # poll for 1 hour, instead of a number of attempts
|
894
|
+
# before_wait: -> (attempts, response) do
|
895
|
+
# throw :failure if Time.now - started_at > 3600
|
896
|
+
# end
|
897
|
+
# })
|
898
|
+
#
|
899
|
+
# ## Handling Errors
|
900
|
+
#
|
901
|
+
# When a waiter is unsuccessful, it will raise an error.
|
902
|
+
# All of the failure errors extend from
|
903
|
+
# {Aws::Waiters::Errors::WaiterFailed}.
|
904
|
+
#
|
905
|
+
# begin
|
906
|
+
# client.wait_until(...)
|
907
|
+
# rescue Aws::Waiters::Errors::WaiterFailed
|
908
|
+
# # resource did not enter the desired state in time
|
909
|
+
# end
|
910
|
+
#
|
911
|
+
# ## Valid Waiters
|
912
|
+
#
|
913
|
+
# The following table lists the valid waiter names, the operations they call,
|
914
|
+
# and the default `:delay` and `:max_attempts` values.
|
915
|
+
#
|
916
|
+
# | waiter_name | params | :delay | :max_attempts |
|
917
|
+
# | ------------ | ------------------ | -------- | ------------- |
|
918
|
+
# | alarm_exists | {#describe_alarms} | 5 | 40 |
|
919
|
+
#
|
920
|
+
# @raise [Errors::FailureStateError] Raised when the waiter terminates
|
921
|
+
# because the waiter has entered a state that it will not transition
|
922
|
+
# out of, preventing success.
|
923
|
+
#
|
924
|
+
# @raise [Errors::TooManyAttemptsError] Raised when the configured
|
925
|
+
# maximum number of attempts have been made, and the waiter is not
|
926
|
+
# yet successful.
|
927
|
+
#
|
928
|
+
# @raise [Errors::UnexpectedError] Raised when an error is encounted
|
929
|
+
# while polling for a resource that is not expected.
|
930
|
+
#
|
931
|
+
# @raise [Errors::NoSuchWaiterError] Raised when you request to wait
|
932
|
+
# for an unknown state.
|
933
|
+
#
|
934
|
+
# @return [Boolean] Returns `true` if the waiter was successful.
|
935
|
+
# @param [Symbol] waiter_name
|
936
|
+
# @param [Hash] params ({})
|
937
|
+
# @param [Hash] options ({})
|
938
|
+
# @option options [Integer] :max_attempts
|
939
|
+
# @option options [Integer] :delay
|
940
|
+
# @option options [Proc] :before_attempt
|
941
|
+
# @option options [Proc] :before_wait
|
942
|
+
def wait_until(waiter_name, params = {}, options = {})
|
943
|
+
w = waiter(waiter_name, options)
|
944
|
+
yield(w.waiter) if block_given? # deprecated
|
945
|
+
w.wait(params)
|
946
|
+
end
|
947
|
+
|
948
|
+
# @api private
|
949
|
+
# @deprecated
|
950
|
+
def waiter_names
|
951
|
+
waiters.keys
|
952
|
+
end
|
953
|
+
|
954
|
+
private
|
955
|
+
|
956
|
+
# @param [Symbol] waiter_name
|
957
|
+
# @param [Hash] options ({})
|
958
|
+
def waiter(waiter_name, options = {})
|
959
|
+
waiter_class = waiters[waiter_name]
|
960
|
+
if waiter_class
|
961
|
+
waiter_class.new(options.merge(client: self))
|
962
|
+
else
|
963
|
+
raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
|
964
|
+
end
|
965
|
+
end
|
966
|
+
|
967
|
+
def waiters
|
968
|
+
{
|
969
|
+
alarm_exists: Waiters::AlarmExists
|
970
|
+
}
|
971
|
+
end
|
972
|
+
|
973
|
+
class << self
|
974
|
+
|
975
|
+
# @api private
|
976
|
+
attr_reader :identifier
|
977
|
+
|
978
|
+
# @api private
|
979
|
+
def errors_module
|
980
|
+
Errors
|
981
|
+
end
|
982
|
+
|
983
|
+
end
|
984
|
+
end
|
985
|
+
end
|
986
|
+
end
|