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

Function ViewRun

pkg/cmd/worker/shared/view.go:40–73  ·  view source on GitHub ↗
(opts *ViewOptions, contributeEndpoint ContributeEndpointCallback, description string)

Source from the content-addressed store, hash-verified

38}
39
40func ViewRun(opts *ViewOptions, contributeEndpoint ContributeEndpointCallback, description string) error {
41 var worker, err = opts.Client.Workers.GetByIdentifier(opts.IdOrName)
42 if err != nil {
43 return err
44 }
45
46 data := []*output.DataRow{}
47
48 data = append(data, output.NewDataRow("Name", fmt.Sprintf("%s %s", output.Bold(worker.Name), output.Dimf("(%s)", worker.GetID()))))
49 data = append(data, output.NewDataRow("Health status", getHealthStatus(worker)))
50 data = append(data, output.NewDataRow("Current status", worker.StatusSummary))
51
52 workerPoolMap, err := GetWorkerPoolMap(opts)
53 workerPoolNames := resolveValues(worker.WorkerPoolIDs, workerPoolMap)
54 data = append(data, output.NewDataRow("Worker Pools", output.FormatAsList(workerPoolNames)))
55
56 if contributeEndpoint != nil {
57 newRows, err := contributeEndpoint(opts, worker.Endpoint)
58 if err != nil {
59 return err
60 }
61 for _, r := range newRows {
62 data = append(data, r)
63 }
64 }
65
66 output.PrintRows(data, opts.Out)
67
68 fmt.Fprintf(opts.Out, "\n")
69 machinescommon.DoWebForWorkers(worker, opts.Dependencies, opts.WebFlags, description)
70 return nil
71
72 return nil
73}
74
75func ContributeProxy(opts *ViewOptions, proxyID string) ([]*output.DataRow, error) {
76 if proxyID != "" {

Callers 3

ViewRunFunction · 0.92
ViewRunFunction · 0.92
ViewRunFunction · 0.92

Calls 10

NewDataRowFunction · 0.92
BoldFunction · 0.92
DimfFunction · 0.92
FormatAsListFunction · 0.92
PrintRowsFunction · 0.92
DoWebForWorkersFunction · 0.92
getHealthStatusFunction · 0.85
GetWorkerPoolMapFunction · 0.70
resolveValuesFunction · 0.70
contributeEndpointFunction · 0.50

Tested by

no test coverage detected