mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
36 lines
887 B
Ruby
36 lines
887 B
Ruby
|
module Fog
|
||
|
module Compute
|
||
|
class Ecloud
|
||
|
class Real
|
||
|
include Shared
|
||
|
|
||
|
def monitors_create_ping(data)
|
||
|
validate_data([:interval, :response_timeout, :retries, :downtime, :enabled], data)
|
||
|
|
||
|
request(
|
||
|
:body => generate_ping_monitor_request(data),
|
||
|
:expects => 201,
|
||
|
:method => "POST",
|
||
|
:headers => {},
|
||
|
:uri => data[:uri],
|
||
|
:parse => true
|
||
|
)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def generate_ping_monitor_request(data)
|
||
|
xml = Builder::XmlMarkup.new
|
||
|
xml.CreatePingMonitor do
|
||
|
xml.Interval data[:interval]
|
||
|
xml.ResponseTimeout data[:response_timeout]
|
||
|
xml.Retries data[:retries]
|
||
|
xml.Downtime data[:downtime]
|
||
|
xml.Enabled data[:enabled]
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|