2018-02-25 22:30:56 +01:00
|
|
|
<?php
|
|
|
|
|
2018-08-26 00:07:42 +02:00
|
|
|
use Pterodactyl\Http\Middleware\Api\Client\Server\AuthenticateServerAccess;
|
2018-02-25 22:30:56 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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-06-12 07:56:57 +02:00
|
|
|
|
2018-06-12 07:36:43 +02:00
|
|
|
Route::put('/email', 'AccountController@updateEmail')->name('api.client.account.update-email');
|
2018-06-18 01:53:24 +02:00
|
|
|
Route::put('/password', 'AccountController@updatePassword')->name('api.client.account.update-password');
|
2018-06-06 08:00:01 +02:00
|
|
|
});
|
|
|
|
|
2018-02-25 22:30:56 +01:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Client Control API
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/client/servers/{server}
|
|
|
|
|
|
|
|
|
*/
|
2018-08-26 00:07:42 +02:00
|
|
|
Route::group(['prefix' => '/servers/{server}', 'middleware' => [AuthenticateServerAccess::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')
|
|
|
|
->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-08-22 06:47:01 +02:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/databases'], function () {
|
|
|
|
Route::get('/', 'Servers\DatabaseController@index')->name('api.client.servers.databases');
|
2018-08-23 07:29:20 +02:00
|
|
|
Route::post('/', 'Servers\DatabaseController@store');
|
2018-08-25 23:43:21 +02:00
|
|
|
Route::delete('/{database}', 'Servers\DatabaseController@delete')->name('api.client.servers.databases.delete');
|
2018-08-22 06:47:01 +02:00
|
|
|
});
|
2019-03-17 01:10:04 +01:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/files'], function () {
|
|
|
|
Route::post('/download/{file}', 'Servers\FileController@download')
|
|
|
|
->where('file', '.*')
|
|
|
|
->name('api.client.servers.files.download');
|
|
|
|
});
|
2019-03-24 01:47:20 +01:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/network'], function () {
|
|
|
|
Route::get('/', 'Servers\NetworkController@index')->name('api.client.servers.network');
|
|
|
|
});
|
2018-02-25 22:30:56 +01:00
|
|
|
});
|