pelican-panel-mirror/app/Repositories/Daemon/DaemonPowerRepository.php
Boy132 c93a836ad8
Remove DaemonConnectionException (#885)
* remove DaemonConnectionException

* update tests
2025-01-07 22:58:04 +01:00

22 lines
493 B
PHP

<?php
namespace App\Repositories\Daemon;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Http\Client\Response;
class DaemonPowerRepository extends DaemonRepository
{
/**
* Sends a power action to the server instance.
*
* @throws ConnectionException
*/
public function send(string $action): Response
{
return $this->getHttpClient()->post("/api/servers/{$this->server->uuid}/power",
['action' => $action],
);
}
}