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

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

Instance Attribute Summary

Attributes inherited from Ecloud::Model

#loaded

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Ecloud::Model

#load_unless_loaded!, #reload

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#edit(options = {}) ⇒ Object



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

def edit(options = {})
  href = "/cloudapi/ecloud/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/ecloud/models/compute/monitor.rb', line 40

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

#internet_service_idObject



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

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