creating networks wip
This commit is contained in:
@@ -31,10 +31,10 @@ class ProvisionCallback extends Controller
|
||||
|
||||
if (! $isValidIp) {
|
||||
logger('someone tried to callback from an invalid IP');
|
||||
logger(' server ip: ' . $server->ipv4);
|
||||
logger(' server ipv6: ' . $server->ipv6);
|
||||
logger(' callback ip: ' . $request->ip());
|
||||
logger(' server id: ' . $server->id);
|
||||
logger(' server ip: '.$server->ipv4);
|
||||
logger(' server ipv6: '.$server->ipv6);
|
||||
logger(' callback ip: '.$request->ip());
|
||||
logger(' server id: '.$server->id);
|
||||
|
||||
return response('Unauthorized', 401);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Actions\GenerateRandomSlug;
|
||||
use App\Actions\GetProviderService;
|
||||
use App\Enums\ServerStatus;
|
||||
use App\Jobs\Servers\WaitForServerToConnect;
|
||||
use App\Models\Organisation;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Integrations\Requests\Hetzner\Servers;
|
||||
|
||||
use Saloon\Contracts\Body\HasBody;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Traits\Body\HasJsonBody;
|
||||
|
||||
class CreateNetworkRequest extends Request implements HasBody
|
||||
{
|
||||
use HasJsonBody;
|
||||
|
||||
protected Method $method = Method::POST;
|
||||
|
||||
public function __construct(
|
||||
protected ?string $name = null,
|
||||
) {}
|
||||
|
||||
protected function defaultBody(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->name,
|
||||
];
|
||||
}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return '/networks';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Integrations\Requests\Hetzner\Servers;
|
||||
|
||||
use Saloon\Contracts\Body\HasBody;
|
||||
use Saloon\Enums\Method;
|
||||
use Saloon\Http\Request;
|
||||
use Saloon\Traits\Body\HasJsonBody;
|
||||
|
||||
class GetNetworksRequest extends Request implements HasBody
|
||||
{
|
||||
use HasJsonBody;
|
||||
|
||||
protected Method $method = Method::GET;
|
||||
|
||||
public function __construct(
|
||||
protected ?string $name = null,
|
||||
) {}
|
||||
|
||||
protected function defaultBody(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->name,
|
||||
];
|
||||
}
|
||||
|
||||
public function resolveEndpoint(): string
|
||||
{
|
||||
return '/networks';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user