feat(api): Add latest query param to Service restart API (#5881)
This commit is contained in:
parent
e005f1c838
commit
94df6ca51f
3 changed files with 14 additions and 3 deletions
|
|
@ -11,10 +11,10 @@ class RestartService
|
|||
|
||||
public string $jobQueue = 'high';
|
||||
|
||||
public function handle(Service $service)
|
||||
public function handle(Service $service, bool $pullLatestImages)
|
||||
{
|
||||
StopService::run($service);
|
||||
|
||||
return StartService::run($service);
|
||||
return StartService::run($service, $pullLatestImages);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1428,6 +1428,16 @@ public function action_stop(Request $request)
|
|||
format: 'uuid',
|
||||
)
|
||||
),
|
||||
new OA\Parameter(
|
||||
name: 'latest',
|
||||
in: 'query',
|
||||
description: 'Pull latest images.',
|
||||
required: false,
|
||||
schema: new OA\Schema(
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
)
|
||||
),
|
||||
],
|
||||
responses: [
|
||||
new OA\Response(
|
||||
|
|
@ -1473,7 +1483,8 @@ public function action_restart(Request $request)
|
|||
if (! $service) {
|
||||
return response()->json(['message' => 'Service not found.'], 404);
|
||||
}
|
||||
RestartService::dispatch($service);
|
||||
$pullLatest = $request->boolean('latest');
|
||||
RestartService::dispatch($service, $pullLatest);
|
||||
|
||||
return response()->json(
|
||||
[
|
||||
|
|
|
|||
BIN
public/svgs/typesense.webp
Normal file
BIN
public/svgs/typesense.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 550 B |
Loading…
Reference in a new issue