3e2ac981a9
This endpoint is throttled to 15 requests per minute to avoid destroying the daemon since clients can use it.
24 lines
792 B
PHP
24 lines
792 B
PHP
<?php
|
|
|
|
namespace Pterodactyl\Http\Controllers\Api\Client\Servers;
|
|
|
|
use Pterodactyl\Models\Server;
|
|
use Pterodactyl\Transformers\Api\Client\StatsTransformer;
|
|
use Pterodactyl\Http\Controllers\Api\Client\ClientApiController;
|
|
use Pterodactyl\Http\Requests\Api\Client\Servers\GetServerRequest;
|
|
|
|
class ResourceUtilizationController extends ClientApiController
|
|
{
|
|
/**
|
|
* Return the current resource utilization for a server.
|
|
*
|
|
* @param \Pterodactyl\Http\Requests\Api\Client\Servers\GetServerRequest $request
|
|
* @return array
|
|
*/
|
|
public function index(GetServerRequest $request): array
|
|
{
|
|
return $this->fractal->item($request->getModel(Server::class))
|
|
->transformWith($this->getTransformer(StatsTransformer::class))
|
|
->toArray();
|
|
}
|
|
}
|