Class: AWS::CloudWatch

Inherits:
Object
  • Object
show all
Includes:
AWS::Core::ServiceInterface
Defined in:
lib/aws/cloud_watch.rb,
lib/aws/cloud_watch/alarm.rb,
lib/aws/cloud_watch/client.rb,
lib/aws/cloud_watch/errors.rb,
lib/aws/cloud_watch/metric.rb,
lib/aws/cloud_watch/request.rb,
lib/aws/cloud_watch/alarm_collection.rb,
lib/aws/cloud_watch/metric_collection.rb,
lib/aws/cloud_watch/metric_statistics.rb,
lib/aws/cloud_watch/alarm_history_item.rb,
lib/aws/cloud_watch/metric_alarm_collection.rb,
lib/aws/cloud_watch/alarm_history_item_collection.rb

Defined Under Namespace

Modules: Errors Classes: Alarm, AlarmCollection, AlarmHistoryItem, AlarmHistoryItemCollection, Client, Metric, MetricAlarmCollection, MetricCollection, MetricStatistics

Instance Method Summary collapse

Methods included from AWS::Core::ServiceInterface

#initialize, #inspect

Instance Method Details

#alarm_history_itemsAlarmHistoryItemCollection



65
66
67
# File 'lib/aws/cloud_watch.rb', line 65

def alarm_history_items
  AlarmHistoryItemCollection.new(:config => config)
end

#alarmsAlarmCollection

Returns:



60
61
62
# File 'lib/aws/cloud_watch.rb', line 60

def alarms
  AlarmCollection.new(:config => config)
end

#metrics(options = {}) ⇒ MetricCollection

Returns:



70
71
72
# File 'lib/aws/cloud_watch.rb', line 70

def metrics options = {}
  MetricCollection.new(options.merge(:config => config))
end

#put_metric_data(options = {}) ⇒ nil

Puts data for a metric. The metric is created if it does not already exist.

cw.put_metric_data(
  :namespace => 'test/cli',
  :metric_data => [
    { :metric_name => 'sample', :value => 1 },
    { :metric_name => 'sample', :value => 2 },
    { :metric_name => 'sample', :value => 3 },
    { :metric_name => 'sample', :value => 4 },
    { :metric_name => 'sample', :value => 5 },
  ]
)

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (nil)

See Also:



54
55
56
57
# File 'lib/aws/cloud_watch.rb', line 54

def put_metric_data options = {}
  client.put_metric_data(options)
  nil
end