/usr/lib/ruby/vendor_ruby/fog/compute/ecloud/requests/monitors_edit_http.rb is in ruby-fog-ecloud 0.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | module Fog
module Compute
class Ecloud
class Real
include Shared
def monitors_edit_http(data)
validate_data([:interval, :response_timeout, :retries, :downtime, :enabled, :request_uri, :response_codes], data)
request(
:body => generate_edit_http_request(data),
:expects => 200,
:method => "PUT",
:headers => {},
:uri => data[:uri],
:parse => true
)
end
private
def generate_edit_http_request(data)
xml = Builder::XmlMarkup.new
xml.HttpMonitor do
xml.Interval data[:interval]
xml.ResponseTimeout data[:response_timeout]
xml.Retries data[:retries]
xml.Downtime data[:downtime]
xml.Enabled data[:enabled]
xml.RequestUri data[:request_uri]
if xml[:httpheaders]
xml.HttpHeaders xml[:http_headers]
end
xml.ResponseCodes do
xml[:response_codes].each do |c|
xml.ResponseCode c
end
end
end
end
end
end
end
end
|