From 21a7f2f581956e268a0b169b1c3be96685d8545c Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Thu, 1 Jan 2026 12:03:13 +0000 Subject: [PATCH] fix(api): add docker_cleanup parameter to stop endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add optional docker_cleanup query parameter to the stop endpoints for Services, Applications, and Databases. This allows API users to control whether docker cleanup (pruning networks, volumes, etc.) is performed when stopping resources. The parameter defaults to true for backward compatibility. API Usage: - Stop without docker cleanup: GET /api/v1/{resource}/{uuid}/stop?docker_cleanup=false - Stop with docker cleanup (default): GET /api/v1/{resource}/{uuid}/stop Fixes #7758 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Andras Bacsai --- app/Http/Controllers/Api/ApplicationsController.php | 12 +++++++++++- app/Http/Controllers/Api/DatabasesController.php | 13 ++++++++++++- app/Http/Controllers/Api/ServicesController.php | 13 ++++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/ApplicationsController.php b/app/Http/Controllers/Api/ApplicationsController.php index 92c5f04a2..1e39215ac 100644 --- a/app/Http/Controllers/Api/ApplicationsController.php +++ b/app/Http/Controllers/Api/ApplicationsController.php @@ -3250,6 +3250,15 @@ public function action_deploy(Request $request) format: 'uuid', ) ), + new OA\Parameter( + name: 'docker_cleanup', + in: 'query', + description: 'Perform docker cleanup (prune networks, volumes, etc.).', + schema: new OA\Schema( + type: 'boolean', + default: true, + ) + ), ], responses: [ new OA\Response( @@ -3298,7 +3307,8 @@ public function action_stop(Request $request) $this->authorize('deploy', $application); - StopApplication::dispatch($application); + $dockerCleanup = $request->boolean('docker_cleanup', true); + StopApplication::dispatch($application, false, $dockerCleanup); return response()->json( [ diff --git a/app/Http/Controllers/Api/DatabasesController.php b/app/Http/Controllers/Api/DatabasesController.php index 0d38b7363..d3adb84d5 100644 --- a/app/Http/Controllers/Api/DatabasesController.php +++ b/app/Http/Controllers/Api/DatabasesController.php @@ -2611,6 +2611,15 @@ public function action_deploy(Request $request) format: 'uuid', ) ), + new OA\Parameter( + name: 'docker_cleanup', + in: 'query', + description: 'Perform docker cleanup (prune networks, volumes, etc.).', + schema: new OA\Schema( + type: 'boolean', + default: true, + ) + ), ], responses: [ new OA\Response( @@ -2662,7 +2671,9 @@ public function action_stop(Request $request) if (str($database->status)->contains('stopped') || str($database->status)->contains('exited')) { return response()->json(['message' => 'Database is already stopped.'], 400); } - StopDatabase::dispatch($database); + + $dockerCleanup = $request->boolean('docker_cleanup', true); + StopDatabase::dispatch($database, $dockerCleanup); return response()->json( [ diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.php index 587f49fa5..d58ee443a 100644 --- a/app/Http/Controllers/Api/ServicesController.php +++ b/app/Http/Controllers/Api/ServicesController.php @@ -1488,6 +1488,15 @@ public function action_deploy(Request $request) format: 'uuid', ) ), + new OA\Parameter( + name: 'docker_cleanup', + in: 'query', + description: 'Perform docker cleanup (prune networks, volumes, etc.).', + schema: new OA\Schema( + type: 'boolean', + default: true, + ) + ), ], responses: [ new OA\Response( @@ -1539,7 +1548,9 @@ public function action_stop(Request $request) if (str($service->status)->contains('stopped') || str($service->status)->contains('exited')) { return response()->json(['message' => 'Service is already stopped.'], 400); } - StopService::dispatch($service); + + $dockerCleanup = $request->boolean('docker_cleanup', true); + StopService::dispatch($service, false, $dockerCleanup); return response()->json( [