aws-sdk-cloudwatch 1.59.0 → 1.81.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,10 +63,12 @@ module Aws::CloudWatch
63
63
  #
64
64
  # @return [self]
65
65
  def load
66
- resp = @client.list_metrics(
66
+ resp = Aws::Plugins::UserAgent.feature('resource') do
67
+ @client.list_metrics(
67
68
  metric_name: @name,
68
69
  namespace: @namespace
69
70
  )
71
+ end
70
72
  @data = resp.metrics[0]
71
73
  self
72
74
  end
@@ -181,7 +183,9 @@ module Aws::CloudWatch
181
183
  :retry
182
184
  end
183
185
  end
184
- Aws::Waiters::Waiter.new(options).wait({})
186
+ Aws::Plugins::UserAgent.feature('resource') do
187
+ Aws::Waiters::Waiter.new(options).wait({})
188
+ end
185
189
  end
186
190
 
187
191
  # @!group Actions
@@ -300,7 +304,9 @@ module Aws::CloudWatch
300
304
  namespace: @namespace,
301
305
  metric_name: @name
302
306
  )
303
- resp = @client.get_metric_statistics(options)
307
+ resp = Aws::Plugins::UserAgent.feature('resource') do
308
+ @client.get_metric_statistics(options)
309
+ end
304
310
  resp.data
305
311
  end
306
312
 
@@ -365,6 +371,9 @@ module Aws::CloudWatch
365
371
  # @param [Hash] options ({})
366
372
  # @option options [required, String] :alarm_name
367
373
  # The name for the alarm. This name must be unique within the Region.
374
+ #
375
+ # The name must contain only UTF-8 characters, and can't contain ASCII
376
+ # control characters
368
377
  # @option options [String] :alarm_description
369
378
  # The description for the alarm.
370
379
  # @option options [Boolean] :actions_enabled
@@ -373,75 +382,172 @@ module Aws::CloudWatch
373
382
  # @option options [Array<String>] :ok_actions
374
383
  # The actions to execute when this alarm transitions to an `OK` state
375
384
  # from any other state. Each action is specified as an Amazon Resource
376
- # Name (ARN).
377
- #
378
- # Valid Values: `arn:aws:automate:region:ec2:stop` \|
379
- # `arn:aws:automate:region:ec2:terminate` \|
380
- # `arn:aws:automate:region:ec2:recover` \|
381
- # `arn:aws:automate:region:ec2:reboot` \|
382
- # `arn:aws:sns:region:account-id:sns-topic-name ` \|
383
- # `arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
384
- # `
385
- #
386
- # Valid Values (for use with IAM roles):
387
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0`
388
- # \|
389
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0`
390
- # \|
391
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0`
392
- # \|
393
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0`
385
+ # Name (ARN). Valid values:
386
+ #
387
+ # **EC2 actions:**
388
+ #
389
+ # * `arn:aws:automate:region:ec2:stop`
390
+ #
391
+ # * `arn:aws:automate:region:ec2:terminate`
392
+ #
393
+ # * `arn:aws:automate:region:ec2:reboot`
394
+ #
395
+ # * `arn:aws:automate:region:ec2:recover`
396
+ #
397
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0`
398
+ #
399
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0`
400
+ #
401
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0`
402
+ #
403
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0`
404
+ #
405
+ # **Autoscaling action:**
406
+ #
407
+ # * `arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
408
+ # `
409
+ #
410
+ # ^
411
+ #
412
+ # **SNS notification action:**
413
+ #
414
+ # * `arn:aws:sns:region:account-id:sns-topic-name:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
415
+ # `
416
+ #
417
+ # ^
418
+ #
419
+ # **SSM integration actions:**
420
+ #
421
+ # * `arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
422
+ # `
423
+ #
424
+ # * `arn:aws:ssm-incidents::account-id:responseplan/response-plan-name `
394
425
  # @option options [Array<String>] :alarm_actions
395
426
  # The actions to execute when this alarm transitions to the `ALARM`
396
427
  # state from any other state. Each action is specified as an Amazon
397
- # Resource Name (ARN).
398
- #
399
- # Valid Values: `arn:aws:automate:region:ec2:stop` \|
400
- # `arn:aws:automate:region:ec2:terminate` \|
401
- # `arn:aws:automate:region:ec2:recover` \|
402
- # `arn:aws:automate:region:ec2:reboot` \|
403
- # `arn:aws:sns:region:account-id:sns-topic-name ` \|
404
- # `arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
405
- # ` \| `arn:aws:ssm:region:account-id:opsitem:severity ` \|
406
- # `arn:aws:ssm-incidents::account-id:response-plan:response-plan-name `
407
- #
408
- # Valid Values (for use with IAM roles):
409
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0`
410
- # \|
411
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0`
412
- # \|
413
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0`
414
- # \|
415
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0`
428
+ # Resource Name (ARN). Valid values:
429
+ #
430
+ # **EC2 actions:**
431
+ #
432
+ # * `arn:aws:automate:region:ec2:stop`
433
+ #
434
+ # * `arn:aws:automate:region:ec2:terminate`
435
+ #
436
+ # * `arn:aws:automate:region:ec2:reboot`
437
+ #
438
+ # * `arn:aws:automate:region:ec2:recover`
439
+ #
440
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0`
441
+ #
442
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0`
443
+ #
444
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0`
445
+ #
446
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0`
447
+ #
448
+ # **Autoscaling action:**
449
+ #
450
+ # * `arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
451
+ # `
452
+ #
453
+ # ^
454
+ #
455
+ # **SNS notification action:**
456
+ #
457
+ # * `arn:aws:sns:region:account-id:sns-topic-name:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
458
+ # `
459
+ #
460
+ # ^
461
+ #
462
+ # **SSM integration actions:**
463
+ #
464
+ # * `arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
465
+ # `
466
+ #
467
+ # * `arn:aws:ssm-incidents::account-id:responseplan/response-plan-name `
416
468
  # @option options [Array<String>] :insufficient_data_actions
417
469
  # The actions to execute when this alarm transitions to the
418
470
  # `INSUFFICIENT_DATA` state from any other state. Each action is
419
- # specified as an Amazon Resource Name (ARN).
420
- #
421
- # Valid Values: `arn:aws:automate:region:ec2:stop` \|
422
- # `arn:aws:automate:region:ec2:terminate` \|
423
- # `arn:aws:automate:region:ec2:recover` \|
424
- # `arn:aws:automate:region:ec2:reboot` \|
425
- # `arn:aws:sns:region:account-id:sns-topic-name ` \|
426
- # `arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
427
- # `
428
- #
429
- # Valid Values (for use with IAM roles):
430
- # `>arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0`
431
- # \|
432
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0`
433
- # \|
434
- # `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0`
471
+ # specified as an Amazon Resource Name (ARN). Valid values:
472
+ #
473
+ # **EC2 actions:**
474
+ #
475
+ # * `arn:aws:automate:region:ec2:stop`
476
+ #
477
+ # * `arn:aws:automate:region:ec2:terminate`
478
+ #
479
+ # * `arn:aws:automate:region:ec2:reboot`
480
+ #
481
+ # * `arn:aws:automate:region:ec2:recover`
482
+ #
483
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0`
484
+ #
485
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0`
486
+ #
487
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0`
488
+ #
489
+ # * `arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0`
490
+ #
491
+ # **Autoscaling action:**
492
+ #
493
+ # * `arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
494
+ # `
495
+ #
496
+ # ^
497
+ #
498
+ # **SNS notification action:**
499
+ #
500
+ # * `arn:aws:sns:region:account-id:sns-topic-name:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name
501
+ # `
502
+ #
503
+ # ^
504
+ #
505
+ # **SSM integration actions:**
506
+ #
507
+ # * `arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name
508
+ # `
509
+ #
510
+ # * `arn:aws:ssm-incidents::account-id:responseplan/response-plan-name `
435
511
  # @option options [String] :statistic
436
512
  # The statistic for the metric specified in `MetricName`, other than
437
513
  # percentile. For percentile statistics, use `ExtendedStatistic`. When
438
514
  # you call `PutMetricAlarm` and specify a `MetricName`, you must specify
439
515
  # either `Statistic` or `ExtendedStatistic,` but not both.
440
516
  # @option options [String] :extended_statistic
441
- # The percentile statistic for the metric specified in `MetricName`.
442
- # Specify a value between p0.0 and p100. When you call `PutMetricAlarm`
443
- # and specify a `MetricName`, you must specify either `Statistic` or
444
- # `ExtendedStatistic,` but not both.
517
+ # The extended statistic for the metric specified in `MetricName`. When
518
+ # you call `PutMetricAlarm` and specify a `MetricName`, you must specify
519
+ # either `Statistic` or `ExtendedStatistic` but not both.
520
+ #
521
+ # If you specify `ExtendedStatistic`, the following are valid values:
522
+ #
523
+ # * `p90`
524
+ #
525
+ # * `tm90`
526
+ #
527
+ # * `tc90`
528
+ #
529
+ # * `ts90`
530
+ #
531
+ # * `wm90`
532
+ #
533
+ # * `IQM`
534
+ #
535
+ # * `PR(n:m)` where n and m are values of the metric
536
+ #
537
+ # * `TC(X%:X%)` where X is between 10 and 90 inclusive.
538
+ #
539
+ # * `TM(X%:X%)` where X is between 10 and 90 inclusive.
540
+ #
541
+ # * `TS(X%:X%)` where X is between 10 and 90 inclusive.
542
+ #
543
+ # * `WM(X%:X%)` where X is between 10 and 90 inclusive.
544
+ #
545
+ # For more information about these extended statistics, see [CloudWatch
546
+ # statistics definitions][1].
547
+ #
548
+ #
549
+ #
550
+ # [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html
445
551
  # @option options [Array<Types::Dimension>] :dimensions
