ListRunnerScaleSets lists all runner scale sets in a github entity.
(ctx context.Context)
| 98 | |
| 99 | // ListRunnerScaleSets lists all runner scale sets in a github entity. |
| 100 | func (s *ScaleSetClient) ListRunnerScaleSets(ctx context.Context) (_ *params.RunnerScaleSetsResponse, err error) { |
| 101 | s.recordOperation("ListRunnerScaleSets") |
| 102 | defer func() { |
| 103 | if err != nil { |
| 104 | s.recordFailedOperation("ListRunnerScaleSets") |
| 105 | } |
| 106 | }() |
| 107 | |
| 108 | req, err := s.newActionsRequest(ctx, http.MethodGet, scaleSetEndpoint, nil) |
| 109 | if err != nil { |
| 110 | return nil, err |
| 111 | } |
| 112 | data, err := httputil.DumpRequest(req, false) |
| 113 | if err == nil { |
| 114 | fmt.Println(string(data)) |
| 115 | } |
| 116 | resp, err := s.Do(req) |
| 117 | if err != nil { |
| 118 | return nil, fmt.Errorf("failed to list runner scale sets: %w", err) |
| 119 | } |
| 120 | defer resp.Body.Close() |
| 121 | |
| 122 | var runnerScaleSetList params.RunnerScaleSetsResponse |
| 123 | if err := json.NewDecoder(resp.Body).Decode(&runnerScaleSetList); err != nil { |
| 124 | return nil, fmt.Errorf("failed to decode response: %w", err) |
| 125 | } |
| 126 | |
| 127 | return &runnerScaleSetList, nil |
| 128 | } |
| 129 | |
| 130 | func applyDefaultLabelTypes(labels []params.Label) []params.Label { |
| 131 | for i, label := range labels { |
nothing calls this directly
no test coverage detected