[#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:
Leonard Lyubich 2021-11-09 18:49:05 +03:00 committed by Alex Vanin
parent 8f8b638b95
commit 29644e9bc2

View file

@ -52,6 +52,7 @@ const (
netmapStatusOnline = "online"
netmapStatusOffline = "offline"
netmapStatusMaintenance = "maintenance"
)
const (
@ -88,9 +89,10 @@ func initControlSetNetmapStatusCmd() {
flags.String(controlRPC, controlRPCDefault, controlRPCUsage)
flags.StringVarP(&netmapStatus, netmapStatusFlag, "", "",
fmt.Sprintf("new netmap status keyword ('%s', '%s')",
fmt.Sprintf("new netmap status keyword ('%s', '%s', '%s')",
netmapStatusOnline,
netmapStatusOffline,
netmapStatusMaintenance,
),
)
@ -208,6 +210,8 @@ func setNetmapStatus(cmd *cobra.Command, _ []string) {
status = control.NetmapStatus_ONLINE
case netmapStatusOffline:
status = control.NetmapStatus_OFFLINE
case netmapStatusMaintenance:
status = control.NetmapStatus_MAINTENANCE
}
req := new(control.SetNetmapStatusRequest)