Skip to content

Commit eb4fd94

Browse files
committed
Stub for debug/health/settings
1 parent b501046 commit eb4fd94

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

coderd/coderd.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,13 @@ func New(options *Options) *API {
956956

957957
r.Get("/coordinator", api.debugCoordinator)
958958
r.Get("/tailnet", api.debugTailnet)
959-
r.Get("/health", api.debugDeploymentHealth)
959+
r.Route("/health", func(r chi.Router) {
960+
r.Get("/", api.debugDeploymentHealth)
961+
r.Route("/settings", func(r chi.Router) {
962+
r.Get("/", api.deploymentHealthSettings)
963+
r.Put("/", api.putDeploymentHealthSettings)
964+
})
965+
})
960966
r.Get("/ws", (&healthcheck.WebsocketEchoServer{}).ServeHTTP)
961967
})
962968
})

coderd/debug.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,30 @@ func (api *API) debugDeploymentHealth(rw http.ResponseWriter, r *http.Request) {
8282
}
8383
}
8484

85+
// @Summary Get health settings
86+
// @ID get-health-settings
87+
// @Security CoderSessionToken
88+
// @Produce json
89+
// @Tags Debug
90+
// @Success 200 {object} codersdk.HealthSettings
91+
// @Router /debug/health/settings [get]
92+
func (api *API) deploymentHealthSettings(rw http.ResponseWriter, r *http.Request) {
93+
// TODO
94+
}
95+
96+
// @Summary Update health settings
97+
// @ID update-health-settings
98+
// @Security CoderSessionToken
99+
// @Accept json
100+
// @Produce json
101+
// @Tags Debug
102+
// @Param request body codersdk.UpdateHealthSettings true "Update health settings"
103+
// @Success 200 {object} codersdk.UpdateHealthSettings
104+
// @Router /debug/health/settings [put]
105+
func (api *API) putDeploymentHealthSettings(rw http.ResponseWriter, r *http.Request) {
106+
// TODO
107+
}
108+
85109
func formatHealthcheck(ctx context.Context, rw http.ResponseWriter, r *http.Request, hc *healthcheck.Report) {
86110
format := r.URL.Query().Get("format")
87111
switch format {

0 commit comments

Comments
 (0)