(ctx context.Context, runnerScaleSetID int)
| 70 | } |
| 71 | |
| 72 | func (s *ScaleSetClient) GetRunnerScaleSetByID(ctx context.Context, runnerScaleSetID int) (_ params.RunnerScaleSet, err error) { |
| 73 | s.recordOperation("GetRunnerScaleSetByID") |
| 74 | defer func() { |
| 75 | if err != nil { |
| 76 | s.recordFailedOperation("GetRunnerScaleSetByID") |
| 77 | } |
| 78 | }() |
| 79 | |
| 80 | path := fmt.Sprintf("%s/%d", scaleSetEndpoint, runnerScaleSetID) |
| 81 | req, err := s.newActionsRequest(ctx, http.MethodGet, path, nil) |
| 82 | if err != nil { |
| 83 | return params.RunnerScaleSet{}, err |
| 84 | } |
| 85 | |
| 86 | resp, err := s.Do(req) |
| 87 | if err != nil { |
| 88 | return params.RunnerScaleSet{}, fmt.Errorf("failed to get runner scaleset with ID %d: %w", runnerScaleSetID, err) |
| 89 | } |
| 90 | defer resp.Body.Close() |
| 91 | |
| 92 | var runnerScaleSet params.RunnerScaleSet |
| 93 | if err := json.NewDecoder(resp.Body).Decode(&runnerScaleSet); err != nil { |
| 94 | return params.RunnerScaleSet{}, fmt.Errorf("failed to decode response: %w", err) |
| 95 | } |
| 96 | return runnerScaleSet, nil |
| 97 | } |
| 98 | |
| 99 | // ListRunnerScaleSets lists all runner scale sets in a github entity. |
| 100 | func (s *ScaleSetClient) ListRunnerScaleSets(ctx context.Context) (_ *params.RunnerScaleSetsResponse, err error) { |
nothing calls this directly
no test coverage detected