2023-04-10 15:36:59 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2017-12-18 21:16:23 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
type OperatorAutopilotCommand struct {
|
|
|
|
Meta
|
|
|
|
}
|
|
|
|
|
2018-04-18 16:02:11 +00:00
|
|
|
func (c *OperatorAutopilotCommand) Name() string { return "operator autopilot" }
|
|
|
|
|
2017-12-18 21:16:23 +00:00
|
|
|
func (c *OperatorAutopilotCommand) Run(args []string) int {
|
|
|
|
return cli.RunResultHelp
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *OperatorAutopilotCommand) Synopsis() string {
|
|
|
|
return "Provides tools for modifying Autopilot configuration"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *OperatorAutopilotCommand) Help() string {
|
|
|
|
helpText := `
|
2018-01-17 08:20:13 +00:00
|
|
|
Usage: nomad operator autopilot <subcommand> [options]
|
2017-12-18 21:16:23 +00:00
|
|
|
|
2018-03-21 21:04:54 +00:00
|
|
|
This command groups subcommands for interacting with Nomad's Autopilot
|
|
|
|
subsystem. Autopilot provides automatic, operator-friendly management of Nomad
|
|
|
|
servers. The command can be used to view or modify the current Autopilot
|
2018-04-12 14:02:32 +00:00
|
|
|
configuration. For a full guide see: https://www.nomadproject.io/guides/autopilot.html
|
2018-03-21 21:04:54 +00:00
|
|
|
|
|
|
|
Get the current Autopilot configuration:
|
|
|
|
|
|
|
|
$ nomad operator autopilot get-config
|
2018-04-18 16:02:11 +00:00
|
|
|
|
2018-03-21 21:04:54 +00:00
|
|
|
Set a new Autopilot configuration, enabling automatic dead server cleanup:
|
|
|
|
|
|
|
|
$ nomad operator autopilot set-config -cleanup-dead-servers=true
|
2018-04-18 16:02:11 +00:00
|
|
|
|
2018-03-21 21:04:54 +00:00
|
|
|
Please see the individual subcommand help for detailed usage information.
|
|
|
|
`
|
2017-12-18 21:16:23 +00:00
|
|
|
return strings.TrimSpace(helpText)
|
|
|
|
}
|