github.hscsec.cn/hashicorp/consul@v1.4.5/command/operator/operator.go (about) 1 package operator 2 3 import ( 4 "github.com/hashicorp/consul/command/flags" 5 "github.com/mitchellh/cli" 6 ) 7 8 func New() *cmd { 9 return &cmd{} 10 } 11 12 type cmd struct{} 13 14 func (c *cmd) Run(args []string) int { 15 return cli.RunResultHelp 16 } 17 18 func (c *cmd) Synopsis() string { 19 return synopsis 20 } 21 22 func (c *cmd) Help() string { 23 return flags.Usage(help, nil) 24 } 25 26 const synopsis = "Provides cluster-level tools for Consul operators" 27 const help = ` 28 Usage: consul operator <subcommand> [options] 29 30 Provides cluster-level tools for Consul operators, such as interacting with 31 the Raft subsystem. NOTE: Use this command with extreme caution, as improper 32 use could lead to a Consul outage and even loss of data. 33 34 If ACLs are enabled then a token with operator privileges may be required in 35 order to use this command. Requests are forwarded internally to the leader 36 if required, so this can be run from any Consul node in a cluster. 37 38 Run consul operator <subcommand> with no arguments for help on that 39 subcommand. 40 `