2022-06-01 12:42:28 +00:00
|
|
|
package object
|
|
|
|
|
|
|
|
import (
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
2022-06-01 12:42:28 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2022-10-17 12:03:55 +00:00
|
|
|
// Cmd represents the object command.
|
2022-06-01 12:42:28 +00:00
|
|
|
var Cmd = &cobra.Command{
|
|
|
|
Use: "object",
|
|
|
|
Short: "Operations with Objects",
|
|
|
|
Long: `Operations with Objects`,
|
|
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
|
|
// bind exactly that cmd's flags to
|
|
|
|
// the viper before execution
|
|
|
|
commonflags.Bind(cmd)
|
|
|
|
commonflags.BindAPI(cmd)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
objectChildCommands := []*cobra.Command{
|
|
|
|
objectPutCmd,
|
|
|
|
objectDelCmd,
|
|
|
|
objectGetCmd,
|
|
|
|
objectSearchCmd,
|
|
|
|
objectHeadCmd,
|
|
|
|
objectHashCmd,
|
|
|
|
objectRangeCmd,
|
|
|
|
objectLockCmd}
|
|
|
|
|
|
|
|
Cmd.AddCommand(objectChildCommands...)
|
|
|
|
|
|
|
|
for _, objCommand := range objectChildCommands {
|
|
|
|
InitBearer(objCommand)
|
|
|
|
commonflags.InitAPI(objCommand)
|
|
|
|
}
|
|
|
|
|
|
|
|
initObjectPutCmd()
|
|
|
|
initObjectDeleteCmd()
|
|
|
|
initObjectGetCmd()
|
|
|
|
initObjectSearchCmd()
|
|
|
|
initObjectHeadCmd()
|
|
|
|
initObjectHashCmd()
|
|
|
|
initObjectRangeCmd()
|
|
|
|
initCommandObjectLock()
|
|
|
|
}
|