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

Method StartDesktopRecording

codersdk/workspacesdk/agentconn.go:740–752  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

738// caller-provided and must be unique. Idempotent — if the ID is
739// already recording, returns success.
740func (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.

Callers

nothing calls this directly

Calls 5

apiRequestMethod · 0.95
StartSpanFunction · 0.92
ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected