-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
client.rb
4279 lines (4220 loc) · 192 KB
/
client.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
require 'aws-sdk-core/plugins/logging.rb'
require 'aws-sdk-core/plugins/param_converter.rb'
require 'aws-sdk-core/plugins/param_validator.rb'
require 'aws-sdk-core/plugins/user_agent.rb'
require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
require 'aws-sdk-core/plugins/retry_errors.rb'
require 'aws-sdk-core/plugins/global_configuration.rb'
require 'aws-sdk-core/plugins/regional_endpoint.rb'
require 'aws-sdk-core/plugins/endpoint_discovery.rb'
require 'aws-sdk-core/plugins/endpoint_pattern.rb'
require 'aws-sdk-core/plugins/response_paging.rb'
require 'aws-sdk-core/plugins/stub_responses.rb'
require 'aws-sdk-core/plugins/idempotency_token.rb'
require 'aws-sdk-core/plugins/invocation_id.rb'
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
require 'aws-sdk-core/plugins/transfer_encoding.rb'
require 'aws-sdk-core/plugins/http_checksum.rb'
require 'aws-sdk-core/plugins/checksum_algorithm.rb'
require 'aws-sdk-core/plugins/request_compression.rb'
require 'aws-sdk-core/plugins/defaults_mode.rb'
require 'aws-sdk-core/plugins/recursion_detection.rb'
require 'aws-sdk-core/plugins/sign.rb'
require 'aws-sdk-core/plugins/protocols/query.rb'
Aws::Plugins::GlobalConfiguration.add_identifier(:cloudwatch)
module Aws::CloudWatch
# An API client for CloudWatch. To construct a client, you need to configure a `:region` and `:credentials`.
#
# client = Aws::CloudWatch::Client.new(
# region: region_name,
# credentials: credentials,
# # ...
# )
#
# For details on configuring region and credentials see
# the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
#
# See {#initialize} for a full list of supported configuration options.
class Client < Seahorse::Client::Base
include Aws::ClientStubs
@identifier = :cloudwatch
set_api(ClientApi::API)
add_plugin(Seahorse::Client::Plugins::ContentLength)
add_plugin(Aws::Plugins::CredentialsConfiguration)
add_plugin(Aws::Plugins::Logging)
add_plugin(Aws::Plugins::ParamConverter)
add_plugin(Aws::Plugins::ParamValidator)
add_plugin(Aws::Plugins::UserAgent)
add_plugin(Aws::Plugins::HelpfulSocketErrors)
add_plugin(Aws::Plugins::RetryErrors)
add_plugin(Aws::Plugins::GlobalConfiguration)
add_plugin(Aws::Plugins::RegionalEndpoint)
add_plugin(Aws::Plugins::EndpointDiscovery)
add_plugin(Aws::Plugins::EndpointPattern)
add_plugin(Aws::Plugins::ResponsePaging)
add_plugin(Aws::Plugins::StubResponses)
add_plugin(Aws::Plugins::IdempotencyToken)
add_plugin(Aws::Plugins::InvocationId)
add_plugin(Aws::Plugins::JsonvalueConverter)
add_plugin(Aws::Plugins::ClientMetricsPlugin)
add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
add_plugin(Aws::Plugins::TransferEncoding)
add_plugin(Aws::Plugins::HttpChecksum)
add_plugin(Aws::Plugins::ChecksumAlgorithm)
add_plugin(Aws::Plugins::RequestCompression)
add_plugin(Aws::Plugins::DefaultsMode)
add_plugin(Aws::Plugins::RecursionDetection)
add_plugin(Aws::Plugins::Sign)
add_plugin(Aws::Plugins::Protocols::Query)
add_plugin(Aws::CloudWatch::Plugins::Endpoints)
# @overload initialize(options)
# @param [Hash] options
# @option options [required, Aws::CredentialProvider] :credentials
# Your AWS credentials. This can be an instance of any one of the
# following classes:
#
# * `Aws::Credentials` - Used for configuring static, non-refreshing
# credentials.
#
# * `Aws::SharedCredentials` - Used for loading static credentials from a
# shared file, such as `~/.aws/config`.
#
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
#
# * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
# assume a role after providing credentials via the web.
#
# * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
# access token generated from `aws login`.
#
# * `Aws::ProcessCredentials` - Used for loading credentials from a
# process that outputs to stdout.
#
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
# from an EC2 IMDS on an EC2 instance.
#
# * `Aws::ECSCredentials` - Used for loading credentials from
# instances running in ECS.
#
# * `Aws::CognitoIdentityCredentials` - Used for loading credentials
# from the Cognito Identity service.
#
# When `:credentials` are not configured directly, the following
# locations will be searched for credentials:
#
# * `Aws.config[:credentials]`
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
# * `~/.aws/credentials`
# * `~/.aws/config`
# * EC2/ECS IMDS instance profile - When used by default, the timeouts
# are very aggressive. Construct and pass an instance of
# `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
# enable retries and extended timeouts. Instance profile credential
# fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
# to true.
#
# @option options [required, String] :region
# The AWS region to connect to. The configured `:region` is
# used to determine the service `:endpoint`. When not passed,
# a default `:region` is searched for in the following locations:
#
# * `Aws.config[:region]`
# * `ENV['AWS_REGION']`
# * `ENV['AMAZON_REGION']`
# * `ENV['AWS_DEFAULT_REGION']`
# * `~/.aws/credentials`
# * `~/.aws/config`
#
# @option options [String] :access_key_id
#
# @option options [Boolean] :active_endpoint_cache (false)
# When set to `true`, a thread polling for endpoints will be running in
# the background every 60 secs (default). Defaults to `false`.
#
# @option options [Boolean] :adaptive_retry_wait_to_fill (true)
# Used only in `adaptive` retry mode. When true, the request will sleep
# until there is sufficent client side capacity to retry the request.
# When false, the request will raise a `RetryCapacityNotAvailableError` and will
# not retry instead of sleeping.
#
# @option options [Boolean] :client_side_monitoring (false)
# When `true`, client-side metrics will be collected for all API requests from
# this client.
#
# @option options [String] :client_side_monitoring_client_id ("")
# Allows you to provide an identifier for this client which will be attached to
# all generated client side metrics. Defaults to an empty string.
#
# @option options [String] :client_side_monitoring_host ("127.0.0.1")
# Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
# side monitoring agent is running on, where client metrics will be published via UDP.
#
# @option options [Integer] :client_side_monitoring_port (31000)
# Required for publishing client metrics. The port that the client side monitoring
# agent is running on, where client metrics will be published via UDP.
#
# @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
# Allows you to provide a custom client-side monitoring publisher class. By default,
# will use the Client Side Monitoring Agent Publisher.
#
# @option options [Boolean] :convert_params (true)
# When `true`, an attempt is made to coerce request parameters into
# the required types.
#
# @option options [Boolean] :correct_clock_skew (true)
# Used only in `standard` and adaptive retry modes. Specifies whether to apply
# a clock skew correction and retry requests with skewed client clocks.
#
# @option options [String] :defaults_mode ("legacy")
# See {Aws::DefaultsModeConfiguration} for a list of the
# accepted modes and the configuration defaults that are included.
#
# @option options [Boolean] :disable_host_prefix_injection (false)
# Set to true to disable SDK automatically adding host prefix
# to default service endpoint when available.
#
# @option options [Boolean] :disable_request_compression (false)
# When set to 'true' the request body will not be compressed
# for supported operations.
#
# @option options [String, URI::HTTPS, URI::HTTP] :endpoint
# Normally you should not configure the `:endpoint` option
# directly. This is normally constructed from the `:region`
# option. Configuring `:endpoint` is normally reserved for
# connecting to test or custom endpoints. The endpoint should
# be a URI formatted like:
#
# 'http://example.com'
# 'https://example.com'
# 'http://example.com:123'
#
#
# @option options [Integer] :endpoint_cache_max_entries (1000)
# Used for the maximum size limit of the LRU cache storing endpoints data
# for endpoint discovery enabled operations. Defaults to 1000.
#
# @option options [Integer] :endpoint_cache_max_threads (10)
# Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
#
# @option options [Integer] :endpoint_cache_poll_interval (60)
# When :endpoint_discovery and :active_endpoint_cache is enabled,
# Use this option to config the time interval in seconds for making
# requests fetching endpoints information. Defaults to 60 sec.
#
# @option options [Boolean] :endpoint_discovery (false)
# When set to `true`, endpoint discovery will be enabled for operations when available.
#
# @option options [Boolean] :ignore_configured_endpoint_urls
# Setting to true disables use of endpoint URLs provided via environment
# variables and the shared configuration file.
#
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
# The log formatter.
#
# @option options [Symbol] :log_level (:info)
# The log level to send messages to the `:logger` at.
#
# @option options [Logger] :logger
# The Logger instance to send log messages to. If this option
# is not set, logging will be disabled.
#
# @option options [Integer] :max_attempts (3)
# An integer representing the maximum number attempts that will be made for
# a single request, including the initial attempt. For example,
# setting this value to 5 will result in a request being retried up to
# 4 times. Used in `standard` and `adaptive` retry modes.
#
# @option options [String] :profile ("default")
# Used when loading credentials from the shared credentials file
# at HOME/.aws/credentials. When not specified, 'default' is used.
#
# @option options [Integer] :request_min_compression_size_bytes (10240)
# The minimum size in bytes that triggers compression for request
# bodies. The value must be non-negative integer value between 0
# and 10485780 bytes inclusive.
#
# @option options [Proc] :retry_backoff
# A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
# This option is only used in the `legacy` retry mode.
#
# @option options [Float] :retry_base_delay (0.3)
# The base delay in seconds used by the default backoff function. This option
# is only used in the `legacy` retry mode.
#
# @option options [Symbol] :retry_jitter (:none)
# A delay randomiser function used by the default backoff function.
# Some predefined functions can be referenced by name - :none, :equal, :full,
# otherwise a Proc that takes and returns a number. This option is only used
# in the `legacy` retry mode.
#
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
#
# @option options [Integer] :retry_limit (3)
# The maximum number of times to retry failed requests. Only
# ~ 500 level server errors and certain ~ 400 level client errors
# are retried. Generally, these are throttling errors, data
# checksum errors, networking errors, timeout errors, auth errors,
# endpoint discovery, and errors from expired credentials.
# This option is only used in the `legacy` retry mode.
#
# @option options [Integer] :retry_max_delay (0)
# The maximum number of seconds to delay between retries (0 for no limit)
# used by the default backoff function. This option is only used in the
# `legacy` retry mode.
#
# @option options [String] :retry_mode ("legacy")
# Specifies which retry algorithm to use. Values are:
#
# * `legacy` - The pre-existing retry behavior. This is default value if
# no retry mode is provided.
#
# * `standard` - A standardized set of retry rules across the AWS SDKs.
# This includes support for retry quotas, which limit the number of
# unsuccessful retries a client can make.
#
# * `adaptive` - An experimental retry mode that includes all the
# functionality of `standard` mode along with automatic client side
# throttling. This is a provisional mode that may change behavior
# in the future.
#
#
# @option options [String] :sdk_ua_app_id
# A unique and opaque application ID that is appended to the
# User-Agent header as app/sdk_ua_app_id. It should have a
# maximum length of 50. This variable is sourced from environment
# variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
#
# @option options [String] :secret_access_key
#
# @option options [String] :session_token
#
# @option options [Boolean] :stub_responses (false)
# Causes the client to return stubbed responses. By default
# fake responses are generated and returned. You can specify
# the response data to return or errors to raise by calling
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
#
# ** Please note ** When response stubbing is enabled, no HTTP
# requests are made, and retries are disabled.
#
# @option options [Aws::TokenProvider] :token_provider
# A Bearer Token Provider. This can be an instance of any one of the
# following classes:
#
# * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
# tokens.
#
# * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
# access token generated from `aws login`.
#
# When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
# will be used to search for tokens configured for your profile in shared configuration files.
#
# @option options [Boolean] :use_dualstack_endpoint
# When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
# will be used if available.
#
# @option options [Boolean] :use_fips_endpoint
# When set to `true`, fips compatible endpoints will be used if available.
# When a `fips` region is used, the region is normalized and this config
# is set to `true`.
#
# @option options [Boolean] :validate_params (true)
# When `true`, request parameters are validated before
# sending the request.
#
# @option options [Aws::CloudWatch::EndpointProvider] :endpoint_provider
# The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::CloudWatch::EndpointParameters`
#
# @option options [Float] :http_continue_timeout (1)
# The number of seconds to wait for a 100-continue response before sending the
# request body. This option has no effect unless the request has "Expect"
# header set to "100-continue". Defaults to `nil` which disables this
# behaviour. This value can safely be set per request on the session.
#
# @option options [Float] :http_idle_timeout (5)
# The number of seconds a connection is allowed to sit idle before it
# is considered stale. Stale connections are closed and removed from the
# pool before making a request.
#
# @option options [Float] :http_open_timeout (15)
# The default number of seconds to wait for response data.
# This value can safely be set per-request on the session.
#
# @option options [URI::HTTP,String] :http_proxy
# A proxy to send requests through. Formatted like 'http://proxy.com:123'.
#
# @option options [Float] :http_read_timeout (60)
# The default number of seconds to wait for response data.
# This value can safely be set per-request on the session.
#
# @option options [Boolean] :http_wire_trace (false)
# When `true`, HTTP debug output will be sent to the `:logger`.
#
# @option options [Proc] :on_chunk_received
# When a Proc object is provided, it will be used as callback when each chunk
# of the response body is received. It provides three arguments: the chunk,
# the number of bytes received, and the total number of
# bytes in the response (or nil if the server did not send a `content-length`).
#
# @option options [Proc] :on_chunk_sent
# When a Proc object is provided, it will be used as callback when each chunk
# of the request body is sent. It provides three arguments: the chunk,
# the number of bytes read from the body, and the total number of
# bytes in the body.
#
# @option options [Boolean] :raise_response_errors (true)
# When `true`, response errors are raised.
#
# @option options [String] :ssl_ca_bundle
# Full path to the SSL certificate authority bundle file that should be used when
# verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
# `:ssl_ca_directory` the the system default will be used if available.
#
# @option options [String] :ssl_ca_directory
# Full path of the directory that contains the unbundled SSL certificate
# authority files for verifying peer certificates. If you do
# not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
# default will be used if available.
#
# @option options [String] :ssl_ca_store
# Sets the X509::Store to verify peer certificate.
#
# @option options [Float] :ssl_timeout
# Sets the SSL timeout in seconds
#
# @option options [Boolean] :ssl_verify_peer (true)
# When `true`, SSL peer certificates are verified when establishing a connection.
#
def initialize(*args)
super
end
# @!group API Operations
# Deletes the specified alarms. You can delete up to 100 alarms in one
# operation. However, this total can include no more than one composite
# alarm. For example, you could delete 99 metric alarms and one
# composite alarms with one operation, but you can't delete two
# composite alarms with one operation.
#
# If you specify an incorrect alarm name or make any other error in the
# operation, no alarms are deleted. To confirm that alarms were deleted
# successfully, you can use the [DescribeAlarms][1] operation after
# using `DeleteAlarms`.
#
# <note markdown="1"> It is possible to create a loop or cycle of composite alarms, where
# composite alarm A depends on composite alarm B, and composite alarm B
# also depends on composite alarm A. In this scenario, you can't delete
# any composite alarm that is part of the cycle because there is always
# still a composite alarm that depends on that alarm that you want to
# delete.
#
# To get out of such a situation, you must break the cycle by changing
# the rule of one of the composite alarms in the cycle to remove a
# dependency that creates the cycle. The simplest change to make to
# break a cycle is to change the `AlarmRule` of one of the alarms to
# `false`.
#
# Additionally, the evaluation of composite alarms stops if CloudWatch
# detects a cycle in the evaluation path.
#
# </note>
#
#
#
# [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html
#
# @option params [required, Array<String>] :alarm_names
# The alarms to be deleted. Do not enclose the alarm names in quote
# marks.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_alarms({
# alarm_names: ["AlarmName"], # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAlarms AWS API Documentation
#
# @overload delete_alarms(params = {})
# @param [Hash] params ({})
def delete_alarms(params = {}, options = {})
req = build_request(:delete_alarms, params)
req.send_request(options)
end
# Deletes the specified anomaly detection model from your account. For
# more information about how to delete an anomaly detection model, see
# [Deleting an anomaly detection model][1] in the *CloudWatch User
# Guide*.
#
#
#
# [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Anomaly_Detection_Alarm.html#Delete_Anomaly_Detection_Model
#
# @option params [String] :namespace
# The namespace associated with the anomaly detection model to delete.
#
# @option params [String] :metric_name
# The metric name associated with the anomaly detection model to delete.
#
# @option params [Array<Types::Dimension>] :dimensions
# The metric dimensions associated with the anomaly detection model to
# delete.
#
# @option params [String] :stat
# The statistic associated with the anomaly detection model to delete.
#
# @option params [Types::SingleMetricAnomalyDetector] :single_metric_anomaly_detector
# A single metric anomaly detector to be deleted.
#
# When using `SingleMetricAnomalyDetector`, you cannot include the
# following parameters in the same operation:
#
# * `Dimensions`,
#
# * `MetricName`
#
# * `Namespace`
#
# * `Stat`
#
# * the `MetricMathAnomalyDetector` parameters of
# `DeleteAnomalyDetectorInput`
#
# Instead, specify the single metric anomaly detector attributes as part
# of the `SingleMetricAnomalyDetector` property.
#
# @option params [Types::MetricMathAnomalyDetector] :metric_math_anomaly_detector
# The metric math anomaly detector to be deleted.
#
# When using `MetricMathAnomalyDetector`, you cannot include following
# parameters in the same operation:
#
# * `Dimensions`,
#
# * `MetricName`
#
# * `Namespace`
#
# * `Stat`
#
# * the `SingleMetricAnomalyDetector` parameters of
# `DeleteAnomalyDetectorInput`
#
# Instead, specify the metric math anomaly detector attributes as part
# of the `MetricMathAnomalyDetector` property.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_anomaly_detector({
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# stat: "AnomalyDetectorMetricStat",
# single_metric_anomaly_detector: {
# account_id: "AccountId",
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# stat: "AnomalyDetectorMetricStat",
# },
# metric_math_anomaly_detector: {
# metric_data_queries: [
# {
# id: "MetricId", # required
# metric_stat: {
# metric: { # required
# namespace: "Namespace",
# metric_name: "MetricName",
# dimensions: [
# {
# name: "DimensionName", # required
# value: "DimensionValue", # required
# },
# ],
# },
# period: 1, # required
# stat: "Stat", # required
# 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
# },
# expression: "MetricExpression",
# label: "MetricLabel",
# return_data: false,
# period: 1,
# account_id: "AccountId",
# },
# ],
# },
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteAnomalyDetector AWS API Documentation
#
# @overload delete_anomaly_detector(params = {})
# @param [Hash] params ({})
def delete_anomaly_detector(params = {}, options = {})
req = build_request(:delete_anomaly_detector, params)
req.send_request(options)
end
# Deletes all dashboards that you specify. You can specify up to 100
# dashboards to delete. If there is an error during this call, no
# dashboards are deleted.
#
# @option params [required, Array<String>] :dashboard_names
# The dashboards to be deleted. This parameter is required.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_dashboards({
# dashboard_names: ["DashboardName"], # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteDashboards AWS API Documentation
#
# @overload delete_dashboards(params = {})
# @param [Hash] params ({})
def delete_dashboards(params = {}, options = {})
req = build_request(:delete_dashboards, params)
req.send_request(options)
end
# Permanently deletes the specified Contributor Insights rules.
#
# If you create a rule, delete it, and then re-create it with the same
# name, historical data from the first time the rule was created might
# not be available.
#
# @option params [required, Array<String>] :rule_names
# An array of the rule names to delete. If you need to find out the
# names of your rules, use [DescribeInsightRules][1].
#
#
#
# [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html
#
# @return [Types::DeleteInsightRulesOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DeleteInsightRulesOutput#failures #failures} => Array<Types::PartialFailure>
#
# @example Request syntax with placeholder values
#
# resp = client.delete_insight_rules({
# rule_names: ["InsightRuleName"], # required
# })
#
# @example Response structure
#
# resp.failures #=> Array
# resp.failures[0].failure_resource #=> String
# resp.failures[0].exception_type #=> String
# resp.failures[0].failure_code #=> String
# resp.failures[0].failure_description #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteInsightRules AWS API Documentation
#
# @overload delete_insight_rules(params = {})
# @param [Hash] params ({})
def delete_insight_rules(params = {}, options = {})
req = build_request(:delete_insight_rules, params)
req.send_request(options)
end
# Permanently deletes the metric stream that you specify.
#
# @option params [required, String] :name
# The name of the metric stream to delete.
#
# @return [Struct] Returns an empty {Seahorse::Client::Response response}.
#
# @example Request syntax with placeholder values
#
# resp = client.delete_metric_stream({
# name: "MetricStreamName", # required
# })
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteMetricStream AWS API Documentation
#
# @overload delete_metric_stream(params = {})
# @param [Hash] params ({})
def delete_metric_stream(params = {}, options = {})
req = build_request(:delete_metric_stream, params)
req.send_request(options)
end
# Retrieves the history for the specified alarm. You can filter the
# results by date range or item type. If an alarm name is not specified,
# the histories for either all metric alarms or all composite alarms are
# returned.
#
# CloudWatch retains the history of an alarm even if you delete the
# alarm.
#
# To use this operation and return information about a composite alarm,
# you must be signed on with the `cloudwatch:DescribeAlarmHistory`
# permission that is scoped to `*`. You can't return information about
# composite alarms if your `cloudwatch:DescribeAlarmHistory` permission
# has a narrower scope.
#
# @option params [String] :alarm_name
# The name of the alarm.
#
# @option params [Array<String>] :alarm_types
# Use this parameter to specify whether you want the operation to return
# metric alarms or composite alarms. If you omit this parameter, only
# metric alarms are returned.
#
# @option params [String] :history_item_type
# The type of alarm histories to retrieve.
#
# @option params [Time,DateTime,Date,Integer,String] :start_date
# The starting date to retrieve alarm history.
#
# @option params [Time,DateTime,Date,Integer,String] :end_date
# The ending date to retrieve alarm history.
#
# @option params [Integer] :max_records
# The maximum number of alarm history records to retrieve.
#
# @option params [String] :next_token
# The token returned by a previous call to indicate that there is more
# data available.
#
# @option params [String] :scan_by
# Specified whether to return the newest or oldest alarm history first.
# Specify `TimestampDescending` to have the newest event history
# returned first, and specify `TimestampAscending` to have the oldest
# history returned first.
#
# @return [Types::DescribeAlarmHistoryOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAlarmHistoryOutput#alarm_history_items #alarm_history_items} => Array<Types::AlarmHistoryItem>
# * {Types::DescribeAlarmHistoryOutput#next_token #next_token} => String
#
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
#
# @example Request syntax with placeholder values
#
# resp = client.describe_alarm_history({
# alarm_name: "AlarmName",
# alarm_types: ["CompositeAlarm"], # accepts CompositeAlarm, MetricAlarm
# history_item_type: "ConfigurationUpdate", # accepts ConfigurationUpdate, StateUpdate, Action
# start_date: Time.now,
# end_date: Time.now,
# max_records: 1,
# next_token: "NextToken",
# scan_by: "TimestampDescending", # accepts TimestampDescending, TimestampAscending
# })
#
# @example Response structure
#
# resp.alarm_history_items #=> Array
# resp.alarm_history_items[0].alarm_name #=> String
# resp.alarm_history_items[0].alarm_type #=> String, one of "CompositeAlarm", "MetricAlarm"
# resp.alarm_history_items[0].timestamp #=> Time
# resp.alarm_history_items[0].history_item_type #=> String, one of "ConfigurationUpdate", "StateUpdate", "Action"
# resp.alarm_history_items[0].history_summary #=> String
# resp.alarm_history_items[0].history_data #=> String
# resp.next_token #=> String
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarmHistory AWS API Documentation
#
# @overload describe_alarm_history(params = {})
# @param [Hash] params ({})
def describe_alarm_history(params = {}, options = {})
req = build_request(:describe_alarm_history, params)
req.send_request(options)
end
# Retrieves the specified alarms. You can filter the results by
# specifying a prefix for the alarm name, the alarm state, or a prefix
# for any action.
#
# To use this operation and return information about composite alarms,
# you must be signed on with the `cloudwatch:DescribeAlarms` permission
# that is scoped to `*`. You can't return information about composite
# alarms if your `cloudwatch:DescribeAlarms` permission has a narrower
# scope.
#
# @option params [Array<String>] :alarm_names
# The names of the alarms to retrieve information about.
#
# @option params [String] :alarm_name_prefix
# An alarm name prefix. If you specify this parameter, you receive
# information about all alarms that have names that start with this
# prefix.
#
# If this parameter is specified, you cannot specify `AlarmNames`.
#
# @option params [Array<String>] :alarm_types
# Use this parameter to specify whether you want the operation to return
# metric alarms or composite alarms. If you omit this parameter, only
# metric alarms are returned, even if composite alarms exist in the
# account.
#
# For example, if you omit this parameter or specify `MetricAlarms`, the
# operation returns only a list of metric alarms. It does not return any
# composite alarms, even if composite alarms exist in the account.
#
# If you specify `CompositeAlarms`, the operation returns only a list of
# composite alarms, and does not return any metric alarms.
#
# @option params [String] :children_of_alarm_name
# If you use this parameter and specify the name of a composite alarm,
# the operation returns information about the "children" alarms of the
# alarm you specify. These are the metric alarms and composite alarms
# referenced in the `AlarmRule` field of the composite alarm that you
# specify in `ChildrenOfAlarmName`. Information about the composite
# alarm that you name in `ChildrenOfAlarmName` is not returned.
#
# If you specify `ChildrenOfAlarmName`, you cannot specify any other
# parameters in the request except for `MaxRecords` and `NextToken`. If
# you do so, you receive a validation error.
#
# <note markdown="1"> Only the `Alarm Name`, `ARN`, `StateValue`
# (OK/ALARM/INSUFFICIENT\_DATA), and `StateUpdatedTimestamp` information
# are returned by this operation when you use this parameter. To get
# complete information about these alarms, perform another
# `DescribeAlarms` operation and specify the parent alarm names in the
# `AlarmNames` parameter.
#
# </note>
#
# @option params [String] :parents_of_alarm_name
# If you use this parameter and specify the name of a metric or
# composite alarm, the operation returns information about the
# "parent" alarms of the alarm you specify. These are the composite
# alarms that have `AlarmRule` parameters that reference the alarm named
# in `ParentsOfAlarmName`. Information about the alarm that you specify
# in `ParentsOfAlarmName` is not returned.
#
# If you specify `ParentsOfAlarmName`, you cannot specify any other
# parameters in the request except for `MaxRecords` and `NextToken`. If
# you do so, you receive a validation error.
#
# <note markdown="1"> Only the Alarm Name and ARN are returned by this operation when you
# use this parameter. To get complete information about these alarms,
# perform another `DescribeAlarms` operation and specify the parent
# alarm names in the `AlarmNames` parameter.
#
# </note>
#
# @option params [String] :state_value
# Specify this parameter to receive information only about alarms that
# are currently in the state that you specify.
#
# @option params [String] :action_prefix
# Use this parameter to filter the results of the operation to only
# those alarms that use a certain alarm action. For example, you could
# specify the ARN of an SNS topic to find all alarms that send
# notifications to that topic.
#
# @option params [Integer] :max_records
# The maximum number of alarm descriptions to retrieve.
#
# @option params [String] :next_token
# The token returned by a previous call to indicate that there is more
# data available.
#
# @return [Types::DescribeAlarmsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
#
# * {Types::DescribeAlarmsOutput#composite_alarms #composite_alarms} => Array<Types::CompositeAlarm>
# * {Types::DescribeAlarmsOutput#metric_alarms #metric_alarms} => Array<Types::MetricAlarm>
# * {Types::DescribeAlarmsOutput#next_token #next_token} => String
#
# The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
#
# @example Request syntax with placeholder values
#
# resp = client.describe_alarms({
# alarm_names: ["AlarmName"],
# alarm_name_prefix: "AlarmNamePrefix",
# alarm_types: ["CompositeAlarm"], # accepts CompositeAlarm, MetricAlarm
# children_of_alarm_name: "AlarmName",
# parents_of_alarm_name: "AlarmName",
# state_value: "OK", # accepts OK, ALARM, INSUFFICIENT_DATA
# action_prefix: "ActionPrefix",
# max_records: 1,
# next_token: "NextToken",
# })
#
# @example Response structure
#
# resp.composite_alarms #=> Array
# resp.composite_alarms[0].actions_enabled #=> Boolean
# resp.composite_alarms[0].alarm_actions #=> Array
# resp.composite_alarms[0].alarm_actions[0] #=> String
# resp.composite_alarms[0].alarm_arn #=> String
# resp.composite_alarms[0].alarm_configuration_updated_timestamp #=> Time
# resp.composite_alarms[0].alarm_description #=> String
# resp.composite_alarms[0].alarm_name #=> String
# resp.composite_alarms[0].alarm_rule #=> String
# resp.composite_alarms[0].insufficient_data_actions #=> Array
# resp.composite_alarms[0].insufficient_data_actions[0] #=> String
# resp.composite_alarms[0].ok_actions #=> Array
# resp.composite_alarms[0].ok_actions[0] #=> String
# resp.composite_alarms[0].state_reason #=> String
# resp.composite_alarms[0].state_reason_data #=> String
# resp.composite_alarms[0].state_updated_timestamp #=> Time
# resp.composite_alarms[0].state_value #=> String, one of "OK", "ALARM", "INSUFFICIENT_DATA"
# resp.composite_alarms[0].state_transitioned_timestamp #=> Time
# resp.composite_alarms[0].actions_suppressed_by #=> String, one of "WaitPeriod", "ExtensionPeriod", "Alarm"
# resp.composite_alarms[0].actions_suppressed_reason #=> String
# resp.composite_alarms[0].actions_suppressor #=> String
# resp.composite_alarms[0].actions_suppressor_wait_period #=> Integer
# resp.composite_alarms[0].actions_suppressor_extension_period #=> Integer
# resp.metric_alarms #=> Array
# resp.metric_alarms[0].alarm_name #=> String
# resp.metric_alarms[0].alarm_arn #=> String
# resp.metric_alarms[0].alarm_description #=> String
# resp.metric_alarms[0].alarm_configuration_updated_timestamp #=> Time
# resp.metric_alarms[0].actions_enabled #=> Boolean
# resp.metric_alarms[0].ok_actions #=> Array
# resp.metric_alarms[0].ok_actions[0] #=> String
# resp.metric_alarms[0].alarm_actions #=> Array
# resp.metric_alarms[0].alarm_actions[0] #=> String
# resp.metric_alarms[0].insufficient_data_actions #=> Array
# resp.metric_alarms[0].insufficient_data_actions[0] #=> String
# resp.metric_alarms[0].state_value #=> String, one of "OK", "ALARM", "INSUFFICIENT_DATA"
# resp.metric_alarms[0].state_reason #=> String
# resp.metric_alarms[0].state_reason_data #=> String
# resp.metric_alarms[0].state_updated_timestamp #=> Time
# resp.metric_alarms[0].metric_name #=> String
# resp.metric_alarms[0].namespace #=> String
# resp.metric_alarms[0].statistic #=> String, one of "SampleCount", "Average", "Sum", "Minimum", "Maximum"
# resp.metric_alarms[0].extended_statistic #=> String
# resp.metric_alarms[0].dimensions #=> Array
# resp.metric_alarms[0].dimensions[0].name #=> String
# resp.metric_alarms[0].dimensions[0].value #=> String
# resp.metric_alarms[0].period #=> Integer
# 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"
# resp.metric_alarms[0].evaluation_periods #=> Integer
# resp.metric_alarms[0].datapoints_to_alarm #=> Integer
# resp.metric_alarms[0].threshold #=> Float
# resp.metric_alarms[0].comparison_operator #=> String, one of "GreaterThanOrEqualToThreshold", "GreaterThanThreshold", "LessThanThreshold", "LessThanOrEqualToThreshold", "LessThanLowerOrGreaterThanUpperThreshold", "LessThanLowerThreshold", "GreaterThanUpperThreshold"
# resp.metric_alarms[0].treat_missing_data #=> String
# resp.metric_alarms[0].evaluate_low_sample_count_percentile #=> String
# resp.metric_alarms[0].metrics #=> Array
# resp.metric_alarms[0].metrics[0].id #=> String
# resp.metric_alarms[0].metrics[0].metric_stat.metric.namespace #=> String
# resp.metric_alarms[0].metrics[0].metric_stat.metric.metric_name #=> String
# resp.metric_alarms[0].metrics[0].metric_stat.metric.dimensions #=> Array
# resp.metric_alarms[0].metrics[0].metric_stat.metric.dimensions[0].name #=> String
# resp.metric_alarms[0].metrics[0].metric_stat.metric.dimensions[0].value #=> String
# resp.metric_alarms[0].metrics[0].metric_stat.period #=> Integer
# resp.metric_alarms[0].metrics[0].metric_stat.stat #=> String
# resp.metric_alarms[0].metrics[0].metric_stat.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"
# resp.metric_alarms[0].metrics[0].expression #=> String
# resp.metric_alarms[0].metrics[0].label #=> String
# resp.metric_alarms[0].metrics[0].return_data #=> Boolean
# resp.metric_alarms[0].metrics[0].period #=> Integer
# resp.metric_alarms[0].metrics[0].account_id #=> String
# resp.metric_alarms[0].threshold_metric_id #=> String
# resp.metric_alarms[0].evaluation_state #=> String, one of "PARTIAL_DATA"
# resp.metric_alarms[0].state_transitioned_timestamp #=> Time
# resp.next_token #=> String
#
#
# The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
#
# * alarm_exists
# * composite_alarm_exists
#
# @see http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeAlarms AWS API Documentation
#
# @overload describe_alarms(params = {})
# @param [Hash] params ({})
def describe_alarms(params = {}, options = {})
req = build_request(:describe_alarms, params)
req.send_request(options)
end
# Retrieves the alarms for the specified metric. To filter the results,
# specify a statistic, period, or unit.
#
# This operation retrieves only standard alarms that are based on the
# specified metric. It does not return alarms based on math expressions
# that use the specified metric, or composite alarms that use the
# specified metric.
#
# @option params [required, String] :metric_name
# The name of the metric.
#
# @option params [required, String] :namespace
# The namespace of the metric.
#
# @option params [String] :statistic
# The statistic for the metric, other than percentiles. For percentile
# statistics, use `ExtendedStatistics`.
#
# @option params [String] :extended_statistic
# The percentile statistic for the metric. Specify a value between p0.0
# and p100.
#
# @option params [Array<Types::Dimension>] :dimensions
# The dimensions associated with the metric. If the metric has any
# associated dimensions, you must specify them in order for the call to
# succeed.
#
# @option params [Integer] :period
# The period, in seconds, over which the statistic is applied.
#
# @option params [String] :unit