frostfs-node/cmd/frostfs-cli/modules/control/root.go
Ekaterina Lebedeva df6d9da82a
All checks were successful
DCO action / DCO (pull_request) Successful in 30s
Tests and linters / Run gofumpt (pull_request) Successful in 29s
Vulncheck / Vulncheck (pull_request) Successful in 1m9s
Build / Build Components (pull_request) Successful in 1m34s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m0s
Tests and linters / Staticcheck (pull_request) Successful in 2m2s
Tests and linters / Tests (pull_request) Successful in 2m21s
Tests and linters / Lint (pull_request) Successful in 2m47s
Tests and linters / gopls check (pull_request) Successful in 2m55s
Tests and linters / Tests with -race (pull_request) Successful in 4m13s
Vulncheck / Vulncheck (push) Successful in 1m14s
Pre-commit hooks / Pre-commit (push) Successful in 1m42s
Build / Build Components (push) Successful in 1m53s
Tests and linters / Run gofumpt (push) Successful in 2m7s
Tests and linters / Lint (push) Successful in 2m19s
Tests and linters / Tests with -race (push) Successful in 2m18s
Tests and linters / Tests (push) Successful in 2m37s
Tests and linters / Staticcheck (push) Successful in 2m35s
Tests and linters / gopls check (push) Successful in 3m34s
OCI image / Build container images (push) Successful in 4m25s
[#1635] cli: Add command to get object's shard info
Added `frostfs-cli object locate` subcommand. It lists info
about shards storing an object.

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
2025-03-07 14:32:01 +03:00

57 lines
1.4 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, _ []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,
listTargetsCmd,
locateObjectCmd,
)
initControlHealthCheckCmd()
initControlSetNetmapStatusCmd()
initControlDropObjectsCmd()
initControlShardsCmd()
initControlSynchronizeTreeCmd()
initControlIRCmd()
initControlAddRuleCmd()
initControlRemoveRuleCmd()
initControlListRulesCmd()
initControGetRuleCmd()
initControlListTargetsCmd()
initControlLocateObjectCmd()
}