2018-02-25 15:30:56 -06:00
|
|
|
<?php
|
|
|
|
|
2018-08-25 15:07:42 -07:00
|
|
|
use Pterodactyl\Http\Middleware\Api\Client\Server\AuthenticateServerAccess;
|
2018-02-25 15:30:56 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Client Control API
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/client
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::get('/', 'ClientController@index')->name('api.client.index');
|
|
|
|
|
2018-06-05 23:00:01 -07:00
|
|
|
Route::group(['prefix' => '/account'], function () {
|
|
|
|
Route::get('/', 'AccountController@index')->name('api.client.account');
|
2018-06-11 22:56:57 -07:00
|
|
|
|
2018-06-11 22:36:43 -07:00
|
|
|
Route::put('/email', 'AccountController@updateEmail')->name('api.client.account.update-email');
|
2018-06-17 16:53:24 -07:00
|
|
|
Route::put('/password', 'AccountController@updatePassword')->name('api.client.account.update-password');
|
2018-06-05 23:00:01 -07:00
|
|
|
});
|
|
|
|
|
2018-02-25 15:30:56 -06:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Client Control API
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/client/servers/{server}
|
|
|
|
|
|
|
|
|
*/
|
2018-08-25 15:07:42 -07:00
|
|
|
Route::group(['prefix' => '/servers/{server}', 'middleware' => [AuthenticateServerAccess::class]], function () {
|
2018-02-27 21:28:43 -06:00
|
|
|
Route::get('/', 'Servers\ServerController@index')->name('api.client.servers.view');
|
2018-03-17 14:01:53 -05:00
|
|
|
Route::get('/utilization', 'Servers\ResourceUtilizationController@index')
|
|
|
|
->name('api.client.servers.resources');
|
2018-02-25 15:30:56 -06:00
|
|
|
|
2018-02-27 21:28:43 -06:00
|
|
|
Route::post('/command', 'Servers\CommandController@index')->name('api.client.servers.command');
|
|
|
|
Route::post('/power', 'Servers\PowerController@index')->name('api.client.servers.power');
|
2018-08-21 21:47:01 -07:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/databases'], function () {
|
|
|
|
Route::get('/', 'Servers\DatabaseController@index')->name('api.client.servers.databases');
|
2018-08-22 22:29:20 -07:00
|
|
|
Route::post('/', 'Servers\DatabaseController@store');
|
2018-08-25 14:43:21 -07:00
|
|
|
Route::delete('/{database}', 'Servers\DatabaseController@delete')->name('api.client.servers.databases.delete');
|
2018-08-21 21:47:01 -07:00
|
|
|
});
|
2018-02-25 15:30:56 -06:00
|
|
|
});
|