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

Method ListRunnerScaleSets

util/github/scalesets/scalesets.go:100–128  ·  view source on GitHub ↗

ListRunnerScaleSets lists all runner scale sets in a github entity.

(ctx context.Context)

Source from the content-addressed store, hash-verified

98
99// ListRunnerScaleSets lists all runner scale sets in a github entity.
100func (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
130func applyDefaultLabelTypes(labels []params.Label) []params.Label {
131 for i, label := range labels {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected