Skip to content

feat(recording): add pause and resume subcommands#12

Open
kshahbw wants to merge 1 commit into
mainfrom
recording-pause-resume
Open

feat(recording): add pause and resume subcommands#12
kshahbw wants to merge 1 commit into
mainfrom
recording-pause-resume

Conversation

@kshahbw

@kshahbw kshahbw commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Adds two subcommands that expose Bandwidth's Update Recording Voice API endpoint, which the CLI did not previously surface:

band recording pause <callId>    # PUT .../recording  {"state":"paused"}
band recording resume <callId>   # PUT .../recording  {"state":"recording"}

Endpoint: PUT /accounts/{accountId}/calls/{callId}/recording.

Why

Closes a CLI <-> API parity gap. The Update Recording endpoint was completely unexposed by the CLI. Operators could list/get/download/delete recordings but had no way to pause or resume an in-progress recording on a live call.

Scope: pause + resume only (no stop)

There is intentionally no stop subcommand here. Stopping a recording is a BXML-verb-only operation (<StopRecording>); this REST endpoint only toggles between paused and recording. Adding a REST stop would be inventing an endpoint that doesn't exist.

How

Mirrors existing patterns exactly:

  • Same structure as the other cmd/recording/* commands (single <callId> arg, cmdutil.ValidateID, cmdutil.VoiceClient, cmdutil.AccountIDFlag).
  • Reuses the existing client.Put(path, body, result) method in internal/api/client.go (already present, no new HTTP method needed).
  • Closest analogs are cmd/call/hangup.go / cmd/call/update.go, which similarly PUT/POST a state to a call.
  • Success path prints a concise confirmation (the endpoint returns 200 with no meaningful body), matching how recording delete reports success.

Tests

Follows the established testutil.FakeClient + golden-output pattern already used in cmd/recording:

  • Structure test updated to require the two new subcommands.
  • Arg-validation tests for both commands.
  • Golden output tests asserting the success messages.

Verification

  • go build ./... passes
  • go vet ./... passes
  • golangci-lint run ./cmd/recording/... -> 0 issues
  • go test ./... -> all green
  • band recording pause --help / band recording resume --help render correctly

Expose the Update Recording Voice API endpoint
(PUT /accounts/{accountId}/calls/{callId}/recording) via:

  band recording pause <callId>   -> {"state":"paused"}
  band recording resume <callId>  -> {"state":"recording"}

Closes a CLI/API parity gap. No REST stop exists for this endpoint
(StopRecording is BXML-verb-only), so only pause and resume are added.
@kshahbw kshahbw requested review from a team as code owners June 16, 2026 18:12
@bwappsec

bwappsec commented Jun 16, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants