2016-09-05 22:21:36 +02:00
|
|
|
<?php
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2020-04-13 02:20:09 +02:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2022-05-14 21:51:05 +02:00
|
|
|
use Pterodactyl\Http\Controllers\Api\Application;
|
2020-04-13 02:20:09 +02:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/version', [Application\VersionController::class, '__invoke']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2017-10-08 01:08:43 +02:00
|
|
|
/*
|
2017-11-19 23:30:00 +01:00
|
|
|
|--------------------------------------------------------------------------
|
2022-12-15 01:05:46 +01:00
|
|
|
| Database Controller Routes
|
2017-11-19 23:30:00 +01:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2022-12-15 01:05:46 +01:00
|
|
|
| Endpoint: /api/application/databases
|
2017-11-19 23:30:00 +01:00
|
|
|
|
|
|
|
|
*/
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::group(['prefix' => '/databases'], function () {
|
|
|
|
Route::get('/', [Application\Databases\DatabaseController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{databaseHost:id}', [Application\Databases\DatabaseController::class, 'view']);
|
2020-04-13 02:20:09 +02:00
|
|
|
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::post('/', [Application\Databases\DatabaseController::class, 'store']);
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{databaseHost:id}', [Application\Databases\DatabaseController::class, 'update']);
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{databaseHost:id}', [Application\Databases\DatabaseController::class, 'delete']);
|
2022-12-15 01:05:46 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Egg Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/application/eggs
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/eggs'], function () {
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{egg:id}', [Application\Eggs\EggController::class, 'view']);
|
|
|
|
Route::get('/{egg:id}/export', [Application\Eggs\EggController::class, 'export']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
|
|
|
Route::post('/', [Application\Eggs\EggController::class, 'store']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::post('/{egg:id}/variables', [Application\Eggs\EggVariableController::class, 'store']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{egg:id}', [Application\Eggs\EggController::class, 'update']);
|
|
|
|
Route::patch('/{egg:id}/variables', [Application\Eggs\EggVariableController::class, 'update']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{egg:id}', [Application\Eggs\EggController::class, 'delete']);
|
|
|
|
Route::delete('/{egg:id}/variables/{eggVariable:id}', [Application\Eggs\EggVariableController::class, 'delete']);
|
2022-12-15 01:05:46 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Location Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/application/locations
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/locations'], function () {
|
|
|
|
Route::get('/', [Application\Locations\LocationController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{location:id}', [Application\Locations\LocationController::class, 'view']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
|
|
|
Route::post('/', [Application\Locations\LocationController::class, 'store']);
|
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{location:id}', [Application\Locations\LocationController::class, 'update']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{location:id}', [Application\Locations\LocationController::class, 'delete']);
|
2022-12-15 01:05:46 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Mount Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/application/mounts
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/mounts'], function () {
|
|
|
|
Route::get('/', [Application\Mounts\MountController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{mount:id}', [Application\Mounts\MountController::class, 'view']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
|
|
|
Route::post('/', [Application\Mounts\MountController::class, 'store']);
|
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::put('/{mount:id}/eggs', [Application\Mounts\MountController::class, 'addEggs']);
|
|
|
|
Route::put('/{mount:id}/nodes', [Application\Mounts\MountController::class, 'addNodes']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{mount:id}', [Application\Mounts\MountController::class, 'update']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{mount:id}', [Application\Mounts\MountController::class, 'delete']);
|
|
|
|
Route::delete('/{mount:id}/eggs', [Application\Mounts\MountController::class, 'deleteEggs']);
|
|
|
|
Route::delete('/{mount:id}/nodes', [Application\Mounts\MountController::class, 'deleteNodes']);
|
2022-12-15 01:05:46 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Nest Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/application/nests
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/nests'], function () {
|
|
|
|
Route::get('/', [Application\Nests\NestController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{nest:id}', [Application\Nests\NestController::class, 'view']);
|
|
|
|
Route::get('/{nest:id}/eggs', [Application\Eggs\EggController::class, 'index']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
|
|
|
Route::post('/', [Application\Nests\NestController::class, 'store']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::post('/{nest:id}/import', [Application\Nests\NestController::class, 'import']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{nest:id}', [Application\Nests\NestController::class, 'update']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{nest:id}', [Application\Nests\NestController::class, 'delete']);
|
2017-11-19 23:30:00 +01:00
|
|
|
});
|
2017-12-17 21:57:05 +01:00
|
|
|
|
2018-01-01 22:11:44 +01:00
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Node Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2018-01-20 02:58:57 +01:00
|
|
|
| Endpoint: /api/application/nodes
|
2018-01-01 22:11:44 +01:00
|
|
|
|
|
|
|
|
*/
|
2017-12-17 21:57:05 +01:00
|
|
|
Route::group(['prefix' => '/nodes'], function () {
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::get('/', [Application\Nodes\NodeController::class, 'index']);
|
|
|
|
Route::get('/deployable', [Application\Nodes\NodeDeploymentController::class, '__invoke']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{node:id}', [Application\Nodes\NodeController::class, 'view']);
|
|
|
|
Route::get('/{node:id}/configuration', [Application\Nodes\NodeConfigurationController::class, '__invoke']);
|
|
|
|
Route::get('/{node:id}/information', [Application\Nodes\NodeInformationController::class, '__invoke']);
|
2018-01-01 22:11:44 +01:00
|
|
|
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Nodes\NodeController::class, 'store']);
|
2018-01-01 22:11:44 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{node:id}', [Application\Nodes\NodeController::class, 'update']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{node:id}', [Application\Nodes\NodeController::class, 'delete']);
|
2018-01-11 06:19:03 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::group(['prefix' => '/{node:id}/allocations'], function () {
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::get('/', [Application\Nodes\AllocationController::class, 'index']);
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Nodes\AllocationController::class, 'store']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{allocation:id}', [Application\Nodes\AllocationController::class, 'delete']);
|
2018-01-11 06:19:03 +01:00
|
|
|
});
|
2017-12-17 21:57:05 +01:00
|
|
|
});
|
2018-01-04 04:14:53 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
2022-12-15 01:05:46 +01:00
|
|
|
| Role Controller Routes
|
2018-01-04 04:14:53 +01:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2022-12-15 01:05:46 +01:00
|
|
|
| Endpoint: /api/application/roles
|
2018-01-04 04:14:53 +01:00
|
|
|
|
|
|
|
|
*/
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::group(['prefix' => '/roles'], function () {
|
|
|
|
Route::get('/', [Application\Roles\RoleController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{role:id}', [Application\Roles\RoleController::class, 'view']);
|
2018-01-04 04:14:53 +01:00
|
|
|
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::post('/', [Application\Roles\RoleController::class, 'store']);
|
2018-01-04 04:14:53 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{role:id}', [Application\Roles\RoleController::class, 'update']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{role:id}', [Application\Roles\RoleController::class, 'delete']);
|
2018-01-20 04:47:06 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
2018-01-20 04:48:26 +01:00
|
|
|
| Server Controller Routes
|
2018-01-20 04:47:06 +01:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/application/servers
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/servers'], function () {
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::get('/', [Application\Servers\ServerController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{server:id}', [Application\Servers\ServerController::class, 'view']);
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::get('/external/{external_id}', [Application\Servers\ExternalServerController::class, 'index']);
|
2018-01-20 20:48:02 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{server:id}', [Application\Servers\ServerController::class, 'update']);
|
|
|
|
Route::patch('/{server:id}/startup', [Application\Servers\StartupController::class, 'index']);
|
2018-01-20 23:03:23 +01:00
|
|
|
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Servers\ServerController::class, 'store']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::post('/{server:id}/suspend', [Application\Servers\ServerManagementController::class, 'suspend']);
|
|
|
|
Route::post('/{server:id}/unsuspend', [Application\Servers\ServerManagementController::class, 'unsuspend']);
|
|
|
|
Route::post('/{server:id}/reinstall', [Application\Servers\ServerManagementController::class, 'reinstall']);
|
2018-01-20 20:48:02 +01:00
|
|
|
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::delete('/{server}', [Application\Servers\ServerController::class, 'delete']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{server:id}/{force?}', [Application\Servers\ServerController::class, 'delete']);
|
2018-01-26 04:26:06 +01:00
|
|
|
|
|
|
|
// Database Management Endpoint
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::group(['prefix' => '/{server:id}/databases'], function () {
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::get('/', [Application\Servers\DatabaseController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{database:id}', [Application\Servers\DatabaseController::class, 'view']);
|
2018-01-26 04:26:06 +01:00
|
|
|
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Servers\DatabaseController::class, 'store']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::post('/{database:id}/reset-password', [Application\Servers\DatabaseController::class, 'resetPassword']);
|
2018-01-26 04:26:06 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{database:id}', [Application\Servers\DatabaseController::class, 'delete']);
|
2018-01-26 04:26:06 +01:00
|
|
|
});
|
2018-01-04 04:14:53 +01:00
|
|
|
});
|
2018-01-27 19:38:56 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
2022-12-15 01:05:46 +01:00
|
|
|
| User Controller Routes
|
2018-01-27 19:38:56 +01:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2022-12-15 01:05:46 +01:00
|
|
|
| Endpoint: /api/application/users
|
2018-01-27 19:38:56 +01:00
|
|
|
|
|
|
|
|
*/
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::group(['prefix' => '/users'], function () {
|
|
|
|
Route::get('/', [Application\Users\UserController::class, 'index']);
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::get('/{user:id}', [Application\Users\UserController::class, 'view']);
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::get('/external/{external_id}', [Application\Users\ExternalUserController::class, 'index']);
|
2018-01-27 19:38:56 +01:00
|
|
|
|
2022-12-15 01:05:46 +01:00
|
|
|
Route::post('/', [Application\Users\UserController::class, 'store']);
|
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::patch('/{user:id}', [Application\Users\UserController::class, 'update']);
|
2022-12-15 01:05:46 +01:00
|
|
|
|
2022-12-16 03:06:14 +01:00
|
|
|
Route::delete('/{user:id}', [Application\Users\UserController::class, 'delete']);
|
2018-01-27 19:38:56 +01:00
|
|
|
});
|