forked from Alex/Pterodactyl-Panel
3e2ac981a9
This endpoint is throttled to 15 requests per minute to avoid destroying the daemon since clients can use it.
32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Pterodactyl\Http\Middleware\Api\Client\AuthenticateClientAccess;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Client Control API
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /api/client
|
|
|
|
|
*/
|
|
Route::get('/', 'ClientController@index')->name('api.client.index');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Client Control API
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Endpoint: /api/client/servers/{server}
|
|
|
|
|
*/
|
|
Route::group(['prefix' => '/servers/{server}', 'middleware' => [AuthenticateClientAccess::class]], function () {
|
|
Route::get('/', 'Servers\ServerController@index')->name('api.client.servers.view');
|
|
Route::get('/utilization', 'Servers\ResourceUtilizationController@index')
|
|
->middleware(['throttle:15,1'])
|
|
->name('api.client.servers.resources');
|
|
|
|
Route::post('/command', 'Servers\CommandController@index')->name('api.client.servers.command');
|
|
Route::post('/power', 'Servers\PowerController@index')->name('api.client.servers.power');
|
|
});
|