feat: start all kinds of things
This commit is contained in:
parent
a664174c02
commit
4855af7e57
@ -463,7 +463,7 @@ function getResourceByUuid(string $uuid, ?int $teamId = null)
|
|||||||
{
|
{
|
||||||
$resource = queryResourcesByUuid($uuid);
|
$resource = queryResourcesByUuid($uuid);
|
||||||
if (!is_null($teamId)) {
|
if (!is_null($teamId)) {
|
||||||
if ($resource->environment->project->team_id === $teamId) {
|
if (!is_null($resource) && $resource->environment->project->team_id === $teamId) {
|
||||||
return $resource;
|
return $resource;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Actions\Database\StartMongodb;
|
||||||
use App\Actions\Database\StartPostgresql;
|
use App\Actions\Database\StartPostgresql;
|
||||||
use App\Models\Application;
|
use App\Actions\Database\StartRedis;
|
||||||
use App\Models\Service;
|
use App\Actions\Service\StartService;
|
||||||
use App\Models\StandaloneMongodb;
|
|
||||||
use App\Models\StandalonePostgresql;
|
|
||||||
use App\Models\StandaloneRedis;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
@ -57,6 +55,21 @@ Route::group([
|
|||||||
'started_at' => now(),
|
'started_at' => now(),
|
||||||
]);
|
]);
|
||||||
return response()->json(['message' => 'Database started.'], 200);
|
return response()->json(['message' => 'Database started.'], 200);
|
||||||
|
} else if ($type === 'App\Models\StandaloneRedis') {
|
||||||
|
StartRedis::run($resource);
|
||||||
|
$resource->update([
|
||||||
|
'started_at' => now(),
|
||||||
|
]);
|
||||||
|
return response()->json(['message' => 'Database started.'], 200);
|
||||||
|
} else if ($type === 'App\Models\StandaloneMongodb') {
|
||||||
|
StartMongodb::run($resource);
|
||||||
|
$resource->update([
|
||||||
|
'started_at' => now(),
|
||||||
|
]);
|
||||||
|
return response()->json(['message' => 'Database started.'], 200);
|
||||||
|
}else if ($type === 'App\Models\Service') {
|
||||||
|
StartService::run($resource);
|
||||||
|
return response()->json(['message' => 'Service started.'], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response()->json(['error' => 'No resource found.'], 404);
|
return response()->json(['error' => 'No resource found.'], 404);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user