forked from TrueCloudLab/frostfs-node
[#922] cli: Support MAINTENANCE netmap status
Accept `maintenance` netmap status in `control set-status` command and resolve it to `control.NetmapStatus_MAINTENANCE` value. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
8f8b638b95
commit
29644e9bc2
1 changed files with 7 additions and 3 deletions
|
@ -52,6 +52,7 @@ const (
|
||||||
|
|
||||||
netmapStatusOnline = "online"
|
netmapStatusOnline = "online"
|
||||||
netmapStatusOffline = "offline"
|
netmapStatusOffline = "offline"
|
||||||
|
netmapStatusMaintenance = "maintenance"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -88,9 +89,10 @@ func initControlSetNetmapStatusCmd() {
|
||||||
|
|
||||||
flags.String(controlRPC, controlRPCDefault, controlRPCUsage)
|
flags.String(controlRPC, controlRPCDefault, controlRPCUsage)
|
||||||
flags.StringVarP(&netmapStatus, netmapStatusFlag, "", "",
|
flags.StringVarP(&netmapStatus, netmapStatusFlag, "", "",
|
||||||
fmt.Sprintf("new netmap status keyword ('%s', '%s')",
|
fmt.Sprintf("new netmap status keyword ('%s', '%s', '%s')",
|
||||||
netmapStatusOnline,
|
netmapStatusOnline,
|
||||||
netmapStatusOffline,
|
netmapStatusOffline,
|
||||||
|
netmapStatusMaintenance,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -208,6 +210,8 @@ func setNetmapStatus(cmd *cobra.Command, _ []string) {
|
||||||
status = control.NetmapStatus_ONLINE
|
status = control.NetmapStatus_ONLINE
|
||||||
case netmapStatusOffline:
|
case netmapStatusOffline:
|
||||||
status = control.NetmapStatus_OFFLINE
|
status = control.NetmapStatus_OFFLINE
|
||||||
|
case netmapStatusMaintenance:
|
||||||
|
status = control.NetmapStatus_MAINTENANCE
|
||||||
}
|
}
|
||||||
|
|
||||||
req := new(control.SetNetmapStatusRequest)
|
req := new(control.SetNetmapStatusRequest)
|
||||||
|
|
Loading…
Reference in a new issue