class Diplomat::Health

Public Class Methods

checks(*args) click to toggle source

@note This is sugar, see (checks)

# File lib/diplomat/health.rb, line 66
def self.checks *args
  Diplomat::Health.new.checks *args
end
critical() click to toggle source

@note This is sugar, see (critical)

# File lib/diplomat/health.rb, line 96
def self.critical
  Diplomat::Health.new.critical
end
node(*args) click to toggle source

@note This is sugar, see (node)

# File lib/diplomat/health.rb, line 61
def self.node *args
  Diplomat::Health.new.node *args
end
passing() click to toggle source

@note This is sugar, see (passing)

# File lib/diplomat/health.rb, line 86
def self.passing
  Diplomat::Health.new.passing
end
service(*args) click to toggle source

@note This is sugar, see (service)

# File lib/diplomat/health.rb, line 71
def self.service *args
  Diplomat::Health.new.service *args
end
state(*args) click to toggle source

@note This is sugar, see (state)

# File lib/diplomat/health.rb, line 76
def self.state *args
  Diplomat::Health.new.state *args
end
unknown() click to toggle source

@note This is sugar, see (unknown)

# File lib/diplomat/health.rb, line 81
def self.unknown
  Diplomat::Health.new.unknown
end
warning() click to toggle source

@note This is sugar, see (warning)

# File lib/diplomat/health.rb, line 91
def self.warning
  Diplomat::Health.new.warning
end

Public Instance Methods

checks(s) click to toggle source

Get service checks @param s [String] the service @return [OpenStruct] all data associated with the node

# File lib/diplomat/health.rb, line 18
def checks s
  ret = @conn.get "/v1/health/checks/#{s}"
  return JSON.parse(ret.body)
end
critical() click to toggle source

Convenience method to get services in critical state

# File lib/diplomat/health.rb, line 55
def critical
  state("critical")
end
node(n) click to toggle source

Get node health @param n [String] the node @return [OpenStruct] all data associated with the node

# File lib/diplomat/health.rb, line 10
def node n
  ret = @conn.get "/v1/health/node/#{n}"
  return JSON.parse(ret.body)
end
passing() click to toggle source

Convenience method to get services in passing state

# File lib/diplomat/health.rb, line 45
def passing
  state("passing")
end
service(s) click to toggle source

Get service health @param s [String] the service @return [OpenStruct] all data associated with the node

# File lib/diplomat/health.rb, line 26
def service s
  ret = @conn.get "/v1/health/service/#{s}"
  return JSON.parse(ret.body)
end
state(s) click to toggle source

Get service health @param s [String] the state (“unknown”, “passing”, “warning”, or “critical”) @return [OpenStruct] all data associated with the node

# File lib/diplomat/health.rb, line 34
def state s
  ret = @conn.get "/v1/health/state/#{s}"
  return JSON.parse(ret.body)
end
unknown() click to toggle source

Convenience method to get services in unknown state

# File lib/diplomat/health.rb, line 40
def unknown
  state("unknown")
end
warning() click to toggle source

Convenience method to get services in warning state

# File lib/diplomat/health.rb, line 50
def warning
  state("warning")
end