forked from TrueCloudLab/frostfs-node
[#312] control/server: Extended HealthChecker interface
Add HealthStatus method to HealthChecker interface that should return current health status of the node application. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
6ae51e41f9
commit
f327024ee7
2 changed files with 8 additions and 1 deletions
|
@ -24,6 +24,7 @@ func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest)
|
|||
resp.SetBody(body)
|
||||
|
||||
body.SetNetmapStatus(s.healthChecker.NetmapStatus())
|
||||
body.SetHealthStatus(s.healthChecker.HealthStatus())
|
||||
|
||||
// sign the response
|
||||
if err := SignMessage(s.key, resp); err != nil {
|
||||
|
|
|
@ -19,8 +19,14 @@ type HealthChecker interface {
|
|||
// Must calculate and return current status of the node in NeoFS network map.
|
||||
//
|
||||
// If status can not be calculated for any reason,
|
||||
// control.HealthStatus_STATUS_UNDEFINED should be returned.
|
||||
// control.netmapStatus_STATUS_UNDEFINED should be returned.
|
||||
NetmapStatus() control.NetmapStatus
|
||||
|
||||
// Must calculate and return current health status of the node application.
|
||||
//
|
||||
// If status can not be calculated for any reason,
|
||||
// control.HealthStatus_HEALTH_STATUS_UNDEFINED should be returned.
|
||||
HealthStatus() control.HealthStatus
|
||||
}
|
||||
|
||||
// Option of the Server's constructor.
|
||||
|
|
Loading…
Reference in a new issue