Files

Class/Module Index [+]

Quicksearch

Fog::Compute::Ecloud::InternetService

Public Instance Methods

backup_service_uri() click to toggle source
# File lib/fog/ecloud/models/compute/internet_service.rb, line 83
def backup_service_uri
  if backup_service_data
    backup_service_data[:Href]
  end
end
backup_service_uri=(new_value) click to toggle source
# File lib/fog/ecloud/models/compute/internet_service.rb, line 89
def backup_service_uri=(new_value)
  self.backup_service_data = {
    :Href => new_value
  }
end
delete() click to toggle source
# File lib/fog/ecloud/models/compute/internet_service.rb, line 22
def delete
  requires :href

  connection.delete_internet_service( href )
end
disable_monitor() click to toggle source

disables monitoring for this service

# File lib/fog/ecloud/models/compute/internet_service.rb, line 38
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_ping_monitor() click to toggle source

enable default ping monitoring, use monitor= for more exotic forms (ECV & HTTP)

# File lib/fog/ecloud/models/compute/internet_service.rb, line 48
def enable_ping_monitor
  self.monitor = nil
  self.save
end
monitor=(new_monitor = {}) click to toggle source
# File lib/fog/ecloud/models/compute/internet_service.rb, line 53
def monitor=(new_monitor = {})
  if new_monitor.nil? || new_monitor.empty?
    attributes[:monitor] = nil
  elsif new_monitor.is_a?(Hash)
    attributes[:monitor] = {}
    attributes[:monitor][:type] = new_monitor[:MonitorType] || new_monitor[:type]
    attributes[:monitor][:url_send_string] = new_monitor[:UrlSendString] || new_monitor[:url_send_string]
    attributes[:monitor][:http_headers] = new_monitor[:HttpHeader] || new_monitor[:http_headers]
    if attributes[:monitor][:http_headers]
      if attributes[:monitor][:http_headers].is_a?(String)
        attributes[:monitor][:http_headers] = attributes[:monitor][:http_headers].split("\n")
      else
        attributes[:monitor][:http_headers] = attributes[:monitor][:http_headers]
      end
    end
    attributes[:monitor][:receive_string] = new_monitor[:ReceiveString] || new_monitor[:receive_string]
    attributes[:monitor][:interval] = new_monitor[:Interval] || new_monitor[:interval]
    attributes[:monitor][:response_timeout] = new_monitor[:ResponseTimeOut] || new_monitor[:response_timeout]
    attributes[:monitor][:downtime] = new_monitor[:DownTime] || new_monitor[:downtime]
    attributes[:monitor][:retries] = new_monitor[:Retries] || new_monitor[:retries]
    attributes[:monitor][:is_enabled] = new_monitor[:IsEnabled] || new_monitor[:is_enabled]
  else
    raise RuntimeError.new("monitor needs to either be nil or a Hash")
  end
end
nodes() click to toggle source
# File lib/fog/ecloud/models/compute/internet_service.rb, line 79
def nodes
  @nodes ||= Fog::Compute::Ecloud::Nodes.new( :connection => connection, :href => href + "/nodeServices" )
end
save() click to toggle source
# File lib/fog/ecloud/models/compute/internet_service.rb, line 28
def save
  if new_record?
    result = connection.add_internet_service( collection.href, _compose_service_data )
    merge_attributes(result.body)
  else
    connection.configure_internet_service( href, _compose_service_data, _compose_ip_data )
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.