mirror of
https://github.com/hashicorp/vault.git
synced 2025-12-08 11:01:47 +01:00
Added operator raft and operator raft snapshot descriptions (#7106)
This commit is contained in:
parent
aaad1e3c8c
commit
757b039ee4
@ -327,6 +327,11 @@ func initCommands(ui, serverCmdUi cli.Ui, runOpts *RunOptions) {
|
|||||||
ShutdownCh: MakeShutdownCh(),
|
ShutdownCh: MakeShutdownCh(),
|
||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
|
"operator raft": func() (cli.Command, error) {
|
||||||
|
return &OperatorRaftCommand{
|
||||||
|
BaseCommand: getBaseCommand(),
|
||||||
|
}, nil
|
||||||
|
},
|
||||||
"operator raft configuration": func() (cli.Command, error) {
|
"operator raft configuration": func() (cli.Command, error) {
|
||||||
return &OperatorRaftConfigurationCommand{
|
return &OperatorRaftConfigurationCommand{
|
||||||
BaseCommand: getBaseCommand(),
|
BaseCommand: getBaseCommand(),
|
||||||
@ -342,6 +347,11 @@ func initCommands(ui, serverCmdUi cli.Ui, runOpts *RunOptions) {
|
|||||||
BaseCommand: getBaseCommand(),
|
BaseCommand: getBaseCommand(),
|
||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
|
"operator raft snapshot": func() (cli.Command, error) {
|
||||||
|
return &OperatorRaftSnapshotCommand{
|
||||||
|
BaseCommand: getBaseCommand(),
|
||||||
|
}, nil
|
||||||
|
},
|
||||||
"operator raft snapshot restore": func() (cli.Command, error) {
|
"operator raft snapshot restore": func() (cli.Command, error) {
|
||||||
return &OperatorRaftSnapshotRestoreCommand{
|
return &OperatorRaftSnapshotRestoreCommand{
|
||||||
BaseCommand: getBaseCommand(),
|
BaseCommand: getBaseCommand(),
|
||||||
|
|||||||
47
command/operator_raft.go
Normal file
47
command/operator_raft.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/mitchellh/cli"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ cli.Command = (*OperatorRaftCommand)(nil)
|
||||||
|
|
||||||
|
type OperatorRaftCommand struct {
|
||||||
|
*BaseCommand
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *OperatorRaftCommand) Synopsis() string {
|
||||||
|
return "Interact with Vault's raft storage backend"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *OperatorRaftCommand) Help() string {
|
||||||
|
helpText := `
|
||||||
|
Usage: vault operator raft <subcommand> [options] [args]
|
||||||
|
|
||||||
|
This command groups subcommands for operators interacting with the Vault raft storage backend. Most
|
||||||
|
users will not need to interact with these commands. Here are a few examples
|
||||||
|
of the raft operator commands:
|
||||||
|
|
||||||
|
Joins a node to the raft cluster:
|
||||||
|
|
||||||
|
$ vault operator raft join https://127.0.0.1:8200
|
||||||
|
|
||||||
|
Returns the raft cluster configuration:
|
||||||
|
|
||||||
|
$ vault operator raft configuration
|
||||||
|
|
||||||
|
Removes a node from the raft cluster:
|
||||||
|
|
||||||
|
$ vault operator raft remove-peer
|
||||||
|
|
||||||
|
Please see the individual subcommand help for detailed usage information.
|
||||||
|
`
|
||||||
|
|
||||||
|
return strings.TrimSpace(helpText)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *OperatorRaftCommand) Run(args []string) int {
|
||||||
|
return cli.RunResultHelp
|
||||||
|
}
|
||||||
42
command/operator_raft_snapshot.go
Normal file
42
command/operator_raft_snapshot.go
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/mitchellh/cli"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ cli.Command = (*OperatorRaftSnapshotCommand)(nil)
|
||||||
|
|
||||||
|
type OperatorRaftSnapshotCommand struct {
|
||||||
|
*BaseCommand
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *OperatorRaftSnapshotCommand) Synopsis() string {
|
||||||
|
return "Restores and saves snapshots from the raft cluster"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *OperatorRaftSnapshotCommand) Help() string {
|
||||||
|
helpText := `
|
||||||
|
Usage: vault operator raft snapshot <subcommand> [options] [args]
|
||||||
|
|
||||||
|
This command groups subcommands for operators interacting with the snapshot functionality of
|
||||||
|
the raft storage backend. Here are a few examples of the raft snapshot operator commands:
|
||||||
|
|
||||||
|
Installs the provided snapshot, returning the cluster to the state defined in it:
|
||||||
|
|
||||||
|
$ vault operator raft snapshot restore raft.snap
|
||||||
|
|
||||||
|
Saves a snapshot of the current state of the raft cluster into a file:
|
||||||
|
|
||||||
|
$ vault operator raft snapshot save raft.snap
|
||||||
|
|
||||||
|
Please see the individual subcommand help for detailed usage information.
|
||||||
|
`
|
||||||
|
|
||||||
|
return strings.TrimSpace(helpText)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *OperatorRaftSnapshotCommand) Run(args []string) int {
|
||||||
|
return cli.RunResultHelp
|
||||||
|
}
|
||||||
@ -18,7 +18,7 @@ type OperatorRaftSnapshotRestoreCommand struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *OperatorRaftSnapshotRestoreCommand) Synopsis() string {
|
func (c *OperatorRaftSnapshotRestoreCommand) Synopsis() string {
|
||||||
return "Installs the provided snapshot, returning the cluster to the state defined in it."
|
return "Installs the provided snapshot, returning the cluster to the state defined in it"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *OperatorRaftSnapshotRestoreCommand) Help() string {
|
func (c *OperatorRaftSnapshotRestoreCommand) Help() string {
|
||||||
|
|||||||
@ -17,7 +17,7 @@ type OperatorRaftSnapshotSaveCommand struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *OperatorRaftSnapshotSaveCommand) Synopsis() string {
|
func (c *OperatorRaftSnapshotSaveCommand) Synopsis() string {
|
||||||
return "Saves a snapshot of the current state of the raft cluster into a file."
|
return "Saves a snapshot of the current state of the raft cluster into a file"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *OperatorRaftSnapshotSaveCommand) Help() string {
|
func (c *OperatorRaftSnapshotSaveCommand) Help() string {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user