Method: Fog::AWS::CloudWatch::Real#describe_alarms_for_metric

Defined in:
lib/fog/aws/requests/cloud_watch/describe_alarms_for_metric.rb

#describe_alarms_for_metric(options) ⇒ Object

Retrieves all alarms for a single metric

Options

  • Dimensions<~Array>: a list of dimensions to filter against

    Name : The name of the dimension
    Value : The value to filter against
    
  • MetricName<~String>: The name of the metric

  • Namespace<~String>: The namespace of the metric

  • Period<~Integer>: The period in seconds over which the statistic is applied

  • Statistics<~String>: The statistic for the metric

  • Unit<~String> The unit for the metric

Returns

  • response<~Excon::Response>:

See Also

docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html


26
27
28
29
30
31
32
33
34
35
# File 'lib/fog/aws/requests/cloud_watch/describe_alarms_for_metric.rb', line 26

def describe_alarms_for_metric(options)
  if dimensions = options.delete('Dimensions')
    options.merge!(AWS.indexed_param('Dimensions.member.%d.Name', dimensions.collect {|dimension| dimension['Name']}))
    options.merge!(AWS.indexed_param('Dimensions.member.%d.Value', dimensions.collect {|dimension| dimension['Value']}))
  end
  request({
      'Action'    => 'DescribeAlarmsForMetric',
      :parser     => Fog::Parsers::AWS::CloudWatch::DescribeAlarmsForMetric.new
    }.merge(options))
end