Class: Fog::Compute::Ecloud::Monitor

Inherits:
Ecloud::Model show all
Defined in:
lib/fog/compute/ecloud/models/monitor.rb

Instance Attribute Summary

Attributes inherited from Ecloud::Model

#loaded

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

Instance Method Details

#edit(options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fog/compute/ecloud/models/monitor.rb', line 20

def edit(options = {})
  href = "#{service.base_path}/internetServices/#{internet_service_id}/monitor?type="
  case type
  when "application/vnd.tmrk.cloud.pingMonitor"
    options[:uri] = href + "ping"
    data = service.monitors_edit_ping(options).body
  when "application/vnd.tmrk.cloud.httpMonitor"
    options[:uri] = href + "http"
    data = service.monitors_edit_http(options).body
  when "application/vnd.tmrk.cloud.ecvMonitor"
    options[:uri] = href + "ecv"
    data = service.monitors_edit_ecv(options).body
  end
  object = collection.from_data(data)
end

#idObject



40
41
42
# File 'lib/fog/compute/ecloud/models/monitor.rb', line 40

def id
  href.scan(/\d+/)[0]
end

#internet_service_idObject



36
37
38
# File 'lib/fog/compute/ecloud/models/monitor.rb', line 36

def internet_service_id
  other_links[:Link][:href].scan(/\d+/)[0]
end