Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

Add websocket-cluster:start and websocket-cluster:stop - #307

Closed
joetannenbaum wants to merge 1 commit into
mainfrom
api-sync/websocket-clusters
Closed

joetannenbaum wants to merge 1 commit into
mainfrom
api-sync/websocket-clusters

Conversation

@joetannenbaum

@joetannenbaum joetannenbaum commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Adds websocket-cluster:start and websocket-cluster:stop for the two WebSocket cluster endpoints in the current API spec that the CLI didn't cover.

Findings

Endpoint Spec CLI before
POST /websocket-servers/{websocketServer}/start Starts a stopped Laravel Reverb WebSocket cluster; answers 200 with WebsocketServerResource No request class or command
POST /websocket-servers/{websocketServer}/stop Stops a Laravel Reverb WebSocket cluster, after which its applications stop accepting connections until it's started again; answers 200 with WebsocketServerResource No request class or command

Neither takes a request body. WebsocketServerStatus already includes stopped, so the DTO needed no change.

Changes

  • StartWebSocketClusterRequest / StopWebSocketClusterRequest, plus start() and stop() on WebSocketClustersResource.
  • websocket-cluster:start {cluster?} and websocket-cluster:stop {cluster?} {--force}, aliased ws-cluster:start / ws-cluster:stop like the other cluster commands. They resolve the cluster the way websocket-cluster:get does (ID or name, picker when interactive) and print the returned cluster with --json, using the same WebsocketCluster DTO.
  • Stopping cuts the cluster's applications off, so websocket-cluster:stop goes through confirmDestructive() and needs --force when non-interactive. websocket-cluster:start doesn't confirm.
  • README command table and the client README request list.

Tests

tests/Feature/WebsocketClusterStartStopTest.php covers the request each command sends, the --json shape, and that websocket-cluster:stop refuses to run headlessly without --force. The full suite (PromptFallbackTest skipped locally), PHPStan and Pint pass, re-run after rebasing on the current main.

Demo

This session could not embed the GIFs inline: image markdown was stripped on its way to GitHub, so they are plain links. Add a ! before each to make it play inline.

cloud websocket-cluster:start

websocket-cluster:start with no argument: pick a stopped cluster, then it starts.

cloud websocket-cluster:stop

websocket-cluster:stop with no argument: pick a cluster, confirm, then it stops.


Generated by Claude Code

The API can now start and stop a Laravel Reverb WebSocket cluster
(POST /websocket-servers/{websocketServer}/start and /stop). Both
commands resolve the cluster like websocket-cluster:get and output the
updated cluster with --json. Stopping means the cluster's applications
stop accepting connections, so websocket-cluster:stop confirms and needs
--force when non-interactive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4Y2hkEm7aPHvpU9eP2
@joetannenbaum
joetannenbaum force-pushed the api-sync/websocket-clusters branch from c3f1c97 to 08ca07b Compare November 25, 2026 18:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants