Class: Fog::Compute::Ecloud::Monitor
- Inherits:
-
Ecloud::Model
- Object
- Model
- Ecloud::Model
- Fog::Compute::Ecloud::Monitor
- Defined in:
- lib/fog/ecloud/models/compute/monitor.rb
Instance Attribute Summary
Attributes inherited from Ecloud::Model
Attributes inherited from Model
Instance Method Summary collapse
Methods inherited from Ecloud::Model
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 Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #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( = {}) href = "/cloudapi/ecloud/internetServices/#{internet_service_id}/monitor?type=" case type when "application/vnd.tmrk.cloud.pingMonitor" [:uri] = href + "ping" data = connection.monitors_edit_ping().body when "application/vnd.tmrk.cloud.httpMonitor" [:uri] = href + "http" data = connection.monitors_edit_http().body when "application/vnd.tmrk.cloud.ecvMonitor" [:uri] = href + "ecv" data = connection.monitors_edit_ecv().body end object = collection.from_data(data) end |
#id ⇒ Object
40 41 42 |
# File 'lib/fog/ecloud/models/compute/monitor.rb', line 40 def id href.scan(/\d+/)[0] end |
#internet_service_id ⇒ Object
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 |