Airat Arifullin
c42db4e761
* Support healthcheck API call * Support move API call * Support remove API call * Support getSubtree API call * Support getOpLog API call Signed-off-by: Airat Arifullin a.arifullin@yadro.com
65 lines
1.3 KiB
Go
65 lines
1.3 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"
|
|
pathAttributeFlagKey = "pattr"
|
|
|
|
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")
|
|
}
|