446
552
  # The dimensions for the metric specified in `MetricName`.
447
553
  # @option options [Integer] :period
@@ -486,7 +592,7 @@ module Aws::CloudWatch
486
592
  #
487
593
  # However, if the metric is published with multiple types of units and
488
594
  # you don't specify a unit, the alarm's behavior is not defined and it
489
- # behaves predictably.
595
+ # behaves unpredictably.
490
596
  #
491
597
  # We recommend omitting `Unit` so that you don't inadvertently specify
492
598
  # an incorrect unit that is not published for this metric. Doing so
@@ -531,6 +637,13 @@ module Aws::CloudWatch
531
637
  #
532
638
  # Valid Values: `breaching | notBreaching | ignore | missing`
533
639
  #
640
+ # <note markdown="1"> Alarms that evaluate metrics in the `AWS/DynamoDB` namespace always
641
+ # `ignore` missing data even if you choose a different option for
642
+ # `TreatMissingData`. When an `AWS/DynamoDB` metric has missing data,
643
+ # alarms that evaluate that metric remain in their current state.
644
+ #
645
+ # </note>
646
+ #
534
647
  #
535
648
  #
536
649
  # [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data
@@ -573,7 +686,9 @@ module Aws::CloudWatch
573
686
  # [1]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html
574
687
  # @option options [Array<Types::Tag>] :tags
575
688
  # A list of key-value pairs to associate with the alarm. You can
576
- # associate as many as 50 tags with an alarm.
689
+ # associate as many as 50 tags with an alarm. To be able to associate
690
+ # tags with the alarm when you create the alarm, you must have the
691
+ # `cloudwatch:TagResource` permission.
577
692
  #
578
693
  # Tags can help you organize and categorize your resources. You can also
579
694
  # use them to scope user permissions by granting a user permission to
@@ -602,7 +717,9 @@ module Aws::CloudWatch
602
717
  namespace: @namespace,
603
718
  metric_name: @name
604
719
  )
605
- @client.put_metric_alarm(options)
720
+ Aws::Plugins::UserAgent.feature('resource') do
721
+ @client.put_metric_alarm(options)
722
+ end
606
723
  Alarm.new(
607
724
  name: options[:alarm_name],
608
725
  client: @client
@@ -638,15 +755,17 @@ module Aws::CloudWatch
638
755
  # })
639
756
  # @param [Hash] options ({})
640
757
  # @option options [required, Array<Types::MetricDatum>] :metric_data
641
- # The data for the metric. The array can include no more than 20 metrics
642
- # per call.
758
+ # The data for the metric. The array can include no more than 1000
759
+ # metrics per call.
643
760
  # @return [EmptyStructure]
644
761
  def put_data(options = {})
645
762
  options = Aws::Util.deep_merge(options,
646
763
  namespace: @namespace,
647
764
  metric_data: [{ metric_name: @name }]
648
765
  )
649
- resp = @client.put_metric_data(options)
766
+ resp = Aws::Plugins::UserAgent.feature('resource') do
767
+ @client.put_metric_data(options)
768
+ end
650
769
  resp.data
651
770
  end
652
771
 
@@ -689,7 +808,9 @@ module Aws::CloudWatch
689
808
  namespace: @namespace,
690
809
  metric_name: @name
691
810
  )
692
- resp = @client.describe_alarms_for_metric(options)
811
+ resp = Aws::Plugins::UserAgent.feature('resource') do
812
+ @client.describe_alarms_for_metric(options)
813
+ end
693
814
  resp.data.metric_alarms.each do |m|
