Class Fog::AWS::CloudWatch::Real
In: lib/fog/aws/cloud_watch.rb
lib/fog/aws/requests/cloud_watch/describe_alarm_history.rb
lib/fog/aws/requests/cloud_watch/put_metric_alarm.rb
lib/fog/aws/requests/cloud_watch/put_metric_data.rb
lib/fog/aws/requests/cloud_watch/get_metric_statistics.rb
lib/fog/aws/requests/cloud_watch/disable_alarm_actions.rb
lib/fog/aws/requests/cloud_watch/set_alarm_state.rb
lib/fog/aws/requests/cloud_watch/delete_alarms.rb
lib/fog/aws/requests/cloud_watch/list_metrics.rb
lib/fog/aws/requests/cloud_watch/describe_alarms_for_metric.rb
lib/fog/aws/requests/cloud_watch/enable_alarm_actions.rb
lib/fog/aws/requests/cloud_watch/describe_alarms.rb
Parent: Object

Methods

Included Modules

Fog::AWS::CredentialFetcher::ConnectionMethods

Public Class methods

Initialize connection to Cloudwatch

Notes

options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection

Examples

  elb = CloudWatch.new(
   :aws_access_key_id => your_aws_access_key_id,
   :aws_secret_access_key => your_aws_secret_access_key
  )

Parameters

  • options<~Hash> - config arguments for connection. Defaults to {}.
    • region<~String> - optional region to use. For instance, ‘eu-west-1’, ‘us-east-1’, etc.

Returns

Public Instance methods

Delete a list of alarms

Options

  • AlarmNames<~Array>: A list of alarms to be deleted

Returns

  • response<~Excon::Response>:

See Also

docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/index.html?API_DeleteAlarms.html

Retrieves history for the specified alarm

Options

  • AlarmName<~String>: The name of the alarm
  • EndDate<~DateTime>: The ending date to retrieve alarm history
  • HistoryItemType<~String>: The type of alarm histories to retrieve
  • MaxRecords<~Integer>: The maximum number of alarm history records to retrieve
  • NextToken<~String> The token returned by a previous call to indicate that there is more data available
  • StartData<~DateTime>: The starting date to retrieve alarm history

Returns

  • response<~Excon::Response>:

See Also

docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/index.html?API_DescribeAlarmHistory.html

Retrieves alarms with the specified names

Options

  • ActionPrefix<~String>: The action name prefix
  • AlarmNamePrefix<~String>: The alarm name prefix.
          AlarmNames cannot be specified if this parameter is specified
    
  • AlarmNames<~Array>: A list of alarm names to retrieve information for.
  • MaxRecords<~Integer>: The maximum number of alarm descriptions to retrieve
  • NextToken<~String>: The token returned by a previous call to indicate that there is more data available
  • NextToken<~String> The token returned by a previous call to indicate that there is more data available
  • StateValue<~String>: The state value to be used in matching alarms

Returns

  • response<~Excon::Response>:

See Also

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

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

Disables actions for the specified alarms

Options

  • AlarmNames<~Array>: The names of the alarms to disable actions for

Returns

  • response<~Excon::Response>:

See Also

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

Enables actions for the specified alarms

Options

  • AlarmNames<~Array>: The names of the alarms to enable actions for

Returns

  • response<~Excon::Response>:

See Also

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

Fetch datapoints for a metric. At most 1440 datapoints will be returned, the most datapoints that can be queried is 50850 StartTime is capped to 2 weeks ago

Options

  • Namespace<~String>: the namespace of the metric
  • MetricName<~String>: the name of the metric
  • StartTime<~Datetime>: when to start fetching datapoints from (inclusive)
  • EndTime<~Datetime>: used to determine the last datapoint to fetch (exclusive)
  • Period<~Integer>: Granularity, in seconds of the returned datapoints. Must be a multiple of 60, and at least 60
  • Statistics<~Array>: An array of up to 5 strings, which name the statistics to return
  • Unit<~String>: The unit for the metric
  • Dimensions<~Array>: a list of dimensions to filter against (optional)
      Name : The name of the dimension
      Value : The value to filter against
    

Returns

  • response<~Excon::Response>:

See Also

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

List availabe metrics

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 to filter against
  • Namespace<~String>: The namespace to filter against
  • NextToken<~String> The token returned by a previous call to indicate that there is more data available

Returns

  • response<~Excon::Response>:

See Also

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

Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric

Options

  • ActionsEnabled<~Boolean>: Indicates whether or not actions should be executed during any changes to the alarm‘s state
  • AlarmActions<~Array>: A list of actions to execute
  • AlarmDescription<~String>: The description for the alarm
  • AlarmName<~String> The unique name for the alarm
  • ComparisonOperator<~String>: The arithmetic operation to use for comparison
  • Dimensions<~Array>: a list of dimensions to filter against,
      Name : The name of the dimension
      Value : The value to filter against
    
  • EvaluationPeriods<~Integer>: The number of periods over which data is compared to the specified threshold
  • InsufficientDataActions<~Array>: A list of actions to execute
  • MetricName<~String>: The name for the alarm‘s associated metric
  • Namespace<~String>: The namespace for the alarm‘s associated metric
  • OKActions<~Array>: A list of actions to execute
  • Period<~Integer>: The period in seconds over which the specified statistic is applied
  • Statistic<~String>: The statistic to apply to the alarm‘s associated metric
  • Threshold<~Double>: The value against which the specified statistic is compared
  • Unit<~String>: The unit for the alarm‘s associated metric

Returns

  • response<~Excon::Response>:

See Also

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

Publishes one or more data points to CloudWatch. A new metric is created if necessary

Options

  • Namespace<~String>: the namespace of the metric data
  • MetricData<~Array>: the datapoints to publish of the metric
      * MetricName<~String>: the name of the metric
      * Timestamp<~String>: the timestamp for the data point. If omitted defaults to the time at which the data is received by CloudWatch
      * Unit<~String>: the unit
      * Value<~Double> the value for the metric
      * StatisticValues<~Hash>:
          * Maximum<~Double>: the maximum value of the sample set
          * Sum<~Double>: the sum of the values of the sample set
          * SampleCount<~Double>: the number of samples used for the statistic set
          * Minimum<~Double>: the minimum value of the sample set
      * Dimensions<~Array>: the dimensions for the metric. From 0 to 10 may be included
           * Name<~String>
          * Value<~String>
    

Returns

  • response<~Excon::Response>:

See Also

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

Temporarily sets the state of an alarm

Options

  • AlarmName<~String>: The names of the alarm
  • StateReason<~String>: The reason that this alarm is set to this specific state (in human-readable text format)
  • StateReasonData<~String>: The reason that this alarm is set to this specific state (in machine-readable JSON format)
  • StateValue<~String>: The value of the state

Returns

  • response<~Excon::Response>:

See Also

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

[Validate]