CluPilotCloud/app/Services/Proxmox/FakeProxmoxClient.php

49 lines
1.1 KiB
PHP

<?php
namespace App\Services\Proxmox;
use App\Models\Host;
class FakeProxmoxClient implements ProxmoxClient
{
public ?Host $host = null;
/** @var array<int, array<string, mixed>> */
public array $nodes = [['node' => 'pve']];
/** @var array<string, mixed> */
public array $status = [
'cpuinfo' => ['cpus' => 16],
'memory' => ['total' => 68719476736], // 64 GiB
'pveversion' => 'pve-manager/8.2.2',
];
/** @var array<int, array<string, mixed>> */
public array $storage = [
['storage' => 'local', 'type' => 'dir', 'content' => 'iso,vztmpl,backup', 'total' => 1099511627776],
['storage' => 'local-lvm', 'type' => 'lvmthin', 'content' => 'images,rootdir', 'total' => 1099511627776], // 1 TiB
];
public function forHost(Host $host): static
{
$this->host = $host;
return $this;
}
public function listNodes(): array
{
return $this->nodes;
}
public function nodeStatus(string $node): array
{
return $this->status;
}
public function nodeStorage(string $node): array
{
return $this->storage;
}
}