Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add dismissed property to the healthcheck section #10940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 29, 2023
Next Next commit
Stub for debug/health/settings
  • Loading branch information
mtojek committed Nov 24, 2023
commit eb4fd94274725fc430f7c93bac3ea06a69922a78
8 changes: 7 additions & 1 deletion coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,13 @@ func New(options *Options) *API {

r.Get("/coordinator", api.debugCoordinator)
r.Get("/tailnet", api.debugTailnet)
r.Get("/health", api.debugDeploymentHealth)
r.Route("/health", func(r chi.Router) {
r.Get("/", api.debugDeploymentHealth)
r.Route("/settings", func(r chi.Router) {
r.Get("/", api.deploymentHealthSettings)
r.Put("/", api.putDeploymentHealthSettings)
})
})
r.Get("/ws", (&healthcheck.WebsocketEchoServer{}).ServeHTTP)
})
})
Expand Down
24 changes: 24 additions & 0 deletions coderd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,30 @@ func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) {
}
}

// @Summary Get health settings
// @ID get-health-settings
// @Security CoderSessionToken
// @Produce json
// @Tags Debug
// @Success 200 {object} codersdk.HealthSettings
// @Router /debug/health/settings [get]
func (api *API) deploymentHealthSettings(rw http.ResponseWriter, r *http.Request) {
// TODO
}

// @Summary Update health settings
// @ID update-health-settings
// @Security CoderSessionToken
// @Accept json
// @Produce json
// @Tags Debug
// @Param request body codersdk.UpdateHealthSettings true "Update health settings"
// @Success 200 {object} codersdk.UpdateHealthSettings
// @Router /debug/health/settings [put]
func (api *API) putDeploymentHealthSettings(rw http.ResponseWriter, r *http.Request) {
// TODO
}

func formatHealthcheck(ctx context.Context, rw http.ResponseWriter, r *http.Request, hc *healthcheck.Report) {
format := r.URL.Query().Get("format")
switch format {
Expand Down