forked from TrueCloudLab/frostfs-node
Airat Arifullin
66848d3288
* Add methods to frostfs-cli * Implement rpc in control service Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
package control
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
|
"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))
|
|
_ = viper.BindPFlag(commonflags.Timeout, ff.Lookup(commonflags.Timeout))
|
|
},
|
|
}
|
|
|
|
const (
|
|
controlRPC = "endpoint"
|
|
controlRPCDefault = ""
|
|
controlRPCUsage = "Remote node control address (as 'multiaddr' or '<host>:<port>')"
|
|
)
|
|
|
|
func init() {
|
|
Cmd.AddCommand(
|
|
healthCheckCmd,
|
|
setNetmapStatusCmd,
|
|
dropObjectsCmd,
|
|
shardsCmd,
|
|
synchronizeTreeCmd,
|
|
irCmd,
|
|
addRuleCmd,
|
|
removeRuleCmd,
|
|
listRulesCmd,
|
|
getRuleCmd,
|
|
)
|
|
|
|
initControlHealthCheckCmd()
|
|
initControlSetNetmapStatusCmd()
|
|
initControlDropObjectsCmd()
|
|
initControlShardsCmd()
|
|
initControlSynchronizeTreeCmd()
|
|
initControlIRCmd()
|
|
initControlAddRuleCmd()
|
|
initControlRemoveRuleCmd()
|
|
initControlListRulesCmd()
|
|
initControGetRuleCmd()
|
|
}
|