mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
InternetService#disable_monitor and #enable_ping_monitor
This commit is contained in:
parent
be273b74cf
commit
c937fe3566
1 changed files with 16 additions and 0 deletions
|
@ -35,6 +35,22 @@ module Fog
|
|||
end
|
||||
end
|
||||
|
||||
# disables monitoring for this service
|
||||
def disable_monitor
|
||||
if self.monitor and self.monitor[:type] == "Disabled"
|
||||
raise RuntimeError.new("Monitoring already disabled")
|
||||
else
|
||||
self.monitor = {:type => "Disabled", :is_enabled => "true"}
|
||||
self.save
|
||||
end
|
||||
end
|
||||
|
||||
# enable default ping monitoring, use monitor= for more exotic forms (ECV & HTTP)
|
||||
def enable_ping_monitor
|
||||
self.monitor = nil
|
||||
self.save
|
||||
end
|
||||
|
||||
def monitor=(new_monitor = {})
|
||||
if new_monitor.nil? || new_monitor.empty?
|
||||
attributes[:monitor] = nil
|
||||
|
|
Loading…
Add table
Reference in a new issue