2018-02-25 21:30:56 +00:00
|
|
|
<?php
|
|
|
|
|
2019-11-04 01:37:06 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2018-08-25 22:07:42 +00:00
|
|
|
use Pterodactyl\Http\Middleware\Api\Client\Server\AuthenticateServerAccess;
|
2018-02-25 21:30:56 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Client Control API
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/client
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::get('/', 'ClientController@index')->name('api.client.index');
|
2019-11-04 01:37:06 +00:00
|
|
|
Route::get('/permissions', 'ClientController@permissions');
|
2018-02-25 21:30:56 +00:00
|
|
|
|
2018-06-06 06:00:01 +00:00
|
|
|
Route::group(['prefix' => '/account'], function () {
|
|
|
|
Route::get('/', 'AccountController@index')->name('api.client.account');
|
2019-12-23 01:03:44 +00:00
|
|
|
Route::get('/two-factor', 'TwoFactorController@index');
|
|
|
|
Route::post('/two-factor', 'TwoFactorController@store');
|
|
|
|
Route::delete('/two-factor', 'TwoFactorController@delete');
|
2018-06-12 05:56:57 +00:00
|
|
|
|
2018-06-12 05:36:43 +00:00
|
|
|
Route::put('/email', 'AccountController@updateEmail')->name('api.client.account.update-email');
|
2018-06-17 23:53:24 +00:00
|
|
|
Route::put('/password', 'AccountController@updatePassword')->name('api.client.account.update-password');
|
2020-03-23 01:15:38 +00:00
|
|
|
|
|
|
|
Route::get('/api-keys', 'ApiKeyController@index');
|
|
|
|
Route::post('/api-keys', 'ApiKeyController@store');
|
2020-03-23 02:10:49 +00:00
|
|
|
Route::delete('/api-keys/{identifier}', 'ApiKeyController@delete');
|
2018-06-06 06:00:01 +00:00
|
|
|
});
|
|
|
|
|
2018-02-25 21:30:56 +00:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Client Control API
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/client/servers/{server}
|
|
|
|
|
|
|
|
|
*/
|
2018-08-25 22:07:42 +00:00
|
|
|
Route::group(['prefix' => '/servers/{server}', 'middleware' => [AuthenticateServerAccess::class]], function () {
|
2018-02-28 03:28:43 +00:00
|
|
|
Route::get('/', 'Servers\ServerController@index')->name('api.client.servers.view');
|
2019-09-09 00:48:37 +00:00
|
|
|
Route::get('/websocket', 'Servers\WebsocketController')->name('api.client.servers.websocket');
|
2019-08-17 23:03:10 +00:00
|
|
|
Route::get('/resources', 'Servers\ResourceUtilizationController')
|
2018-03-17 19:01:53 +00:00
|
|
|
->name('api.client.servers.resources');
|
2018-02-25 21:30:56 +00:00
|
|
|
|
2018-02-28 03:28:43 +00: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 04:47:01 +00:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/databases'], function () {
|
|
|
|
Route::get('/', 'Servers\DatabaseController@index')->name('api.client.servers.databases');
|
2018-08-23 05:29:20 +00:00
|
|
|
Route::post('/', 'Servers\DatabaseController@store');
|
2019-07-27 22:17:50 +00:00
|
|
|
Route::post('/{database}/rotate-password', 'Servers\DatabaseController@rotatePassword');
|
2018-08-25 21:43:21 +00:00
|
|
|
Route::delete('/{database}', 'Servers\DatabaseController@delete')->name('api.client.servers.databases.delete');
|
2018-08-22 04:47:01 +00:00
|
|
|
});
|
2019-03-17 00:10:04 +00:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/files'], function () {
|
2019-05-02 03:54:40 +00:00
|
|
|
Route::get('/list', 'Servers\FileController@listDirectory')->name('api.client.servers.files.list');
|
2019-05-25 23:24:13 +00:00
|
|
|
Route::get('/contents', 'Servers\FileController@getFileContents')->name('api.client.servers.files.contents');
|
2019-10-26 21:36:37 +00:00
|
|
|
Route::get('/download', 'Servers\FileController@download');
|
2019-05-04 23:04:59 +00:00
|
|
|
Route::put('/rename', 'Servers\FileController@renameFile')->name('api.client.servers.files.rename');
|
2019-05-05 00:26:24 +00:00
|
|
|
Route::post('/copy', 'Servers\FileController@copyFile')->name('api.client.servers.files.copy');
|
2019-05-27 22:30:49 +00:00
|
|
|
Route::post('/write', 'Servers\FileController@writeFileContents')->name('api.client.servers.files.write');
|
2019-05-05 00:26:24 +00:00
|
|
|
Route::post('/delete', 'Servers\FileController@delete')->name('api.client.servers.files.delete');
|
2019-05-02 04:45:39 +00:00
|
|
|
Route::post('/create-folder', 'Servers\FileController@createFolder')->name('api.client.servers.files.create-folder');
|
2019-03-17 00:10:04 +00:00
|
|
|
});
|
2019-03-24 00:47:20 +00:00
|
|
|
|
2020-02-08 23:23:08 +00:00
|
|
|
Route::group(['prefix' => '/schedules'], function () {
|
|
|
|
Route::get('/', 'Servers\ScheduleController@index');
|
2020-03-22 20:56:15 +00:00
|
|
|
Route::post('/', 'Servers\ScheduleController@store');
|
2020-03-18 06:33:53 +00:00
|
|
|
Route::get('/{schedule}', 'Servers\ScheduleController@view');
|
2020-03-22 20:56:15 +00:00
|
|
|
Route::post('/{schedule}', 'Servers\ScheduleController@update');
|
|
|
|
Route::delete('/{schedule}', 'Servers\ScheduleController@delete');
|
|
|
|
|
2020-03-19 05:28:32 +00:00
|
|
|
Route::post('/{schedule}/tasks', 'Servers\ScheduleTaskController@store');
|
|
|
|
Route::post('/{schedule}/tasks/{task}', 'Servers\ScheduleTaskController@update');
|
2020-03-19 04:08:32 +00:00
|
|
|
Route::delete('/{schedule}/tasks/{task}', 'Servers\ScheduleTaskController@delete');
|
2020-02-08 23:23:08 +00:00
|
|
|
});
|
|
|
|
|
2019-03-24 00:47:20 +00:00
|
|
|
Route::group(['prefix' => '/network'], function () {
|
|
|
|
Route::get('/', 'Servers\NetworkController@index')->name('api.client.servers.network');
|
|
|
|
});
|
2019-11-03 20:20:11 +00:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/users'], function () {
|
|
|
|
Route::get('/', 'Servers\SubuserController@index');
|
2020-03-27 21:23:13 +00:00
|
|
|
Route::post('/', 'Servers\SubuserController@store');
|
|
|
|
Route::get('/{subuser}', 'Servers\SubuserController@view');
|
|
|
|
Route::post('/{subuser}', 'Servers\SubuserController@update');
|
|
|
|
Route::delete('/{subuser}', 'Servers\SubuserController@delete');
|
2019-11-03 20:20:11 +00:00
|
|
|
});
|
2019-12-10 06:03:10 +00:00
|
|
|
|
|
|
|
Route::group(['prefix' => '/settings'], function () {
|
|
|
|
Route::post('/rename', 'Servers\SettingsController@rename');
|
|
|
|
});
|
2018-02-25 21:30:56 +00:00
|
|
|
});
|