mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 08:23:25 +00:00
fix(api): add docker_cleanup parameter to stop endpoints
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 <andrasbacsai@users.noreply.github.com>
This commit is contained in:
co-authored by
Andras Bacsai
parent
f6a59fa2dc
commit
21a7f2f581
@@ -3250,6 +3250,15 @@ class ApplicationsController extends Controller
|
||||
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 @@ class ApplicationsController extends Controller
|
||||
|
||||
$this->authorize('deploy', $application);
|
||||
|
||||
StopApplication::dispatch($application);
|
||||
$dockerCleanup = $request->boolean('docker_cleanup', true);
|
||||
StopApplication::dispatch($application, false, $dockerCleanup);
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user