MCPcopy Create free account
hub / github.com/cloudbase/garm / ListAllRunners

Method ListAllRunners

util/github/scalesets/runners.go:103–128  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

101}
102
103func (s *ScaleSetClient) ListAllRunners(ctx context.Context) (_ params.RunnerReferenceList, err error) {
104 s.recordOperation("ListAllRunners")
105 defer func() {
106 if err != nil {
107 s.recordFailedOperation("ListAllRunners")
108 }
109 }()
110
111 req, err := s.newActionsRequest(ctx, http.MethodGet, runnerEndpoint, nil)
112 if err != nil {
113 return params.RunnerReferenceList{}, fmt.Errorf("failed to construct request: %w", err)
114 }
115
116 resp, err := s.Do(req)
117 if err != nil {
118 return params.RunnerReferenceList{}, fmt.Errorf("request failed for %s: %w", req.URL.String(), err)
119 }
120 defer resp.Body.Close()
121
122 var runnerList params.RunnerReferenceList
123 if err := json.NewDecoder(resp.Body).Decode(&runnerList); err != nil {
124 return params.RunnerReferenceList{}, fmt.Errorf("failed to decode response: %w", err)
125 }
126
127 return runnerList, nil
128}
129
130func (s *ScaleSetClient) GetRunnerByName(ctx context.Context, runnerName string) (_ params.RunnerReference, err error) {
131 s.recordOperation("GetRunnerByName")

Callers 2

Calls 6

recordOperationMethod · 0.95
recordFailedOperationMethod · 0.95
newActionsRequestMethod · 0.95
DoMethod · 0.95
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected