Files
panel/app/Repositories/Daemon/DaemonPowerRepository.php

22 lines
493 B
PHP
Raw Normal View History

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