1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

removed all tabs

This commit is contained in:
Michael Zeng 2011-10-03 19:12:45 -04:00
parent 2f97d6305c
commit a7b258b7ea
17 changed files with 49 additions and 49 deletions

View file

@ -27,7 +27,7 @@ module Fog
collection :metrics
model :metric_statistic
collection :metric_statistics
model :alarm_datum
model :alarm_datum
collection :alarm_data
model :alarm_history
collection :alarm_histories

View file

@ -21,10 +21,10 @@ module Fog
list_opts.merge!('Dimensions' => dimensions_array)
end
if period
list_opts.merge!('Period' => period)
list_opts.merge!('Period' => period)
end
if statistic
list_opts.merge!('Statistic' => statistic)
list_opts.merge!('Statistic' => statistic)
end
if unit
list_opts.merge!('Unit' => unit)

View file

@ -5,7 +5,7 @@ module Fog
class CloudWatch
class AlarmDatum < Fog::Model
attribute :alarm_name, :aliases => 'AlarmName'
attribute :alarm_name, :aliases => 'AlarmName'
attribute :metric_name, :aliases => 'MetricName'
attribute :namespace, :aliases => 'Namespace'
attribute :dimensions, :aliases => 'Dimensions'
@ -37,15 +37,15 @@ module Fog
requires :threshold
alarm_definition = {
'AlarmName' => alarm_name,
'ComparisonOperator' => comparison_operator,
'EvaluationPeriods' => evaluation_periods,
'MetricName' => metric_name,
'Namespace' => namespace,
'Period' => period,
'Statistic' => statistic,
'Threshold' => threshold
}
'AlarmName' => alarm_name,
'ComparisonOperator' => comparison_operator,
'EvaluationPeriods' => evaluation_periods,
'MetricName' => metric_name,
'Namespace' => namespace,
'Period' => period,
'Statistic' => statistic,
'Threshold' => threshold
}
alarm_definition.merge!('ActionsEnabled' => action_enabled) if action_enabled
alarm_definition.merge!('AlarmActions' => alarm_actions) if alarm_actions

View file

@ -5,7 +5,7 @@ module Fog
class CloudWatch
class AlarmHistory < Fog::Model
attribute :alarm_name, :aliases => 'AlarmName'
attribute :alarm_name, :aliases => 'AlarmName'
attribute :end_date, :aliases => 'EndDate'
attribute :history_item_type, :aliases => 'HistoryItemType'
attribute :max_records, :aliases => 'MaxRecords'

View file

@ -7,8 +7,8 @@ module Fog
class Alarms < Fog::Collection
model Fog::AWS::CloudWatch::Alarm
#alarm_names is an array of alarm names
#alarm_names is an array of alarm names
def delete(alarm_names)
connection.delete_alarms(alarm_names)
true

View file

@ -11,4 +11,4 @@ module Fog
end
end
end
end
end

View file

@ -43,4 +43,4 @@ module Fog
end
end
end
end
end

View file

@ -43,21 +43,21 @@ module Fog
when 'AlarmActions', 'OKActions', 'InsufficientDataActions'
@metric_alarms[name] = value.to_s.strip
when 'AlarmName', 'Namespace', 'MetricName', 'AlarmDescription', 'AlarmArn', 'Unit',
'StateValue', 'Statistic', 'ComparisonOperator', 'StateReason', 'ActionsEnabled'
'StateValue', 'Statistic', 'ComparisonOperator', 'StateReason', 'ActionsEnabled'
@metric_alarms[name] = value
when 'StateUpdatedTimestamp', 'AlarmConfigurationUpdatedTimestamp'
@metric_alarms[name] = Time.parse value
@metric_alarms[name] = Time.parse value
when 'Dimensions'
@in_dimensions = false
when 'RequestId'
when 'RequestId'
@response['ResponseMetadata'][name] = value
when 'NextToken'
@response['ResponseMetadata'][name] = value
when 'member'
if !@in_dimensions
if @metric_alarms.has_key?('AlarmName')
@response['DescribeAlarmsResult']['MetricAlarms'] << @metric_alarms
reset_metric_alarms
@response['DescribeAlarmsResult']['MetricAlarms'] << @metric_alarms
reset_metric_alarms
elsif @response['DescribeAlarmsResult']['MetricAlarms'].last != nil
@response['DescribeAlarmsResult']['MetricAlarms'].last.merge!( @metric_alarms)
end

View file

