forked from TrueCloudLab/frostfs-node
[#1118] services/control: allow to reset error counter in SetShardMode
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
6ad2624552
commit
7fb15fa1d0
7 changed files with 147 additions and 104 deletions
|
@ -71,8 +71,9 @@ const (
|
|||
netmapStatusOffline = "offline"
|
||||
netmapStatusMaintenance = "maintenance"
|
||||
|
||||
shardModeFlag = "mode"
|
||||
shardIDFlag = "id"
|
||||
shardModeFlag = "mode"
|
||||
shardIDFlag = "id"
|
||||
shardClearErrorsFlag = "clear-errors"
|
||||
|
||||
shardModeReadOnly = "read-only"
|
||||
shardModeReadWrite = "read-write"
|
||||
|
@ -127,6 +128,7 @@ func initControlSetShardModeCmd() {
|
|||
shardModeReadOnly,
|
||||
),
|
||||
)
|
||||
flags.Bool(shardClearErrorsFlag, false, "Set shard error count to 0")
|
||||
}
|
||||
|
||||
func initControlShardsListCmd() {
|
||||
|
@ -510,6 +512,9 @@ func setShardMode(cmd *cobra.Command, _ []string) {
|
|||
body.SetMode(mode)
|
||||
body.SetShardID(rawID)
|
||||
|
||||
reset, _ := cmd.Flags().GetBool(shardClearErrorsFlag)
|
||||
body.ClearErrorCounter(reset)
|
||||
|
||||
err = controlSvc.SignMessage(key, req)
|
||||
exitOnErr(cmd, errf("could not sign request: %w", err))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue