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

Function ViewRun

pkg/cmd/workerpool/view/view.go:42–71  ·  view source on GitHub ↗
(opts *shared.ViewOptions)

Source from the content-addressed store, hash-verified

40}
41
42func ViewRun(opts *shared.ViewOptions) error {
43 var workerPool, err = opts.Client.WorkerPools.GetByIdentifier(opts.IdOrName)
44 if err != nil {
45 return err
46 }
47
48 err = output.PrintResource(workerPool, opts.Command, output.Mappers[workerpools.IWorkerPool]{
49 Json: func(wp workerpools.IWorkerPool) any {
50 return getWorkerPoolAsJson(opts, wp)
51 },
52 Table: output.TableDefinition[workerpools.IWorkerPool]{
53 Header: []string{"NAME", "TYPE", "DEFAULT", "WORKERS", "HEALTHY", "UNHEALTHY"},
54 Row: func(wp workerpools.IWorkerPool) []string {
55 return getWorkerPoolAsTableRow(opts, wp)
56 },
57 },
58 Basic: func(wp workerpools.IWorkerPool) string {
59 return getWorkerPoolAsBasic(opts, wp)
60 },
61 })
62 if err != nil {
63 return err
64 }
65
66 if opts.WebFlags != nil && opts.WebFlags.Web.Value {
67 machinescommon.DoWebForWorkerPools(workerPool, opts.Dependencies, opts.WebFlags)
68 }
69
70 return nil
71}
72
73type WorkerPoolAsJson struct {
74 Id string `json:"Id"`

Callers 1

NewCmdViewFunction · 0.70

Calls 5

PrintResourceFunction · 0.92
DoWebForWorkerPoolsFunction · 0.92
getWorkerPoolAsJsonFunction · 0.85
getWorkerPoolAsTableRowFunction · 0.85
getWorkerPoolAsBasicFunction · 0.85

Tested by

no test coverage detected