694
815
  batch << Alarm.new(
695
816
  name: m.alarm_name,
@@ -0,0 +1,144 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::CloudWatch
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::CloudWatch::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::CloudWatch::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::CloudWatch::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :delete_alarms
60
+ Aws::CloudWatch::Endpoints::DeleteAlarms.build(context)
61
+ when :delete_anomaly_detector
62
+ Aws::CloudWatch::Endpoints::DeleteAnomalyDetector.build(context)
63
+ when :delete_dashboards
64
+ Aws::CloudWatch::Endpoints::DeleteDashboards.build(context)
65
+ when :delete_insight_rules
66
+ Aws::CloudWatch::Endpoints::DeleteInsightRules.build(context)
67
+ when :delete_metric_stream
68
+ Aws::CloudWatch::Endpoints::DeleteMetricStream.build(context)
69
+ when :describe_alarm_history
70
+ Aws::CloudWatch::Endpoints::DescribeAlarmHistory.build(context)
71
+ when :describe_alarms
72
+ Aws::CloudWatch::Endpoints::DescribeAlarms.build(context)
73
+ when :describe_alarms_for_metric
74
+ Aws::CloudWatch::Endpoints::DescribeAlarmsForMetric.build(context)
75
+ when :describe_anomaly_detectors
76
+ Aws::CloudWatch::Endpoints::DescribeAnomalyDetectors.build(context)
77
+ when :describe_insight_rules
78
+ Aws::CloudWatch::Endpoints::DescribeInsightRules.build(context)
79
+ when :disable_alarm_actions
80
+ Aws::CloudWatch::Endpoints::DisableAlarmActions.build(context)
81
+ when :disable_insight_rules
82
+ Aws::CloudWatch::Endpoints::DisableInsightRules.build(context)
83
+ when :enable_alarm_actions
84
+ Aws::CloudWatch::Endpoints::EnableAlarmActions.build(context)
85
+ when :enable_insight_rules
86
+ Aws::CloudWatch::Endpoints::EnableInsightRules.build(context)
87
+ when :get_dashboard
88
+ Aws::CloudWatch::Endpoints::GetDashboard.build(context)
89
+ when :get_insight_rule_report
90
+ Aws::CloudWatch::Endpoints::GetInsightRuleReport.build(context)
91
+ when :get_metric_data
92
+ Aws::CloudWatch::Endpoints::GetMetricData.build(context)
93
+ when :get_metric_statistics
94
+ Aws::CloudWatch::Endpoints::GetMetricStatistics.build(context)
95
+ when :get_metric_stream
96
+ Aws::CloudWatch::Endpoints::GetMetricStream.build(context)
97
+ when :get_metric_widget_image
98
+ Aws::CloudWatch::Endpoints::GetMetricWidgetImage.build(context)
99
+ when :list_dashboards
100
+ Aws::CloudWatch::Endpoints::ListDashboards.build(context)
101
+ when :list_managed_insight_rules
102
+ Aws::CloudWatch::Endpoints::ListManagedInsightRules.build(context)
103
+ when :list_metric_streams
104
+ Aws::CloudWatch::Endpoints::ListMetricStreams.build(context)
105
+ when :list_metrics
106
+ Aws::CloudWatch::Endpoints::ListMetrics.build(context)
107
+ when :list_tags_for_resource
108
+ Aws::CloudWatch::Endpoints::ListTagsForResource.build(context)
109
+ when :put_anomaly_detector
110
+ Aws::CloudWatch::Endpoints::PutAnomalyDetector.build(context)
111
+ when :put_composite_alarm
112
+ Aws::CloudWatch::Endpoints::PutCompositeAlarm.build(context)
113
+ when :put_dashboard
114
+ Aws::CloudWatch::Endpoints::PutDashboard.build(context)
115
+ when :put_insight_rule
116
+ Aws::CloudWatch::Endpoints::PutInsightRule.build(context)
117
+ when :put_managed_insight_rules
118
+ Aws::CloudWatch::Endpoints::PutManagedInsightRules.build(context)
119
+ when :put_metric_alarm
120
+ Aws::CloudWatch::Endpoints::PutMetricAlarm.build(context)
121
+ when :put_metric_data
122
+ Aws::CloudWatch::Endpoints::PutMetricData.build(context)
123
+ when :put_metric_stream
124
+ Aws::CloudWatch::Endpoints::PutMetricStream.build(context)
125
+ when :set_alarm_state
126
+ Aws::CloudWatch::Endpoints::SetAlarmState.build(context)
127
+ when :start_metric_streams
128
+ Aws::CloudWatch::Endpoints::StartMetricStreams.build(context)
129
+ when :stop_metric_streams
130
+ Aws::CloudWatch::Endpoints::StopMetricStreams.build(context)
131
+ when :tag_resource
132
+ Aws::CloudWatch::Endpoints::TagResource.build(context)
133
+ when :untag_resource
134
+ Aws::CloudWatch::Endpoints::UntagResource.build(context)
135
+ end
136
+ end
137
+ end
138
+
139
+ def add_handlers(handlers, _config)
140
+ handlers.add(Handler, step: :build, priority: 75)
141
+ end
142
+ end
143
+ end
144
+ end
@@ -67,7 +67,15 @@ module Aws::CloudWatch
67
67
  # @option options [Array<String>] :alarm_types
68
68
  # Use this parameter to specify whether you want the operation to return
69
69
  # metric alarms or composite alarms. If you omit this parameter, only
70
- # metric alarms are returned.
70
+ # metric alarms are returned, even if composite alarms exist in the
71
+ # account.
72
+ #
73
+ # For example, if you omit this parameter or specify `MetricAlarms`, the
74
+ # operation returns only a list of metric alarms. It does not return any
75
+ # composite alarms, even if composite alarms exist in the account.
76
+ #
77
+ # If you specify `CompositeAlarms`, the operation returns only a list of
78
+ # composite alarms, and does not return any metric alarms.
71
79
  # @option options [String] :children_of_alarm_name
72
80
  # If you use this parameter and specify the name of a composite alarm,
73
81
  # the operation returns information about the "children" alarms of the
@@ -117,7 +125,9 @@ module Aws::CloudWatch
117
125
  # @return [Alarm::Collection]
118
126
  def alarms(options = {})
119
127
  batches = Enumerator.new do |y|
120
- resp = @client.describe_alarms(options)
128
+ resp = Aws::Plugins::UserAgent.feature('resource') do
129
+ @client.describe_alarms(options)
130
+ end
121
131
  resp.each_page do |page|
122
132
  batch = []
123
133
  page.data.metric_alarms.each do |m|
@@ -165,7 +175,15 @@ module Aws::CloudWatch
165
175
  # @option options [Array<String>] :alarm_types
166
176
  # Use this parameter to specify whether you want the operation to return
167
177
  # metric alarms or composite alarms. If you omit this parameter, only
168
- # metric alarms are returned.
178
+ # metric alarms are returned, even if composite alarms exist in the
179
+ # account.
180
+ #
181
+ # For example, if you omit this parameter or specify `MetricAlarms`, the
182
+ # operation returns only a list of metric alarms. It does not return any
183
+ # composite alarms, even if composite alarms exist in the account.
184
+ #
185
+ # If you specify `CompositeAlarms`, the operation returns only a list of
186
+ # composite alarms, and does not return any metric alarms.
169
187
  # @option options [String] :children_of_alarm_name
170
188
  # If you use this parameter and specify the name of a composite alarm,
171
189
  # the operation returns information about the "children" alarms of the
@@ -215,7 +233,9 @@ module Aws::CloudWatch
215
233
  # @return [CompositeAlarm::Collection]
216
234
  def composite_alarms(options = {})
217
235
  batches = Enumerator.new do |y|
218
- resp = @client.describe_alarms(options)
236
+ resp = Aws::Plugins::UserAgent.feature('resource') do
237
+ @client.describe_alarms(options)
238
+ end
219
239
  resp.each_page do |page|
220
240
  batch = []
221
241
  page.data.composite_alarms.each do |c|
@@ -254,6 +274,8 @@ module Aws::CloudWatch
254
274
  # },
255
275
  # ],
256
276
  # recently_active: "PT3H", # accepts PT3H
277
+ # include_linked_accounts: false,
278
+ # owning_account: "AccountId",
257
279
  # })
258
280
  # @param [Hash] options ({})
259
281
  # @option options [String] :namespace
@@ -274,10 +296,22 @@ module Aws::CloudWatch
274
296
  # specify. There is a low probability that the returned results include
275
297
  # metrics with last published data as much as 40 minutes more than the
276
298
  # specified time interval.
299
+ # @option options [Boolean] :include_linked_accounts
300
+ # If you are using this operation in a monitoring account, specify
301
+ # `true` to include metrics from source accounts in the returned data.
302
+ #
303
+ # The default is `false`.
304
+ # @option options [String] :owning_account
305
+ # When you use this operation in a monitoring account, use this field to
306
+ # return metrics only from one source account. To do so, specify that
307
+ # source account ID in this field, and also specify `true` for
308
+ # `IncludeLinkedAccounts`.
277
309
  # @return [Metric::Collection]
278
310
  def metrics(options = {})
279
311
  batches = Enumerator.new do |y|
280
- resp = @client.list_metrics(options)
312
+ resp = Aws::Plugins::UserAgent.feature('resource') do
313
+ @client.list_metrics(options)
314
+ end
281
315
  resp.each_page do |page|
282
316
  batch = []
283
317
  page.data.metrics.each do |m|