1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 09:02:28 +01:00
Pterodactyl-Panel/routes/api-application.php

125 lines
6.4 KiB
PHP
Raw Normal View History

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