Parent

Methods

Class/Module Index [+]

Quicksearch

Fog::AWS::CloudWatch::MetricStatistic

Public Instance Methods

save() click to toggle source
# File lib/fog/aws/models/cloud_watch/metric_statistic.rb, line 21
def save
  requires :metric_name
  requires :namespace
  requires :unit

  put_opts = {'MetricName' => metric_name, 'Unit' => unit}
  put_opts.merge!('Dimensions' => dimensions) if dimensions
  if value
    put_opts.merge!('Value' => value)
  else
    put_opts.merge!('StatisticValues' => {
      'Minimum' => minimum,
      'Maximum' => maximum,
      'Sum' => sum,
      'Average' => average,
      'SampleCount' => sample_count
    })
  end
  service.put_metric_data(namespace, [put_opts])
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.