(ctx context.Context)
| 101 | } |
| 102 | |
| 103 | func (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 | |
| 130 | func (s *ScaleSetClient) GetRunnerByName(ctx context.Context, runnerName string) (_ params.RunnerReference, err error) { |
| 131 | s.recordOperation("GetRunnerByName") |
no test coverage detected