mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
22 lines
493 B
PHP
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],
|
|
);
|
|
}
|
|
}
|