StartDesktopRecording starts a desktop recording session on the agent with the given recording ID. The recording ID is caller-provided and must be unique. Idempotent — if the ID is already recording, returns success.
(ctx context.Context, req StartDesktopRecordingRequest)
| 738 | // caller-provided and must be unique. Idempotent — if the ID is |
| 739 | // already recording, returns success. |
| 740 | func (c *agentConn) StartDesktopRecording(ctx context.Context, req StartDesktopRecordingRequest) error { |
| 741 | ctx, span := tracing.StartSpan(ctx) |
| 742 | defer span.End() |
| 743 | res, err := c.apiRequest(ctx, http.MethodPost, "/api/v0/desktop/recording/start", req) |
| 744 | if err != nil { |
| 745 | return xerrors.Errorf("start recording request: %w", err) |
| 746 | } |
| 747 | defer res.Body.Close() |
| 748 | if res.StatusCode != http.StatusOK { |
| 749 | return codersdk.ReadBodyAsError(res) |
| 750 | } |
| 751 | return nil |
| 752 | } |
| 753 | |
| 754 | // StopDesktopRecording stops a desktop recording session on the |
| 755 | // agent and returns the recording as a StopDesktopRecordingResponse. |
nothing calls this directly
no test coverage detected