feat: use v2 API for agent lifecycle updates (#12278)

Agent uses the v2 API to post lifecycle updates.

Part of #10534
This commit is contained in:
Spike Curtis
2024-02-23 15:24:28 +04:00
committed by GitHub
parent ee7828a166
commit aa7a9f5cc4
5 changed files with 100 additions and 57 deletions

View File

@ -485,6 +485,9 @@ type PostLifecycleRequest struct {
ChangedAt time.Time `json:"changed_at"`
}
// PostLifecycle posts the agent's lifecycle to the Coder server.
//
// Deprecated: Use UpdateLifecycle on the dRPC API instead
func (c *Client) PostLifecycle(ctx context.Context, req PostLifecycleRequest) error {
res, err := c.SDK.Request(ctx, http.MethodPost, "/api/v2/workspaceagents/me/report-lifecycle", req)
if err != nil {