MCPcopy Index your code
hub / github.com/coder/coder / UpdateWorkspaceAgentStartupByID

Method UpdateWorkspaceAgentStartupByID

coderd/database/dbauthz/dbauthz.go:7808–7824  ·  view source on GitHub ↗
(ctx context.Context, arg database.UpdateWorkspaceAgentStartupByIDParams)

Source from the content-addressed store, hash-verified

7806}
7807
7808func (q *querier) UpdateWorkspaceAgentStartupByID(ctx context.Context, arg database.UpdateWorkspaceAgentStartupByIDParams) error {
7809 agent, err := q.db.GetWorkspaceAgentByID(ctx, arg.ID)
7810 if err != nil {
7811 return err
7812 }
7813
7814 workspace, err := q.db.GetWorkspaceByAgentID(ctx, agent.ID)
7815 if err != nil {
7816 return err
7817 }
7818
7819 if err := q.authorizeContext(ctx, policy.ActionUpdate, workspace); err != nil {
7820 return err
7821 }
7822
7823 return q.db.UpdateWorkspaceAgentStartupByID(ctx, arg)
7824}
7825
7826func (q *querier) UpdateWorkspaceAppHealthByID(ctx context.Context, arg database.UpdateWorkspaceAppHealthByIDParams) error {
7827 // TODO: This is a workspace agent operation. Should users be able to query this?

Callers

nothing calls this directly

Calls 4

authorizeContextMethod · 0.95
GetWorkspaceAgentByIDMethod · 0.65
GetWorkspaceByAgentIDMethod · 0.65

Tested by

no test coverage detected