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