2023-03-28 19:12:30 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 19:12:30 +00:00
|
|
|
|
2017-10-17 11:28:51 +00:00
|
|
|
package operator
|
2016-08-30 02:09:57 +00:00
|
|
|
|
|
|
|
import (
|
2017-10-17 13:44:20 +00:00
|
|
|
"github.com/hashicorp/consul/command/flags"
|
2017-02-15 21:30:07 +00:00
|
|
|
"github.com/mitchellh/cli"
|
2016-08-30 02:09:57 +00:00
|
|
|
)
|
|
|
|
|
2017-10-17 05:58:03 +00:00
|
|
|
func New() *cmd {
|
|
|
|
return &cmd{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type cmd struct{}
|
|
|
|
|
|
|
|
func (c *cmd) Run(args []string) int {
|
|
|
|
return cli.RunResultHelp
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *cmd) Synopsis() string {
|
2017-10-17 13:44:20 +00:00
|
|
|
return synopsis
|
2016-08-30 02:09:57 +00:00
|
|
|
}
|
|
|
|
|
2017-10-17 05:58:03 +00:00
|
|
|
func (c *cmd) Help() string {
|
2017-10-17 22:00:01 +00:00
|
|
|
return flags.Usage(help, nil)
|
2017-10-17 13:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const synopsis = "Provides cluster-level tools for Consul operators"
|
|
|
|
const help = `
|
|
|
|
Usage: consul operator <subcommand> [options]
|
2016-08-30 02:09:57 +00:00
|
|
|
|
|
|
|
Provides cluster-level tools for Consul operators, such as interacting with
|
|
|
|
the Raft subsystem. NOTE: Use this command with extreme caution, as improper
|
|
|
|
use could lead to a Consul outage and even loss of data.
|
|
|
|
|
2016-11-16 09:04:37 +00:00
|
|
|
If ACLs are enabled then a token with operator privileges may be required in
|
2016-08-30 02:09:57 +00:00
|
|
|
order to use this command. Requests are forwarded internally to the leader
|
|
|
|
if required, so this can be run from any Consul node in a cluster.
|
|
|
|
|
|
|
|
Run consul operator <subcommand> with no arguments for help on that
|
|
|
|
subcommand.
|
|
|
|
`
|