MCPcopy Create free account
hub / github.com/coder/coder / DebugHealth

Method DebugHealth

codersdk/healthsdk/healthsdk.go:57–68  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

55}
56
57func (c *HealthClient) DebugHealth(ctx context.Context) (HealthcheckReport, error) {
58 res, err := c.client.Request(ctx, http.MethodGet, "/api/v2/debug/health", nil)
59 if err != nil {
60 return HealthcheckReport{}, err
61 }
62 defer res.Body.Close()
63 if res.StatusCode != http.StatusOK {
64 return HealthcheckReport{}, codersdk.ReadBodyAsError(res)
65 }
66 var rpt HealthcheckReport
67 return rpt, json.NewDecoder(res.Body).Decode(&rpt)
68}
69
70func (c *HealthClient) HealthSettings(ctx context.Context) (HealthSettings, error) {
71 res, err := c.client.Request(ctx, http.MethodGet, "/api/v2/debug/health/settings", nil)

Callers 1

DeploymentInfoFunction · 0.80

Calls 3

ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
RequestMethod · 0.45

Tested by

no test coverage detected