forked from TrueCloudLab/frostfs-node
Move to frostfs-node
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
42554a9298
commit
923f84722a
934 changed files with 3470 additions and 3451 deletions
46
cmd/frostfs-cli/modules/storagegroup/root.go
Normal file
46
cmd/frostfs-cli/modules/storagegroup/root.go
Normal file
|
@ -0,0 +1,46 @@
|
|||
package storagegroup
|
||||
|
||||
import (
|
||||
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
||||
objectCli "github.com/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()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue