[#1916] control: Check maintenance allowance on Control server

In previous implementation turning to maintenance mode using NeoFS CLI
required NeoFS API endpoint. This was not convenient from the user
perspective. It's worth to move networks settings' check to the server
side.

Add `force_maintenance` field to `SetNetmapStatusRequest.Body` message
of Control API. Add `force` flag to `neofs-cli control set-status`
command which sets corresponding field in the requests body if status is
`maintenance`. Force flag is ignored for any other status.

Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
Leonard Lyubich 2022-10-18 19:42:14 +04:00 committed by LeL
parent c50603494b
commit 60e9de8d63
10 changed files with 346 additions and 272 deletions

View file

@ -32,8 +32,9 @@ $ neofs-adm morph set-config MaintenanceModeAllowed=true|false
To switch the node to MM, exec:
```shell
$ neofs-cli control set-status --status maintenance
$ neofs-cli control set-status --status maintenance [--force|-f]
```
`-f` flag allows to force local maintenance regardless of the network settings.
To stop the maintenance, use the same command but with any other supported state.