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

added SetAlarmState

This commit is contained in:
Michael Zeng 2011-09-30 15:08:59 -04:00
parent c44c9f9ac5
commit d9ef5b840f
3 changed files with 58 additions and 0 deletions

View file

@ -17,6 +17,7 @@ module Fog
request :enable_alarm_actions
request :disable_alarm_actions
request :describe_alarms_for_metric
request :set_alarm_state
model_path 'fog/aws/models/cloud_watch'
model :metric

View file

@ -0,0 +1,26 @@
module Fog
module Parsers
module AWS
module CloudWatch
class SetAlarmState < Fog::Parsers::Base
def reset
@response = { 'ResponseMetadata' => {} }
end
def start_element(name, attrs = [])
super
end
def end_element(name)
case name
when 'RequestId'
@response['ResponseMetadata'][name] = value
end
end
end
end
end
end
end

View file

@ -0,0 +1,31 @@
module Fog
module AWS
class CloudWatch
class Real
require 'fog/aws/parsers/cloud_watch/set_alarm_state'
# 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
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_SetAlarmState.html
#
def set_alarm_state(options)
request({
'Action' => 'SetAlarmState',
:parser => Fog::Parsers::AWS::CloudWatch::SetAlarmState.new
}.merge(options))
end
end
end
end
end