lib/aws-sdk-cloudwatch/metric.rb in aws-sdk-cloudwatch-1.73.0 vs lib/aws-sdk-cloudwatch/metric.rb in aws-sdk-cloudwatch-1.74.0

- old
+ new

@@ -61,14 +61,16 @@ # # metric.reload.data # # @return [self] def load - resp = @client.list_metrics( + resp = Aws::Plugins::UserAgent.feature('resource') do + @client.list_metrics( metric_name: @name, namespace: @namespace ) + end @data = resp.metrics[0] self end alias :reload :load @@ -179,11 +181,13 @@ else self_copy.reload unless attempts == options[:max_attempts] :retry end end - Aws::Waiters::Waiter.new(options).wait({}) + Aws::Plugins::UserAgent.feature('resource') do + Aws::Waiters::Waiter.new(options).wait({}) + end end # @!group Actions # @example Request syntax with placeholder values @@ -298,11 +302,13 @@ def get_statistics(options = {}) options = options.merge( namespace: @namespace, metric_name: @name ) - resp = @client.get_metric_statistics(options) + resp = Aws::Plugins::UserAgent.feature('resource') do + @client.get_metric_statistics(options) + end resp.data end # @example Request syntax with placeholder values # @@ -677,11 +683,13 @@ def put_alarm(options = {}) options = options.merge( namespace: @namespace, metric_name: @name ) - @client.put_metric_alarm(options) + Aws::Plugins::UserAgent.feature('resource') do + @client.put_metric_alarm(options) + end Alarm.new( name: options[:alarm_name], client: @client ) end @@ -721,11 +729,13 @@ def put_data(options = {}) options = Aws::Util.deep_merge(options, namespace: @namespace, metric_data: [{ metric_name: @name }] ) - resp = @client.put_metric_data(options) + resp = Aws::Plugins::UserAgent.feature('resource') do + @client.put_metric_data(options) + end resp.data end # @!group Associations @@ -764,10 +774,12 @@ batch = [] options = options.merge( namespace: @namespace, metric_name: @name ) - resp = @client.describe_alarms_for_metric(options) + resp = Aws::Plugins::UserAgent.feature('resource') do + @client.describe_alarms_for_metric(options) + end resp.data.metric_alarms.each do |m| batch << Alarm.new( name: m.alarm_name, data: m, client: @client