open-nomad/command/eval.go
Luiz Aoqui 03433dd8af
cli: improve output of eval commands (#13581)
Use the same output format when listing multiple evals in the `eval
list` command and when `eval status <prefix>` matches more than one
eval.

Include the eval namespace in all output formats and always include the
job ID in `eval status` since, even `node-update` evals are related to a
job.

Add Node ID to the evals table output to help differentiate
`node-update` evals.

Co-authored-by: James Rasell <jrasell@hashicorp.com>
2022-07-07 13:13:34 -04:00

47 lines
995 B
Go

package command
import (
"strings"
"github.com/mitchellh/cli"
)
type EvalCommand struct {
Meta
}
func (f *EvalCommand) Help() string {
helpText := `
Usage: nomad eval <subcommand> [options] [args]
This command groups subcommands for interacting with evaluations. Evaluations
are used to trigger a scheduling event. As such, evaluations are an internal
detail but can be useful for debugging placement failures when the cluster
does not have the resources to run a given job.
List evaluations:
$ nomad eval list
Examine an evaluations status:
$ nomad eval status <eval-id>
Delete evaluations:
$ nomad eval delete <eval-id>
Please see the individual subcommand help for detailed usage information.
`
return strings.TrimSpace(helpText)
}
func (f *EvalCommand) Synopsis() string {
return "Interact with evaluations"
}
func (f *EvalCommand) Name() string { return "eval" }
func (f *EvalCommand) Run(_ []string) int { return cli.RunResultHelp }