2022-05-23 16:26:27 +00:00
|
|
|
package control
|
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
2022-05-23 16:26:27 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Cmd = &cobra.Command{
|
|
|
|
Use: "control",
|
|
|
|
Short: "Operations with storage node",
|
|
|
|
Long: `Operations with storage node`,
|
|
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
|
|
ff := cmd.Flags()
|
|
|
|
|
|
|
|
_ = viper.BindPFlag(commonflags.WalletPath, ff.Lookup(commonflags.WalletPath))
|
|
|
|
_ = viper.BindPFlag(commonflags.Account, ff.Lookup(commonflags.Account))
|
|
|
|
_ = viper.BindPFlag(controlRPC, ff.Lookup(controlRPC))
|
2022-10-17 15:37:15 +00:00
|
|
|
_ = viper.BindPFlag(commonflags.Timeout, ff.Lookup(commonflags.Timeout))
|
2022-05-23 16:26:27 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
|
|
|
controlRPC = "endpoint"
|
|
|
|
controlRPCDefault = ""
|
2022-10-11 14:02:03 +00:00
|
|
|
controlRPCUsage = "Remote node control address (as 'multiaddr' or '<host>:<port>')"
|
2022-05-23 16:26:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
Cmd.AddCommand(
|
|
|
|
healthCheckCmd,
|
|
|
|
setNetmapStatusCmd,
|
|
|
|
dropObjectsCmd,
|
|
|
|
shardsCmd,
|
2022-05-16 16:43:29 +00:00
|
|
|
synchronizeTreeCmd,
|
2022-05-23 16:26:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
initControlHealthCheckCmd()
|
|
|
|
initControlSetNetmapStatusCmd()
|
|
|
|
initControlDropObjectsCmd()
|
|
|
|
initControlShardsCmd()
|
2022-05-16 16:43:29 +00:00
|
|
|
initControlSynchronizeTreeCmd()
|
2022-05-23 16:26:27 +00:00
|
|
|
}
|