Skip to content

Commit

Permalink
Updating dependencies, handling services expired, adding licenses in …
Browse files Browse the repository at this point in the history
…vm view
  • Loading branch information
carsso committed Jan 16, 2025
1 parent d77fa4d commit 1d943c6
Show file tree
Hide file tree
Showing 8 changed files with 3,075 additions and 2,500 deletions.
10 changes: 10 additions & 0 deletions app/Http/Controllers/PccController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ public function pcc(Request $request, String $pccName)
$ovhApi = $request->user()->ovhApi;
try {
$ovhApi->get('/v1/dedicatedCloud/'.$pccName);
$ovhApi->get('/v1/dedicatedCloud/'.$pccName.'/datacenter');
} catch (RequestException $exception) {
$response = $exception->getResponse();
if ($response != null) {
$statusCode = $response->getStatusCode();
if($statusCode == 404) {
abort(404);
}
if($statusCode == 460) {
abort(403, json_decode($response->getBody(), true)['message']);
}
}
throw $exception;
}
Expand All @@ -48,6 +52,9 @@ public function datacenter(Request $request, String $pccName, String $datacenter
if($statusCode == 404) {
abort(404);
}
if($statusCode == 460) {
abort(403, json_decode($response->getBody(), true)['message']);
}
}
throw $exception;
}
Expand All @@ -70,6 +77,9 @@ public function graphs(Request $request, String $pccName, String $datacenterId,
if($statusCode == 404) {
abort(404);
}
if($statusCode == 460) {
abort(403, json_decode($response->getBody(), true)['message']);
}
}
throw $e;
}
Expand Down
1 change: 0 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Kernel extends HttpKernel
\App\Http\Middleware\SessionInvalidate::class,
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"php": ">=8.1",
"carsso/oauth2-ovhcloud": "dev-main",
"ovh/ovh": "dev-master",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^9.0",
"laravel/sanctum": "^2.11",
Expand Down
Loading

0 comments on commit 1d943c6

Please sign in to comment.