2022-06-01 12:42:28 +00:00
|
|
|
package object
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/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`,
|
2024-03-11 14:11:49 +00:00
|
|
|
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
|
2022-06-01 12:42:28 +00:00
|
|
|
// 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,
|
2023-06-20 13:33:05 +00:00
|
|
|
objectLockCmd,
|
2023-10-31 11:56:55 +00:00
|
|
|
objectNodesCmd,
|
2024-08-13 12:01:01 +00:00
|
|
|
objectPatchCmd,
|
2023-10-31 11:56:55 +00:00
|
|
|
}
|
2022-06-01 12:42:28 +00:00
|
|
|
|
|
|
|
Cmd.AddCommand(objectChildCommands...)
|
|
|
|
|
|
|
|
for _, objCommand := range objectChildCommands {
|
|
|
|
InitBearer(objCommand)
|
|
|
|
commonflags.InitAPI(objCommand)
|
|
|
|
}
|
|
|
|
|
|
|
|
initObjectPutCmd()
|
2024-08-13 12:01:01 +00:00
|
|
|
initObjectPatchCmd()
|
2022-06-01 12:42:28 +00:00
|
|
|
initObjectDeleteCmd()
|
|
|
|
initObjectGetCmd()
|
|
|
|
initObjectSearchCmd()
|
|
|
|
initObjectHeadCmd()
|
|
|
|
initObjectHashCmd()
|
|
|
|
initObjectRangeCmd()
|
|
|
|
initCommandObjectLock()
|
2023-06-20 13:33:05 +00:00
|
|
|
initObjectNodesCmd()
|
2022-06-01 12:42:28 +00:00
|
|
|
}
|