(deps commandDeps)
| 744 | } |
| 745 | |
| 746 | func newMemoryDecisionsRevertCommand(deps commandDeps) *cobra.Command { |
| 747 | var reason string |
| 748 | var dryRun bool |
| 749 | |
| 750 | cmd := &cobra.Command{ |
| 751 | Use: "revert <id>", |
| 752 | Short: "Revert one Memory v2 controller decision", |
| 753 | Args: exactOneNonBlankArg(), |
| 754 | RunE: func(cmd *cobra.Command, args []string) error { |
| 755 | client, err := clientFromDeps(deps) |
| 756 | if err != nil { |
| 757 | return err |
| 758 | } |
| 759 | response, err := client.RevertMemoryDecision( |
| 760 | cmd.Context(), |
| 761 | strings.TrimSpace(args[0]), |
| 762 | MemoryDecisionRevertRequest{ |
| 763 | Reason: strings.TrimSpace(reason), |
| 764 | DryRun: dryRun, |
| 765 | }, |
| 766 | ) |
| 767 | if err != nil { |
| 768 | return err |
| 769 | } |
| 770 | return writeCommandOutput(cmd, memoryDecisionRevertBundle(response)) |
| 771 | }, |
| 772 | } |
| 773 | cmd.Flags().StringVar(&reason, memoryReasonKey, "", "Operator-visible revert reason") |
| 774 | cmd.Flags().BoolVar(&dryRun, "dry-run", false, "Return the revert decision without applying it") |
| 775 | return cmd |
| 776 | } |
| 777 | |
| 778 | func newMemoryRecallCommand(deps commandDeps) *cobra.Command { |
| 779 | cmd := &cobra.Command{ |
no test coverage detected