class Diplomat::Health
Public Class Methods
@note This is sugar, see (checks
)
# File lib/diplomat/health.rb, line 66 def self.checks *args Diplomat::Health.new.checks *args end
@note This is sugar, see (critical
)
# File lib/diplomat/health.rb, line 96 def self.critical Diplomat::Health.new.critical end
@note This is sugar, see (node
)
# File lib/diplomat/health.rb, line 61 def self.node *args Diplomat::Health.new.node *args end
@note This is sugar, see (passing
)
# File lib/diplomat/health.rb, line 86 def self.passing Diplomat::Health.new.passing end
@note This is sugar, see (service
)
# File lib/diplomat/health.rb, line 71 def self.service *args Diplomat::Health.new.service *args end
@note This is sugar, see (state
)
# File lib/diplomat/health.rb, line 76 def self.state *args Diplomat::Health.new.state *args end
@note This is sugar, see (unknown
)
# File lib/diplomat/health.rb, line 81 def self.unknown Diplomat::Health.new.unknown end
@note This is sugar, see (warning
)
# File lib/diplomat/health.rb, line 91 def self.warning Diplomat::Health.new.warning end
Public Instance Methods
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
Convenience method to get services in critical state
# File lib/diplomat/health.rb, line 55 def critical state("critical") end
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
Convenience method to get services in passing state
# File lib/diplomat/health.rb, line 45 def passing state("passing") end
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
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
Convenience method to get services in unknown state
# File lib/diplomat/health.rb, line 40 def unknown state("unknown") end
Convenience method to get services in warning state
# File lib/diplomat/health.rb, line 50 def warning state("warning") end