mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
added SetAlarmState
This commit is contained in:
parent
c44c9f9ac5
commit
d9ef5b840f
3 changed files with 58 additions and 0 deletions
|
@ -17,6 +17,7 @@ module Fog
|
||||||
request :enable_alarm_actions
|
request :enable_alarm_actions
|
||||||
request :disable_alarm_actions
|
request :disable_alarm_actions
|
||||||
request :describe_alarms_for_metric
|
request :describe_alarms_for_metric
|
||||||
|
request :set_alarm_state
|
||||||
|
|
||||||
model_path 'fog/aws/models/cloud_watch'
|
model_path 'fog/aws/models/cloud_watch'
|
||||||
model :metric
|
model :metric
|
||||||
|
|
26
lib/fog/aws/parsers/cloud_watch/set_alarm_state.rb
Normal file
26
lib/fog/aws/parsers/cloud_watch/set_alarm_state.rb
Normal 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
|
31
lib/fog/aws/requests/cloud_watch/set_alarm_state.rb
Normal file
31
lib/fog/aws/requests/cloud_watch/set_alarm_state.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue