Skip to content

Commit dea8070

Browse files
committed
add postworkspaceagentapphealth
1 parent 18fb1a5 commit dea8070

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

codersdk/workspaceagents.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,18 @@ func (c *Client) MyWorkspaceAgent(ctx context.Context) (WorkspaceAgent, error) {
362362
return workspaceAgent, json.NewDecoder(res.Body).Decode(&workspaceAgent)
363363
}
364364

365+
// WorkspaceAgent returns the requesting agent.
366+
func (c *Client) PostWorkspaceAgentAppHealth(ctx context.Context, req PostWorkspaceAppHealthsRequest) error {
367+
res, err := c.Request(ctx, http.MethodPost, "/api/v2/workspaceagents/me/version", req)
368+
if err != nil {
369+
return readBodyAsError(res)
370+
}
371+
// Discord the response
372+
_, _ = io.Copy(io.Discard, res.Body)
373+
_ = res.Body.Close()
374+
return nil
375+
}
376+
365377
func (c *Client) PostWorkspaceAgentVersion(ctx context.Context, version string) error {
366378
// Phone home and tell the mothership what version we're on.
367379
versionReq := PostWorkspaceAgentVersionRequest{Version: version}

0 commit comments

Comments
 (0)