2018-02-25 22:30:56 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Pterodactyl\Http\Middleware\Api\Client\AuthenticateClientAccess;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Client Control API
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/client
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::get('/', 'ClientController@index')->name('api.client.index');
|
|
|
|
|
2018-06-06 08:00:01 +02:00
|
|
|
Route::group(['prefix' => '/account'], function () {
|
|
|
|
Route::get('/', 'AccountController@index')->name('api.client.account');
|
|
|
|
});
|
|
|
|
|
2018-02-25 22:30:56 +01:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Client Control API
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/client/servers/{server}
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/servers/{server}', 'middleware' => [AuthenticateClientAccess::class]], function () {
|
2018-02-28 04:28:43 +01:00
|
|
|
Route::get('/', 'Servers\ServerController@index')->name('api.client.servers.view');
|
2018-03-17 20:01:53 +01:00
|
|
|
Route::get('/utilization', 'Servers\ResourceUtilizationController@index')
|
2018-06-03 04:08:53 +02:00
|
|
|
->middleware(['throttle:20,1'])
|
2018-03-17 20:01:53 +01:00
|
|
|
->name('api.client.servers.resources');
|
2018-02-25 22:30:56 +01:00
|
|
|
|
2018-02-28 04:28:43 +01:00
|
|
|
Route::post('/command', 'Servers\CommandController@index')->name('api.client.servers.command');
|
|
|
|
Route::post('/power', 'Servers\PowerController@index')->name('api.client.servers.power');
|
2018-02-25 22:30:56 +01:00
|
|
|
});
|