feat(v5): expose corrosion and firewall diagnostics

This commit is contained in:
Andras Bacsai committed 2026-06-22 13:52:17 +02:00
1 parent 4cdd45070d
commit 2007d802ef
9 files changed
+938 -35

No files matched your search

+25
View File
@@ -126,6 +126,21 @@ class FluxClient
return $this->output($payload, 'Firewall rule removed.');
}
/**
* @return array<int, array{id?: string, namespace?: string, src?: string, dst?: string, proto?: string, port?: int}>
*/
public function listFirewallRules(string $hostId, string $namespace = ''): array
{
$payload = $this->dispatch($hostId, [
'type' => 'firewall.list',
'namespace' => $namespace,
]);
$data = $payload['data'] ?? [];
return is_array($data) ? $data : [];
}
public function cooldLogs(string $hostId, int $tail = 200): string
{
$payload = $this->dispatch($hostId, [
@@ -136,6 +151,16 @@ class FluxClient
return $this->output($payload, 'No coold logs returned.');
}
public function corrosionTables(string $hostId, int $limit = 200): string
{
$payload = $this->dispatch($hostId, [
'type' => 'corrosion.tables',
'limit' => max(1, min($limit, 1000)),
]);
return $this->output($payload, '{"limit":200,"tables":[]}');
}
/**
* @param array<string, mixed> $command
* @return array<string, mixed>