frostfs-node/cmd/frostfs-cli/modules/tree/root.go
Alexander Chuprov 854200a874
All checks were successful
Vulncheck / Vulncheck (pull_request) Successful in 1m49s
DCO action / DCO (pull_request) Successful in 2m9s
Build / Build Components (1.21) (pull_request) Successful in 3m41s
Build / Build Components (1.22) (pull_request) Successful in 3m53s
Tests and linters / Staticcheck (pull_request) Successful in 5m10s
Tests and linters / gopls check (pull_request) Successful in 5m17s
Tests and linters / Lint (pull_request) Successful in 6m8s
Pre-commit hooks / Pre-commit (pull_request) Successful in 9m52s
Tests and linters / Tests (1.21) (pull_request) Successful in 11m26s
Tests and linters / Tests (1.22) (pull_request) Successful in 11m43s
Tests and linters / Tests with -race (pull_request) Successful in 11m46s
[#1115] node: Remove unused const
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-05-07 19:11:21 +03:00

64 lines
1.2 KiB
Go

package tree
import (
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
"github.com/spf13/cobra"
)
var Cmd = &cobra.Command{
Use: "tree",
Short: "Operations with the Tree service",
}
func init() {
Cmd.AddCommand(addCmd)
Cmd.AddCommand(getByPathCmd)
Cmd.AddCommand(addByPathCmd)
Cmd.AddCommand(listCmd)
Cmd.AddCommand(healthcheckCmd)
Cmd.AddCommand(moveCmd)
Cmd.AddCommand(removeCmd)
Cmd.AddCommand(getSubtreeCmd)
Cmd.AddCommand(getOpLogCmd)
initAddCmd()
initGetByPathCmd()
initAddByPathCmd()
initListCmd()
initHealthcheckCmd()
initMoveCmd()
initRemoveCmd()
initGetSubtreeCmd()
initGetOpLogCmd()
}
const (
treeIDFlagKey = "tid"
parentIDFlagKey = "pid"
nodeIDFlagKey = "nid"
rootIDFlagKey = "root"
metaFlagKey = "meta"
pathFlagKey = "path"
latestOnlyFlagKey = "latest"
bearerFlagKey = "bearer"
heightFlagKey = "height"
countFlagKey = "count"
depthFlagKey = "depth"
)
func initCTID(cmd *cobra.Command) {
ff := cmd.Flags()
ff.String(commonflags.CIDFlag, "", commonflags.CIDFlagUsage)
_ = cmd.MarkFlagRequired(commonflags.CIDFlag)
ff.String(treeIDFlagKey, "", "Tree ID")
_ = cmd.MarkFlagRequired(treeIDFlagKey)
ff.String(bearerFlagKey, "", "Path to bearer token")
}