frostfs-node/cmd/frostfs-cli/modules/storagegroup/root.go
Alex Vanin 20de74a505 Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 16:38:26 +03:00

46 lines
1,003 B
Go

package storagegroup
import (
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
objectCli "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/modules/object"
"github.com/spf13/cobra"
)
// Cmd represents the storagegroup command.
var Cmd = &cobra.Command{
Use: "storagegroup",
Short: "Operations with Storage Groups",
Long: `Operations with Storage Groups`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// bind exactly that cmd's flags to
// the viper before execution
commonflags.Bind(cmd)
commonflags.BindAPI(cmd)
},
}
const (
sgIDFlag = "id"
sgRawFlag = "raw"
)
func init() {
storageGroupChildCommands := []*cobra.Command{
sgPutCmd,
sgGetCmd,
sgListCmd,
sgDelCmd,
}
Cmd.AddCommand(storageGroupChildCommands...)
for _, sgCommand := range storageGroupChildCommands {
objectCli.InitBearer(sgCommand)
commonflags.InitAPI(sgCommand)
}
initSGPutCmd()
initSGGetCmd()
initSGListCmd()
initSGDeleteCmd()
}