2018-03-17 19:01:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Controllers\Api\Client\Servers;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Server;
|
|
|
|
use Pterodactyl\Http\Controllers\Api\Client\ClientApiController;
|
|
|
|
use Pterodactyl\Http\Requests\Api\Client\Servers\GetServerRequest;
|
|
|
|
|
|
|
|
class ResourceUtilizationController extends ClientApiController
|
|
|
|
{
|
|
|
|
/**
|
2021-03-21 19:29:18 +00:00
|
|
|
* Return the current resource utilization for a server. This value is cached for up to
|
|
|
|
* 20 seconds at a time to ensure that repeated requests to this endpoint do not cause
|
|
|
|
* a flood of unnecessary API calls.
|
2018-03-17 19:01:53 +00:00
|
|
|
*
|
|
|
|
*/
|
2019-09-06 04:41:20 +00:00
|
|
|
public function __invoke(GetServerRequest $request, Server $server): array
|
2018-03-17 19:01:53 +00:00
|
|
|
{
|
2022-11-08 03:11:45 +00:00
|
|
|
return $server->getStats();
|
2018-03-17 19:01:53 +00:00
|
|
|
}
|
|
|
|
}
|