(f factory.Factory)
| 19 | ) |
| 20 | |
| 21 | func NewCmdView(f factory.Factory) *cobra.Command { |
| 22 | flags := shared.NewViewFlags() |
| 23 | cmd := &cobra.Command{ |
| 24 | Args: usage.ExactArgs(1), |
| 25 | Use: "view {<name> | <id>}", |
| 26 | Short: "View a worker pool", |
| 27 | Long: "View a worker pool in Octopus Deploy", |
| 28 | Example: heredoc.Docf(` |
| 29 | %[1]s worker-pool view WorkerPools-3 |
| 30 | %[1]s worker-pool view 'linux workers' |
| 31 | `, constants.ExecutableName), |
| 32 | RunE: func(c *cobra.Command, args []string) error { |
| 33 | return ViewRun(shared.NewViewOptions(flags, cmd.NewDependencies(f, c), args, c)) |
| 34 | }, |
| 35 | } |
| 36 | |
| 37 | machinescommon.RegisterWebFlag(cmd, flags.WebFlags) |
| 38 | |
| 39 | return cmd |
| 40 | } |
| 41 | |
| 42 | func ViewRun(opts *shared.ViewOptions) error { |
| 43 | var workerPool, err = opts.Client.WorkerPools.GetByIdentifier(opts.IdOrName) |
nothing calls this directly
no test coverage detected