2022-06-02 12:24:31 +00:00
|
|
|
package container
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2022-10-17 12:03:55 +00:00
|
|
|
// Cmd represents the container command.
|
2022-06-02 12:24:31 +00:00
|
|
|
var Cmd = &cobra.Command{
|
|
|
|
Use: "container",
|
|
|
|
Short: "Operations with containers",
|
|
|
|
Long: "Operations with containers",
|
|
|
|
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() {
|
|
|
|
containerChildCommand := []*cobra.Command{
|
|
|
|
listContainersCmd,
|
|
|
|
createContainerCmd,
|
|
|
|
deleteContainerCmd,
|
|
|
|
listContainerObjectsCmd,
|
|
|
|
getContainerInfoCmd,
|
|
|
|
getExtendedACLCmd,
|
|
|
|
setExtendedACLCmd,
|
2022-10-05 13:52:46 +00:00
|
|
|
containerNodesCmd,
|
2022-06-02 12:24:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Cmd.AddCommand(containerChildCommand...)
|
|
|
|
|
|
|
|
initContainerListContainersCmd()
|
|
|
|
initContainerCreateCmd()
|
|
|
|
initContainerDeleteCmd()
|
|
|
|
initContainerListObjectsCmd()
|
|
|
|
initContainerInfoCmd()
|
|
|
|
initContainerGetEACLCmd()
|
|
|
|
initContainerSetEACLCmd()
|
2022-10-05 13:52:46 +00:00
|
|
|
initContainerNodesCmd()
|
2022-06-02 12:24:31 +00:00
|
|
|
|
|
|
|
for _, containerCommand := range containerChildCommand {
|
|
|
|
commonflags.InitAPI(containerCommand)
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, cmd := range []*cobra.Command{
|
|
|
|
createContainerCmd,
|
|
|
|
deleteContainerCmd,
|
|
|
|
setExtendedACLCmd,
|
|
|
|
} {
|
|
|
|
commonflags.InitSession(cmd)
|
|
|
|
}
|
|
|
|
}
|