2024-02-01 14:53:00 +00:00
|
|
|
package node
|
|
|
|
|
|
|
|
import (
|
2024-02-02 12:04:48 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/commonflags"
|
2024-02-01 14:53:00 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
|
|
|
var RemoveCmd = &cobra.Command{
|
|
|
|
Use: "remove-nodes key1 [key2 [...]]",
|
|
|
|
Short: "Remove storage nodes from the netmap",
|
|
|
|
Long: `Move nodes to the Offline state in the candidates list and tick an epoch to update the netmap`,
|
|
|
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
2024-02-02 12:04:48 +00:00
|
|
|
_ = viper.BindPFlag(commonflags.AlphabetWalletsFlag, cmd.Flags().Lookup(commonflags.AlphabetWalletsFlag))
|
|
|
|
_ = viper.BindPFlag(commonflags.EndpointFlag, cmd.Flags().Lookup(commonflags.EndpointFlag))
|
2024-02-01 14:53:00 +00:00
|
|
|
},
|
|
|
|
RunE: RemoveNodesCmd,
|
|
|
|
}
|
|
|
|
|
|
|
|
func initRemoveNodesCmd() {
|
2024-02-02 12:04:48 +00:00
|
|
|
RemoveCmd.Flags().String(commonflags.AlphabetWalletsFlag, "", commonflags.AlphabetWalletsFlagDesc)
|
|
|
|
RemoveCmd.Flags().StringP(commonflags.EndpointFlag, commonflags.EndpointFlagShort, "", commonflags.EndpointFlagDesc)
|
|
|
|
RemoveCmd.Flags().String(commonflags.LocalDumpFlag, "", "Path to the blocks dump file")
|
2024-02-01 14:53:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
initRemoveNodesCmd()
|
|
|
|
}
|