fix(api): add docker_cleanup parameter to stop endpoints (#8899)
This commit is contained in:
commit
eb96c9550b
3 changed files with 35 additions and 3 deletions
|
|
@ -3670,6 +3670,15 @@ public function action_deploy(Request $request)
|
|||
type: 'string',
|
||||
)
|
||||
),
|
||||
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(
|
||||
|
|
@ -3718,7 +3727,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(
|
||||
[
|
||||
|
|
|
|||
|
|
@ -2602,6 +2602,15 @@ public function action_deploy(Request $request)
|
|||
type: 'string',
|
||||
)
|
||||
),
|
||||
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(
|
||||
|
|
@ -2653,7 +2662,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(
|
||||
[
|
||||
|
|
|
|||
|
|
@ -1676,6 +1676,15 @@ public function action_deploy(Request $request)
|
|||
type: 'string',
|
||||
)
|
||||
),
|
||||
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(
|
||||
|
|
@ -1727,7 +1736,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(
|
||||
[
|
||||
|
|
|
|||
Loading…
Reference in a new issue