@ -32,7 +32,7 @@ module Fog
def end_element(name)
case name
when 'Name', 'Value'
when 'Name', 'Value'
@dimension[name] = value
when 'Period', 'EvaluationPeriods'
@metric_alarms[name] = value.to_i
@ -42,20 +42,20 @@ module Fog
@metric_alarms[name] = value.to_s.strip
when 'AlarmName', 'Namespace', 'MetricName', 'AlarmDescription', 'AlarmArn', 'Unit',
'StateValue', 'Statistic', 'ComparisonOperator', 'StateReason', 'ActionsEnabled'
@metric_alarms[name] = value
when 'StateUpdatedTimestamp', 'AlarmConfigurationUpdatedTimestamp'
@metric_alarms[name] = Time.parse value
@metric_alarms[name] = value
when 'StateUpdatedTimestamp', 'AlarmConfigurationUpdatedTimestamp'
@metric_alarms[name] = Time.parse value
when 'Dimensions'
@in_dimensions = false
when 'NextToken'
@response['ResponseMetadata'][name] = value
when 'RequestId'
when 'RequestId'
@response['ResponseMetadata'][name] = value
when 'member'
if !@in_dimensions
if @metric_alarms.has_key?('AlarmName')
@response['DescribeAlarmsForMetricResult']['MetricAlarms'] << @metric_alarms
reset_metric_alarms
@response['DescribeAlarmsForMetricResult']['MetricAlarms'] << @metric_alarms
reset_metric_alarms
elsif @response['DescribeAlarmsForMetricResult']['MetricAlarms'].last != nil
@response['DescribeAlarmsForMetricResult']['MetricAlarms'].last.merge!( @metric_alarms)
end

View file

@ -17,7 +17,7 @@ module Fog
#
def delete_alarms(alarm_names)
options = {}
options = {}
options.merge!(AWS.indexed_param('AlarmNames.member.%d', [*alarm_names]))
request({
'Action' => 'DeleteAlarms',

View file

@ -3,13 +3,13 @@ module Fog
class CloudWatch
class Real
require 'fog/aws/parsers/cloud_watch/describe_alarms'
require 'fog/aws/parsers/cloud_watch/describe_alarms'
# Retrieves alarms with the specified names
# 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 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

View file

@ -3,9 +3,9 @@ module Fog
class CloudWatch
class Real
require 'fog/aws/parsers/cloud_watch/describe_alarms_for_metric'
require 'fog/aws/parsers/cloud_watch/describe_alarms_for_metric'
# Retrieves all alarms for a single metric
# Retrieves all alarms for a single metric
# ==== Options
# * Dimensions<~Array>: a list of dimensions to filter against
# Name : The name of the dimension

View file

@ -3,9 +3,9 @@ module Fog
class CloudWatch
class Real
require 'fog/aws/parsers/cloud_watch/disable_alarm_actions'
require 'fog/aws/parsers/cloud_watch/disable_alarm_actions'
# Disables actions for the specified alarms
# Disables actions for the specified alarms
# ==== Options
# * AlarmNames<~Array>: The names of the alarms to disable actions for
#
@ -17,7 +17,7 @@ module Fog
#
def disable_alarm_actions(alarm_names)
options = {}
options = {}
options.merge!(AWS.indexed_param('AlarmNames.member.%d', [*alarm_names]))
request({
'Action' => 'DisableAlarmActions',

View file

@ -3,9 +3,9 @@ module Fog
class CloudWatch
class Real
require 'fog/aws/parsers/cloud_watch/enable_alarm_actions'
require 'fog/aws/parsers/cloud_watch/enable_alarm_actions'
# Enables actions for the specified alarms
# Enables actions for the specified alarms
# ==== Options
# * AlarmNames<~Array>: The names of the alarms to enable actions for
#
@ -17,7 +17,7 @@ module Fog
#
def enable_alarm_actions(alarm_names)
options = {}
options = {}
options.merge!(AWS.indexed_param('AlarmNames.member.%d', [*alarm_names]))
request({
'Action' => 'EnableAlarmActions',

View file

@ -3,16 +3,16 @@ module Fog
class CloudWatch
class Real
require 'fog/aws/parsers/cloud_watch/put_metric_alarm'
require 'fog/aws/parsers/cloud_watch/put_metric_alarm'
# Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric
# 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,
# * 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

View file

@ -3,9 +3,9 @@ module Fog
class CloudWatch
class Real
require 'fog/aws/parsers/cloud_watch/set_alarm_state'
require 'fog/aws/parsers/cloud_watch/set_alarm_state'
# Temporarily sets the state of an alarm
# 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)

View file

@ -5,7 +5,7 @@ Shindo.tests("AWS::CloudWatch | alarm_histories", ['aws', 'cloudwatch']) do
Fog::AWS[:cloud_watch].alarm_histories.all
end
new_attributes = {
new_attributes = {
:alarm_name => 'tmp-alarm',
:end_date => '',
:history_item_type => 'StateUpdate',