2022-05-23 16:26:27 +00:00
|
|
|
package control
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/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,
|
2023-04-25 12:09:20 +00:00
|
|
|
irCmd,
|
2022-05-23 16:26:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
initControlHealthCheckCmd()
|
|
|
|
initControlSetNetmapStatusCmd()
|
|
|
|
initControlDropObjectsCmd()
|
|
|
|
initControlShardsCmd()
|
2022-05-16 16:43:29 +00:00
|
|
|
initControlSynchronizeTreeCmd()
|
2023-04-25 12:09:20 +00:00
|
|
|
initControlIRCmd()
|
2022-05-23 16:26:27 +00:00
|
|
|
}
|