forked from TrueCloudLab/frostfs-node
[#1332] cli: Implement tree add
command
It is `TreeService.Add` method implementation. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
13c4a9f4b8
commit
2c02e66939
4 changed files with 171 additions and 0 deletions
34
cmd/neofs-cli/modules/tree/root.go
Normal file
34
cmd/neofs-cli/modules/tree/root.go
Normal file
|
@ -0,0 +1,34 @@
|
|||
package tree
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var Cmd = &cobra.Command{
|
||||
Use: "tree",
|
||||
Short: "Operations with the Tree service",
|
||||
}
|
||||
|
||||
func init() {
|
||||
Cmd.AddCommand(addCmd)
|
||||
|
||||
initAddCmd()
|
||||
}
|
||||
|
||||
const (
|
||||
containerIDFlagKey = "cid"
|
||||
treeIDFlagKey = "tid"
|
||||
parentIDFlagKey = "pid"
|
||||
|
||||
metaFlagKey = "meta"
|
||||
)
|
||||
|
||||
func initCTID(cmd *cobra.Command) {
|
||||
ff := cmd.Flags()
|
||||
|
||||
ff.String(containerIDFlagKey, "", "Container ID")
|
||||
_ = cmd.MarkFlagRequired(containerIDFlagKey)
|
||||
|
||||
ff.String(treeIDFlagKey, "", "Tree ID")
|
||||
_ = cmd.MarkFlagRequired(treeIDFlagKey)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue