class EurekaRuby::Configuration

Public Class Methods

new() click to toggle source
# File lib/eureka_ruby/configuration.rb, line 12
def initialize
  @health_path     = 'health'
  @health_response = 'OK'
  @health_headers  = { "Content-Type" => "text/plain" }
  @info_path       = 'info'
  @port            = 3000
  @scheme          = 'http'
end

Public Instance Methods

application_path() click to toggle source
# File lib/eureka_ruby/configuration.rb, line 29
def application_path
  'apps/' + app_id
end
instance_id() click to toggle source
# File lib/eureka_ruby/configuration.rb, line 21
def instance_id
  "#{host_name}:#{ip_addr}:#{port}"
end
instance_path() click to toggle source
# File lib/eureka_ruby/configuration.rb, line 25
def instance_path
  'apps/' + app_id + '/' + instance_id
end
register_payload() click to toggle source
# File lib/eureka_ruby/configuration.rb, line 33
def register_payload
  {
    instance: {
      instanceId: instance_id,
      hostName: host_name,
      app: app_id,
      ipAddr: ip_addr,
      status: "UP",
      vipAddress: app_id,
      secureVipAddress: app_id,
      port: { "$": port, "@enabled": "true" },
      securePort: { "$": "8443", "@enabled": "false" },
      healthCheckUrl: "#{scheme}://#{ip_addr}:#{port}#{health_path}",
      statusPageUrl: "#{scheme}://#{ip_addr}:#{port}#{info_path}",
      homePageUrl: "#{scheme}://#{ip_addr}:#{port}/",
      dataCenterInfo: {
        "@class": "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
        name: "MyOwn"
      }
    }
  }
end