github.com/aminovpavel/nomad@v0.11.8/command/node.go (about) 1 package command 2 3 import ( 4 "strings" 5 6 "github.com/mitchellh/cli" 7 ) 8 9 type NodeCommand struct { 10 Meta 11 } 12 13 func (f *NodeCommand) Help() string { 14 helpText := ` 15 Usage: nomad node <subcommand> [options] [args] 16 17 This command groups subcommands for interacting with nodes. Nodes in Nomad are 18 agent's that can run submitted workloads. This command can be used to examine 19 nodes and operate on nodes, such as draining workloads off of them. 20 21 Examine the status of a node: 22 23 $ nomad node status <node-id> 24 25 Mark a node as ineligible for running workloads. This is useful when the node 26 is expected to be removed or upgraded so new allocations aren't placed on it: 27 28 $ nomad node eligibility -disable <node-id> 29 30 Mark a node to be drained, allowing batch jobs four hours to finished before 31 forcing them off the node: 32 33 $ nomad node drain -enable -deadline 4h <node-id> 34 35 Please see the individual subcommand help for detailed usage information. 36 ` 37 38 return strings.TrimSpace(helpText) 39 } 40 41 func (f *NodeCommand) Synopsis() string { 42 return "Interact with nodes" 43 } 44 45 func (f *NodeCommand) Name() string { return "node" } 46 47 func (f *NodeCommand) Run(args []string) int { 48 return cli.RunResultHelp 49 }