1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-26 02:52:30 +01:00
Pterodactyl-Panel/routes/api-client.php

74 lines
3.5 KiB
PHP
Raw Normal View History

<?php
use Illuminate\Support\Facades\Route;
2018-08-26 00:07:42 +02:00
use Pterodactyl\Http\Middleware\Api\Client\Server\AuthenticateServerAccess;
/*
|--------------------------------------------------------------------------
| Client Control API
|--------------------------------------------------------------------------
|
| Endpoint: /api/client
|
*/
Route::get('/', 'ClientController@index')->name('api.client.index');
Route::get('/permissions', 'ClientController@permissions');
Route::group(['prefix' => '/account'], function () {
Route::get('/', 'AccountController@index')->name('api.client.account');
Route::get('/two-factor', 'TwoFactorController@index');
Route::post('/two-factor', 'TwoFactorController@store');
Route::delete('/two-factor', 'TwoFactorController@delete');
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');
});
/*
|--------------------------------------------------------------------------
| 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 () {
Route::get('/', 'Servers\ServerController@index')->name('api.client.servers.view');
Route::get('/websocket', 'Servers\WebsocketController')->name('api.client.servers.websocket');
Route::get('/resources', 'Servers\ResourceUtilizationController')
->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');
2018-08-22 06:47:01 +02:00
Route::group(['prefix' => '/databases'], function () {
Route::get('/', 'Servers\DatabaseController@index')->name('api.client.servers.databases');
Route::post('/', 'Servers\DatabaseController@store');
2019-07-28 00:17:50 +02:00
Route::post('/{database}/rotate-password', 'Servers\DatabaseController@rotatePassword');
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
});
Route::group(['prefix' => '/files'], function () {
Route::get('/list', 'Servers\FileController@listDirectory')->name('api.client.servers.files.list');
Route::get('/contents', 'Servers\FileController@getFileContents')->name('api.client.servers.files.contents');
Route::get('/download', 'Servers\FileController@download');
Route::put('/rename', 'Servers\FileController@renameFile')->name('api.client.servers.files.rename');
2019-05-05 02:26:24 +02:00
Route::post('/copy', 'Servers\FileController@copyFile')->name('api.client.servers.files.copy');
2019-05-28 00:30:49 +02:00
Route::post('/write', 'Servers\FileController@writeFileContents')->name('api.client.servers.files.write');
2019-05-05 02:26:24 +02:00
Route::post('/delete', 'Servers\FileController@delete')->name('api.client.servers.files.delete');
Route::post('/create-folder', 'Servers\FileController@createFolder')->name('api.client.servers.files.create-folder');
});
Route::group(['prefix' => '/network'], function () {
Route::get('/', 'Servers\NetworkController@index')->name('api.client.servers.network');
});
2019-11-03 21:20:11 +01:00
Route::group(['prefix' => '/users'], function () {
Route::get('/', 'Servers\SubuserController@index');
});
Route::group(['prefix' => '/settings'], function () {
Route::post('/rename', 'Servers\SettingsController@rename');
});
});