[#1381] neofs-cli: Move control
command to a separate module
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
71d823f192
commit
d9c5ca5e77
14 changed files with 638 additions and 590 deletions
42
cmd/neofs-cli/modules/control/root.go
Normal file
42
cmd/neofs-cli/modules/control/root.go
Normal file
|
@ -0,0 +1,42 @@
|
|||
package control
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-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))
|
||||
},
|
||||
}
|
||||
|
||||
const (
|
||||
controlRPC = "endpoint"
|
||||
controlRPCDefault = ""
|
||||
controlRPCUsage = "remote node control address (as 'multiaddr' or '<host>:<port>')"
|
||||
)
|
||||
|
||||
func init() {
|
||||
Cmd.AddCommand(
|
||||
healthCheckCmd,
|
||||
setNetmapStatusCmd,
|
||||
dropObjectsCmd,
|
||||
snapshotCmd,
|
||||
shardsCmd,
|
||||
)
|
||||
|
||||
initControlHealthCheckCmd()
|
||||
initControlSetNetmapStatusCmd()
|
||||
initControlDropObjectsCmd()
|
||||
initControlSnapshotCmd()
|
||||
initControlShardsCmd()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue