forked from TrueCloudLab/frostfs-node
[#313] control: Rename HealthStatus enum to NetmapStatus
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
a89567a88d
commit
83d4420a30
16 changed files with 98 additions and 98 deletions
|
@ -23,7 +23,7 @@ func (s *Server) HealthCheck(_ context.Context, req *control.HealthCheckRequest)
|
|||
body := new(control.HealthCheckResponse_Body)
|
||||
resp.SetBody(body)
|
||||
|
||||
body.SetStatus(s.healthChecker.HealthStatus())
|
||||
body.SetNetmapStatus(s.healthChecker.NetmapStatus())
|
||||
|
||||
// sign the response
|
||||
if err := SignMessage(s.key, resp); err != nil {
|
||||
|
|
|
@ -63,14 +63,14 @@ func nodesFromAPI(apiNodes netmapAPI.Nodes) []*control.NodeInfo {
|
|||
return nodes
|
||||
}
|
||||
|
||||
func stateFromAPI(s netmapAPI.NodeState) control.HealthStatus {
|
||||
func stateFromAPI(s netmapAPI.NodeState) control.NetmapStatus {
|
||||
switch s {
|
||||
default:
|
||||
return control.HealthStatus_STATUS_UNDEFINED
|
||||
return control.NetmapStatus_STATUS_UNDEFINED
|
||||
case netmapAPI.NodeStateOffline:
|
||||
return control.HealthStatus_OFFLINE
|
||||
return control.NetmapStatus_OFFLINE
|
||||
case netmapAPI.NodeStateOnline:
|
||||
return control.HealthStatus_ONLINE
|
||||
return control.NetmapStatus_ONLINE
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ type Server struct {
|
|||
// HealthChecker is component interface for calculating
|
||||
// the current health status of a node.
|
||||
type HealthChecker interface {
|
||||
// Must calculate and return current node health status.
|
||||
// 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.
|
||||
HealthStatus() control.HealthStatus
|
||||
NetmapStatus() control.NetmapStatus
|
||||
}
|
||||
|
||||
// Option of the Server's constructor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue