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
|
|
|
|
2017-10-08 01:08:43 +02:00
|
|
|
/*
|
2017-11-19 23:30:00 +01:00
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| User Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2018-01-20 02:58:57 +01:00
|
|
|
| Endpoint: /api/application/users
|
2017-11-19 23:30:00 +01:00
|
|
|
|
|
|
|
|
*/
|
2020-04-13 02:20:09 +02:00
|
|
|
|
2017-11-19 23:30:00 +01:00
|
|
|
Route::group(['prefix' => '/users'], function () {
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Users\UserController::class, 'index'])->name('api.application.users');
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::get('/{user:id}', [Application\Users\UserController::class, 'view'])->name('api.application.users.view');
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/external/{external_id}', [Application\Users\ExternalUserController::class, 'index'])->name('api.application.users.external');
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Users\UserController::class, 'store']);
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::patch('/{user:id}', [Application\Users\UserController::class, 'update']);
|
2017-11-19 23:30:00 +01:00
|
|
|
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::delete('/{user:id}', [Application\Users\UserController::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-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Nodes\NodeController::class, 'index'])->name('api.application.nodes');
|
|
|
|
Route::get('/deployable', Application\Nodes\NodeDeploymentController::class);
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::get('/{node:id}', [Application\Nodes\NodeController::class, 'view'])->name('api.application.nodes.view');
|
|
|
|
Route::get('/{node:id}/configuration', Application\Nodes\NodeConfigurationController::class);
|
2018-01-01 22:11:44 +01:00
|
|
|
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Nodes\NodeController::class, 'store']);
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::patch('/{node:id}', [Application\Nodes\NodeController::class, 'update']);
|
2018-01-01 22:11:44 +01:00
|
|
|
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::delete('/{node:id}', [Application\Nodes\NodeController::class, 'delete']);
|
2018-01-11 06:19:03 +01:00
|
|
|
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::group(['prefix' => '/{node:id}/allocations'], function () {
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Nodes\AllocationController::class, 'index'])->name('api.application.allocations');
|
|
|
|
Route::post('/', [Application\Nodes\AllocationController::class, 'store']);
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::delete('/{allocation:id}', [Application\Nodes\AllocationController::class, 'delete'])->name('api.application.allocations.view');
|
2018-01-11 06:19:03 +01:00
|
|
|
});
|
2017-12-17 21:57:05 +01:00
|
|
|
});
|
2018-01-04 04:14:53 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Location Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
2018-01-20 02:58:57 +01:00
|
|
|
| Endpoint: /api/application/locations
|
2018-01-04 04:14:53 +01:00
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/locations'], function () {
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Locations\LocationController::class, 'index'])->name('api.applications.locations');
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::get('/{location:id}', [Application\Locations\LocationController::class, 'view'])->name('api.application.locations.view');
|
2018-01-04 04:14:53 +01:00
|
|
|
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Locations\LocationController::class, 'store']);
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::patch('/{location:id}', [Application\Locations\LocationController::class, 'update']);
|
2018-01-04 04:14:53 +01:00
|
|
|
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::delete('/{location:id}', [Application\Locations\LocationController::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-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Servers\ServerController::class, 'index'])->name('api.application.servers');
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::get('/{server:id}', [Application\Servers\ServerController::class, 'view'])->name('api.application.servers.view');
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/external/{external_id}', [Application\Servers\ExternalServerController::class, 'index'])->name('api.application.servers.external');
|
2018-01-20 20:48:02 +01:00
|
|
|
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::patch('/{server:id}/details', [Application\Servers\ServerDetailsController::class, 'details'])->name('api.application.servers.details');
|
|
|
|
Route::patch('/{server:id}/build', [Application\Servers\ServerDetailsController::class, 'build'])->name('api.application.servers.build');
|
|
|
|
Route::patch('/{server:id}/startup', [Application\Servers\StartupController::class, 'index'])->name('api.application.servers.startup');
|
2018-01-20 23:03:23 +01:00
|
|
|
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::post('/', [Application\Servers\ServerController::class, 'store']);
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::post('/{server:id}/suspend', [Application\Servers\ServerManagementController::class, 'suspend'])->name('api.application.servers.suspend');
|
|
|
|
Route::post('/{server:id}/unsuspend', [Application\Servers\ServerManagementController::class, 'unsuspend'])->name('api.application.servers.unsuspend');
|
|
|
|
Route::post('/{server:id}/reinstall', [Application\Servers\ServerManagementController::class, 'reinstall'])->name('api.application.servers.reinstall');
|
2018-01-20 20:48:02 +01:00
|
|
|
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::delete('/{server:id}', [Application\Servers\ServerController::class, 'delete']);
|
|
|
|
Route::delete('/{server:id}/{force?}', [Application\Servers\ServerController::class, 'delete']);
|
2018-01-26 04:26:06 +01:00
|
|
|
|
|
|
|
// Database Management Endpoint
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::group(['prefix' => '/{server:id}/databases'], function () {
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Servers\DatabaseController::class, 'index'])->name('api.application.servers.databases');
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::get('/{database:id}', [Application\Servers\DatabaseController::class, 'view'])->name('api.application.servers.databases.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-05-22 20:10:01 +02:00
|
|
|
Route::post('/{database:id}/reset-password', [Application\Servers\DatabaseController::class, 'resetPassword']);
|
2018-01-26 04:26:06 +01:00
|
|
|
|
2022-05-22 20:10:01 +02: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
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Nest Controller Routes
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Endpoint: /api/application/nests
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
Route::group(['prefix' => '/nests'], function () {
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Nests\NestController::class, 'index'])->name('api.application.nests');
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::get('/{nest:id}', [Application\Nests\NestController::class, 'view'])->name('api.application.nests.view');
|
2018-01-27 19:38:56 +01:00
|
|
|
|
|
|
|
// Egg Management Endpoint
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::group(['prefix' => '/{nest:id}/eggs'], function () {
|
2022-05-14 21:51:05 +02:00
|
|
|
Route::get('/', [Application\Nests\EggController::class, 'index'])->name('api.application.nests.eggs');
|
2022-05-22 20:10:01 +02:00
|
|
|
Route::get('/{egg:id}', [Application\Nests\EggController::class, 'view'])->name('api.application.nests.eggs.view');
|
2018-01-27 19:38:56 +01:00
|
|
|
});
|
|
|
|
});
|