You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: AWS::CloudWatch::Client

Inherits:
AWS::Core::QueryClient show all
Defined in:
lib/aws/cloud_watch/client.rb

Overview

Client class for Cloud Watch

Direct Known Subclasses

V20100801

Defined Under Namespace

Classes: V20100801

Constant Summary

API_VERSION =
'2010-08-01'

Instance Attribute Summary

Attributes inherited from AWS::Core::Client

#config

Instance Method Summary collapse

Methods inherited from AWS::Core::Client

#initialize, #log_warning, #operations, #with_http_handler, #with_options

Constructor Details

This class inherits a constructor from AWS::Core::Client

Instance Method Details

#delete_alarms(options = {}) ⇒ Core::Response

Calls the DeleteAlarms API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :alarm_names - required - (Array<) A list of alarms to be deleted.

Returns:

#describe_alarm_history(options = {}) ⇒ Core::Response

Calls the DescribeAlarmHistory API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :alarm_name - (String) The name of the alarm.
    • :history_item_type - (String) The type of alarm histories to retrieve. Valid values include:
      • ConfigurationUpdate
      • StateUpdate
      • Action
    • :start_date - (String<) The starting date to retrieve alarm history.
    • :end_date - (String<) The ending date to retrieve alarm history.
    • :max_records - (Integer) The maximum number of alarm history records to retrieve.
    • :next_token - (String) The token returned by a previous call to indicate that there is more data available.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :alarm_history_items - (Array)
      • :alarm_name - (String)
      • :timestamp - (Time)
      • :history_item_type - (String)
      • :history_summary - (String)
      • :history_data - (String)
    • :next_token - (String)

#describe_alarms(options = {}) ⇒ Core::Response

Calls the DescribeAlarms API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :alarm_names - (Array<) A list of alarm names to retrieve information for.
    • :alarm_name_prefix - (String) The alarm name prefix. AlarmNames cannot be specified if this parameter is specified.
    • :state_value - (String) The state value to be used in matching alarms. Valid values include:
      • OK
      • ALARM
      • INSUFFICIENT_DATA
    • :action_prefix - (String) The action name prefix.
    • :max_records - (Integer) The maximum number of alarm descriptions to retrieve.
    • :next_token - (String) The token returned by a previous call to indicate that there is more data available.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :metric_alarms - (Array)
      • :alarm_name - (String)
      • :alarm_arn - (String)
      • :alarm_description - (String)
      • :alarm_configuration_updated_timestamp - (Time)
      • :actions_enabled - (Boolean)
      • :ok_actions - (Array)
      • :alarm_actions - (Array)
      • :insufficient_data_actions - (Array)
      • :state_value - (String)
      • :state_reason - (String)
      • :state_reason_data - (String)
      • :state_updated_timestamp - (Time)
      • :metric_name - (String)
      • :namespace - (String)
      • :statistic - (String)
      • :dimensions - (Array)
        • :name - (String)
        • :value - (String)
      • :period - (Integer)
      • :unit - (String)
      • :evaluation_periods - (Integer)
      • :threshold - (Numeric)
      • :comparison_operator - (String)
    • :next_token - (String)

#describe_alarms_for_metric(options = {}) ⇒ Core::Response

Calls the DescribeAlarmsForMetric API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :metric_name - required - (String) The name of the metric.
    • :namespace - required - (String) The namespace of the metric.
    • :statistic - (String) The statistic for the metric. Valid values include:
      • SampleCount
      • Average
      • Sum
      • Minimum
      • Maximum
    • :dimensions - (Array<) The list of dimensions associated with the metric.
      • :name - required - (String) The name of the dimension.
      • :value - required - (String) The value representing the dimension measurement
    • :period - (Integer) The period in seconds over which the statistic is applied.
    • :unit - (String) The unit for the metric. Valid values include:
      • Seconds
      • Microseconds
      • Milliseconds
      • Bytes
      • Kilobytes
      • Megabytes
      • Gigabytes
      • Terabytes
      • Bits
      • Kilobits
      • Megabits
      • Gigabits
      • Terabits
      • Percent
      • Count
      • Bytes/Second
      • Kilobytes/Second
      • Megabytes/Second
      • Gigabytes/Second
      • Terabytes/Second
      • Bits/Second
      • Kilobits/Second
      • Megabits/Second
      • Gigabits/Second
      • Terabits/Second
      • Count/Second
      • None

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :metric_alarms - (Array)
      • :alarm_name - (String)
      • :alarm_arn - (String)
      • :alarm_description - (String)
      • :alarm_configuration_updated_timestamp - (Time)
      • :actions_enabled - (Boolean)
      • :ok_actions - (Array)
      • :alarm_actions - (Array)
      • :insufficient_data_actions - (Array)
      • :state_value - (String)
      • :state_reason - (String)
      • :state_reason_data - (String)
      • :state_updated_timestamp - (Time)
      • :metric_name - (String)
      • :namespace - (String)
      • :statistic - (String)
      • :dimensions - (Array)
        • :name - (String)
        • :value - (String)
      • :period - (Integer)
      • :unit - (String)
      • :evaluation_periods - (Integer)
      • :threshold - (Numeric)
      • :comparison_operator - (String)

#disable_alarm_actions(options = {}) ⇒ Core::Response

Calls the DisableAlarmActions API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :alarm_names - required - (Array<) The names of the alarms to disable actions for.

Returns:

#enable_alarm_actions(options = {}) ⇒ Core::Response

Calls the EnableAlarmActions API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :alarm_names - required - (Array<) The names of the alarms to enable actions for.

Returns:

#get_metric_statistics(options = {}) ⇒ Core::Response

Calls the GetMetricStatistics API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :namespace - required - (String) The namespace of the metric.
    • :metric_name - required - (String) The name of the metric.
    • :dimensions - (Array<) A list of dimensions describing qualities of the metric.
      • :name - required - (String) The name of the dimension.
      • :value - required - (String) The value representing the dimension measurement
    • :start_time - required - (String<) The time stamp to use for determining the first datapoint to return. The value specified is inclusive; results include datapoints with the time stamp specified. The specified start time is rounded down to the nearest value. Datapoints are returned for start times up to two weeks in the past. Specified start times that are more than two weeks in the past will not return datapoints for metrics that are older than two weeks.
    • :end_time - required - (String<) The time stamp to use for determining the last datapoint to return. The value specified is exclusive; results will include datapoints up to the time stamp specified.
    • :period - required - (Integer) The granularity, in seconds, of the returned datapoints. Period must be at least 60 seconds and must be a multiple of 60. The default value is 60.
    • :statistics - required - (Array<) The metric statistics to return.
    • :unit - (String) The unit for the metric. Valid values include:
      • Seconds
      • Microseconds
      • Milliseconds
      • Bytes
      • Kilobytes
      • Megabytes
      • Gigabytes
      • Terabytes
      • Bits
      • Kilobits
      • Megabits
      • Gigabits
      • Terabits
      • Percent
      • Count
      • Bytes/Second
      • Kilobytes/Second
      • Megabytes/Second
      • Gigabytes/Second
      • Terabytes/Second
      • Bits/Second
      • Kilobits/Second
      • Megabits/Second
      • Gigabits/Second
      • Terabits/Second
      • Count/Second
      • None

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :label - (String)
    • :datapoints - (Array)
      • :timestamp - (Time)
      • :sample_count - (Numeric)
      • :average - (Numeric)
      • :sum - (Numeric)
      • :minimum - (Numeric)
      • :maximum - (Numeric)
      • :unit - (String)

#list_metrics(options = {}) ⇒ Core::Response

Calls the ListMetrics API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :namespace - (String) The namespace to filter against.
    • :metric_name - (String) The name of the metric to filter against.
    • :dimensions - (Array<) A list of dimensions to filter against.
      • :name - required - (String) The dimension name to be matched.
      • :value - (String) The value of the dimension to be matched. Specifying a Name without specifying a Value returns all values associated with that Name.
    • :next_token - (String) The token returned by a previous call to indicate that there is more data available.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :metrics - (Array)
      • :namespace - (String)
      • :metric_name - (String)
      • :dimensions - (Array)
        • :name - (String)
        • :value - (String)
    • :next_token - (String)

#put_metric_alarm(options = {}) ⇒ Core::Response

Calls the PutMetricAlarm API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :alarm_name - required - (String) The descriptive name for the alarm. This name must be unique within the user's AWS account
    • :alarm_description - (String) The description for the alarm.
    • :actions_enabled - (Boolean) Indicates whether or not actions should be executed during any changes to the alarm's state.
    • :ok_actions - (Array<) The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
    • :alarm_actions - (Array<) The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
    • :insufficient_data_actions - (Array<) The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
    • :metric_name - required - (String) The name for the alarm's associated metric.
    • :namespace - required - (String) The namespace for the alarm's associated metric.
    • :statistic - required - (String) The statistic to apply to the alarm's associated metric. Valid values include:
      • SampleCount
      • Average
      • Sum
      • Minimum
      • Maximum
    • :dimensions - (Array<) The dimensions for the alarm's associated metric.
      • :name - required - (String) The name of the dimension.
      • :value - required - (String) The value representing the dimension measurement
    • :period - required - (Integer) The period in seconds over which the specified statistic is applied.
    • :unit - (String) The unit for the alarm's associated metric. Valid values include:
      • Seconds
      • Microseconds
      • Milliseconds
      • Bytes
      • Kilobytes
      • Megabytes
      • Gigabytes
      • Terabytes
      • Bits
      • Kilobits
      • Megabits
      • Gigabits
      • Terabits
      • Percent
      • Count
      • Bytes/Second
      • Kilobytes/Second
      • Megabytes/Second
      • Gigabytes/Second
      • Terabytes/Second
      • Bits/Second
      • Kilobits/Second
      • Megabits/Second
      • Gigabits/Second
      • Terabits/Second
      • Count/Second
      • None
    • :evaluation_periods - required - (Integer) The number of periods over which data is compared to the specified threshold.
    • :threshold - required - (Float) The value against which the specified statistic is compared.
    • :comparison_operator - required - (String) The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Valid values include:
      • GreaterThanOrEqualToThreshold
      • GreaterThanThreshold
      • LessThanThreshold
      • LessThanOrEqualToThreshold

Returns:

#put_metric_data(options = {}) ⇒ Core::Response

Calls the PutMetricData API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :namespace - required - (String) The namespace for the metric data.
    • :metric_data - required - (Array<) A list of data describing the metric.
      • :metric_name - required - (String) The name of the metric.
      • :dimensions - (Array<) A list of dimensions associated with the metric.
        • :name - required - (String) The name of the dimension.
        • :value - required - (String) The value representing the dimension measurement
      • :timestamp - (String<) The time stamp used for the metric. If not specified, the default value is set to the time the metric data was received.
      • :value - (Float) The value for the metric. Although the Value parameter accepts numbers of type Double, Amazon CloudWatch truncates values with very large exponents. Values with base-10 exponents greater than 126 (1 x 10126) are truncated. Likewise, values with base-10 exponents less than -130 (1 x 10^-130) are also truncated.
      • :statistic_values - (Hash) A set of statistical values describing the metric.
        • :sample_count - required - (Float) The number of samples used for the statistic set.
        • :sum - required - (Float) The sum of values for the sample set.
        • :minimum - required - (Float) The minimum value of the sample set.
        • :maximum - required - (Float) The maximum value of the sample set.
      • :unit - (String) The unit of the metric. Valid values include:
        • Seconds
        • Microseconds
        • Milliseconds
        • Bytes
        • Kilobytes
        • Megabytes
        • Gigabytes
        • Terabytes
        • Bits
        • Kilobits
        • Megabits
        • Gigabits
        • Terabits
        • Percent
        • Count
        • Bytes/Second
        • Kilobytes/Second
        • Megabytes/Second
        • Gigabytes/Second
        • Terabytes/Second
        • Bits/Second
        • Kilobits/Second
        • Megabits/Second
        • Gigabits/Second
        • Terabits/Second
        • Count/Second
        • None

Returns:

#set_alarm_state(options = {}) ⇒ Core::Response

Calls the SetAlarmState API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :alarm_name - required - (String) The descriptive name for the alarm. This name must be unique within the user's AWS account. The maximum length is 255 characters.
    • :state_value - required - (String) The value of the state. Valid values include:
      • OK
      • ALARM
      • INSUFFICIENT_DATA
    • :state_reason - required - (String) The reason that this alarm is set to this specific state (in human-readable text format)
    • :state_reason_data - (String) The reason that this alarm is set to this specific state (in machine-readable JSON format)

Returns: