github.com/ThomasObenaus/nomad@v0.11.1/command/system_reconcile_summaries.go (about) 1 package command 2 3 import ( 4 "fmt" 5 "strings" 6 7 "github.com/posener/complete" 8 ) 9 10 type SystemReconcileSummariesCommand struct { 11 Meta 12 } 13 14 func (c *SystemReconcileSummariesCommand) Help() string { 15 helpText := ` 16 Usage: nomad system reconcile summaries [options] 17 18 Reconciles the summaries of all registered jobs. 19 20 General Options: 21 22 ` + generalOptionsUsage() 23 return strings.TrimSpace(helpText) 24 } 25 26 func (c *SystemReconcileSummariesCommand) Synopsis() string { 27 return "Reconciles the summaries of all registered jobs" 28 } 29 30 func (c *SystemReconcileSummariesCommand) AutocompleteFlags() complete.Flags { 31 return c.Meta.AutocompleteFlags(FlagSetClient) 32 } 33 34 func (c *SystemReconcileSummariesCommand) AutocompleteArgs() complete.Predictor { 35 return complete.PredictNothing 36 } 37 38 func (c *SystemReconcileSummariesCommand) Name() string { return "system reconcile summaries" } 39 40 func (c *SystemReconcileSummariesCommand) Run(args []string) int { 41 42 // Get the HTTP client 43 client, err := c.Meta.Client() 44 if err != nil { 45 c.Ui.Error(fmt.Sprintf("Error initializing client: %s", err)) 46 return 1 47 } 48 49 if err := client.System().ReconcileSummaries(); err != nil { 50 c.Ui.Error(fmt.Sprintf("Error running system summary reconciliation: %s", err)) 51 return 1 52 } 53 return 0 54 }