feat: use v2 API for agent metadata updates (#12281)

Switches the agent to report metadata over the v2 API.

Fixes #10534
This commit is contained in:
Spike Curtis
2024-02-26 09:50:19 +04:00
committed by GitHub
parent 7a245e61b1
commit b0afffbafb
5 changed files with 130 additions and 59 deletions

View File

@ -85,6 +85,9 @@ type PostMetadataRequest struct {
// performance.
type PostMetadataRequestDeprecated = codersdk.WorkspaceAgentMetadataResult
// PostMetadata posts agent metadata to the Coder server.
//
// Deprecated: use BatchUpdateMetadata on the agent dRPC API instead
func (c *Client) PostMetadata(ctx context.Context, req PostMetadataRequest) error {
res, err := c.SDK.Request(ctx, http.MethodPost, "/api/v2/workspaceagents/me/metadata", req)
if err != nil {