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

Method DeleteRunnerScaleSet

util/github/scalesets/scalesets.go:206–232  ·  view source on GitHub ↗
(ctx context.Context, runnerScaleSetID int)

Source from the content-addressed store, hash-verified

204}
205
206func (s *ScaleSetClient) DeleteRunnerScaleSet(ctx context.Context, runnerScaleSetID int) (err error) {
207 s.recordOperation("DeleteRunnerScaleSet")
208 defer func() {
209 if err != nil {
210 s.recordFailedOperation("DeleteRunnerScaleSet")
211 }
212 }()
213
214 path := fmt.Sprintf("%s/%d", scaleSetEndpoint, runnerScaleSetID)
215 req, err := s.newActionsRequest(ctx, http.MethodDelete, path, nil)
216 if err != nil {
217 return err
218 }
219
220 client := &http.Client{}
221 resp, err := client.Do(req) //nolint:gosec // G704 - URL is constructed from GitHub API endpoints
222 if err != nil {
223 return err
224 }
225 defer resp.Body.Close()
226
227 if resp.StatusCode != http.StatusNoContent {
228 return fmt.Errorf("failed to delete scale set with code %d", resp.StatusCode)
229 }
230
231 return nil
232}
233
234func (s *ScaleSetClient) GetRunnerGroupByName(ctx context.Context, runnerGroup string) (_ params.RunnerGroup, err error) {
235 s.recordOperation("GetRunnerGroupByName")

Callers 2

DeleteScaleSetByIDMethod · 0.80
CreateEntityScaleSetMethod · 0.80

Calls 5

recordOperationMethod · 0.95
recordFailedOperationMethod · 0.95
newActionsRequestMethod · 0.95
DoMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected