tests pass!
This commit is contained in:
@@ -20,9 +20,17 @@ use Illuminate\Support\Collection;
|
||||
|
||||
class HetznerService extends ServerProviderService
|
||||
{
|
||||
public function __construct(Provider $provider)
|
||||
protected Provider $provider;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->connector = new HetznerConnector($provider);
|
||||
$this->connector = new HetznerConnector();
|
||||
}
|
||||
|
||||
public function forProvider(Provider $provider): static
|
||||
{
|
||||
$this->provider = $provider;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function createServer(
|
||||
@@ -54,6 +62,7 @@ class HetznerService extends ServerProviderService
|
||||
ipv4: $response->json('server.public_net.ipv4.ip'),
|
||||
ipv6: $response->json('server.public_net.ipv6.ip'),
|
||||
networkId: $networkId,
|
||||
privateIp: $response->json('server.private_net.0.ip'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Services\ServerProviders;
|
||||
|
||||
use App\Data\ServerProviders\CreatedServer;
|
||||
use App\Data\ServerProviders\Network;
|
||||
use App\Models\Provider;
|
||||
use Illuminate\Support\Collection;
|
||||
use Saloon\Http\Connector;
|
||||
|
||||
@@ -19,6 +20,8 @@ abstract class ServerProviderService
|
||||
string $networkId,
|
||||
): CreatedServer;
|
||||
|
||||
abstract public function forProvider(Provider $provider): static;
|
||||
|
||||
abstract public function getServerTypes(): Collection;
|
||||
|
||||
abstract public function getLocations(): Collection;
|
||||
|
||||
Reference in New Issue
Block a user