MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / NewCmdView

Function NewCmdView

pkg/cmd/workerpool/view/view.go:21–40  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

19)
20
21func 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
42func ViewRun(opts *shared.ViewOptions) error {
43 var workerPool, err = opts.Client.WorkerPools.GetByIdentifier(opts.IdOrName)

Callers

nothing calls this directly

Calls 5

NewViewFlagsFunction · 0.92
ExactArgsFunction · 0.92
NewViewOptionsFunction · 0.92
RegisterWebFlagFunction · 0.92
ViewRunFunction · 0.70

Tested by

no test coverage detected