Servers and databases
17 source-verified application API operations in Aquadactyl.
Generated from Aquadactyl 2bfd6ae2a30c. Read authentication and conventions first.
GET /api/application/servers
Return all the servers that currently exist on the Panel.
Access: Administrator account; servers ACL READ.
Source: Route · Controller · Request validation
Query fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
search | 'string|max:100' |
Other controller inputs: per_page.
List query options: filters declared in 'uuid', 'name', 'description', 'image', 'external_id'; sorts 'id', 'uuid'. Use filter[name]=value and sort=-id only with supported fields.
Response
Success: 200. Response attributes: Application ServerTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$servers = QueryBuilder::for(Server::query())
->allowedFilters('uuid', 'name', 'description', 'image', 'external_id')
->allowedSorts('id', 'uuid')
->paginate($request->query('per_page') ?? 50);
return $this->fractal->collection($servers)
->transformWith($this->getTransformer(ServerTransformer::class))
->toArray();Example request
curl --get "${PANEL_URL}/api/application/servers" \
--header "Authorization: Bearer ${APPLICATION_API_KEY}" \
--header "Accept: application/json"GET /api/application/servers/{server:id}
Show a single server transformed for the application API.
Access: Administrator account; servers ACL READ.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id. See identifiers.
Response
Success: 200. Response attributes: Application ServerTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
return $this->fractal->item($server)
->transformWith($this->getTransformer(ServerTransformer::class))
->toArray();Example request
curl --get "${PANEL_URL}/api/application/servers/1" \
--header "Authorization: Bearer ${APPLICATION_API_KEY}" \
--header "Accept: application/json"GET /api/application/servers/external/{external_id}
Retrieve a specific server from the database using its external ID.
Access: Administrator account; servers ACL READ.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: external_id. See identifiers.
Response
Success: 200. Response attributes: Application ServerTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$server = Server::query()->where('external_id', $external_id)->firstOrFail();
return $this->fractal->item($server)
->transformWith($this->getTransformer(ServerTransformer::class))
->toArray();Example request
curl --get "${PANEL_URL}/api/application/servers/external/RESOURCE_ID" \
--header "Authorization: Bearer ${APPLICATION_API_KEY}" \
--header "Accept: application/json"PATCH /api/application/servers/{server:id}/details
Update the details for a specific server.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Model constraints: Server.php (including runtime rules and uniqueness checks for updates).
Path parameters: server:id. See identifiers.
Input fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
external_id | ['sometimes', 'nullable', 'string', 'between:1,191', 'unique:servers'] |
name | ['required', 'string', 'min:1', 'max:191'] |
user | ['required', 'integer', 'exists:users,id'] |
description | array_merge(['nullable'], ['string']) |
Response
Success: 200. Response attributes: Application ServerTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$updated = $this->detailsModificationService->returnUpdatedModel()->handle(
$server,
$request->validated()
);
return $this->fractal->item($updated)
->transformWith($this->getTransformer(ServerTransformer::class))
->toArray();PATCH /api/application/servers/{server:id}/build
Update the build details for a specific server.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Model constraints: Server.php (including runtime rules and uniqueness checks for updates).
Path parameters: server:id. See identifiers.
Input fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
allocation | ['required', 'bail', 'unique:servers', 'exists:allocations,id'] |
oom_disabled | ['sometimes', 'boolean'] |
limits | 'sometimes|array' |
limits.memory | $this->requiredToOptional('memory', ['required', 'numeric', 'min:0'], true) |
limits.swap | $this->requiredToOptional('swap', ['required', 'numeric', 'min:-1'], true) |
limits.io | $this->requiredToOptional('io', ['required', 'numeric', 'between:10,1000'], true) |
limits.cpu | $this->requiredToOptional('cpu', ['required', 'numeric', 'min:0'], true) |
limits.threads | $this->requiredToOptional('threads', ['nullable', 'regex:/^[0-9-,]+$/'], true) |
limits.disk | $this->requiredToOptional('disk', ['required', 'numeric', 'min:0'], true) |
memory | $this->requiredToOptional('memory', ['required', 'numeric', 'min:0']) |
swap | $this->requiredToOptional('swap', ['required', 'numeric', 'min:-1']) |
io | $this->requiredToOptional('io', ['required', 'numeric', 'between:10,1000']) |
cpu | $this->requiredToOptional('cpu', ['required', 'numeric', 'min:0']) |
threads | $this->requiredToOptional('threads', ['nullable', 'regex:/^[0-9-,]+$/']) |
disk | $this->requiredToOptional('disk', ['required', 'numeric', 'min:0']) |
add_allocations | 'bail|array' |
add_allocations.* | 'integer' |
remove_allocations | 'bail|array' |
remove_allocations.* | 'integer' |
feature_limits | 'required|array' |
feature_limits.databases | ['present', 'nullable', 'integer', 'min:0'] |
feature_limits.allocations | ['sometimes', 'nullable', 'integer', 'min:0'] |
feature_limits.backups | ['present', 'nullable', 'integer', 'min:0'] |
Response
Success: 200. Response attributes: Application ServerTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$server = $this->buildModificationService->handle($server, $request->validated());
return $this->fractal->item($server)
->transformWith($this->getTransformer(ServerTransformer::class))
->toArray();PATCH /api/application/servers/{server:id}/startup
Update the startup and environment settings for a specific server.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Model constraints: Server.php (including runtime rules and uniqueness checks for updates).
Path parameters: server:id. See identifiers.
Input fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
startup | ['required', 'string'] |
environment | 'present|array' |
egg | ['required', 'exists:eggs,id'] |
image | ['required', 'string', 'max:191', 'regex:/^~?[\w\.\/\-:@ ]*$/'] |
skip_scripts | 'present|boolean' |
Response
Success: 200. Response attributes: Application ServerTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$server = $this->modificationService
->setUserLevel(User::USER_LEVEL_ADMIN)
->handle($server, $request->validated());
return $this->fractal->item($server)
->transformWith($this->getTransformer(ServerTransformer::class))
->toArray();POST /api/application/servers
Create a new server on the system.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Model constraints: Server.php (including runtime rules and uniqueness checks for updates).
Input fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
external_id | ['sometimes', 'nullable', 'string', 'between:1,191', 'unique:servers'] |
name | ['required', 'string', 'min:1', 'max:191'] |
description | array_merge(['nullable'], ['string']) |
user | ['required', 'integer', 'exists:users,id'] |
egg | ['required', 'exists:eggs,id'] |
docker_image | ['required', 'string', 'max:191', 'regex:/^~?[\w\.\/\-:@ ]*$/'] |
startup | ['required', 'string'] |
environment | 'present|array' |
skip_scripts | 'sometimes|boolean' |
oom_disabled | 'sometimes|boolean' |
limits | 'required|array' |
limits.memory | ['required', 'numeric', 'min:0'] |
limits.swap | ['required', 'numeric', 'min:-1'] |
limits.disk | ['required', 'numeric', 'min:0'] |
limits.io | ['required', 'numeric', 'between:10,1000'] |
limits.threads | ['nullable', 'regex:/^[0-9-,]+$/'] |
limits.cpu | ['required', 'numeric', 'min:0'] |
feature_limits | 'required|array' |
feature_limits.databases | ['present', 'nullable', 'integer', 'min:0'] |
feature_limits.allocations | ['sometimes', 'nullable', 'integer', 'min:0'] |
feature_limits.backups | ['present', 'nullable', 'integer', 'min:0'] |
allocation.default | '' |
allocation.additional.* | '' |
deploy | 'sometimes|required|array' |
deploy.locations | 'array' |
deploy.locations.* | 'integer|min:1' |
deploy.dedicated_ip | 'required_with:deploy,boolean' |
deploy.port_range | 'array' |
deploy.port_range.* | 'string' |
start_on_completion | 'sometimes|boolean' |
Conditional validation
$validator->sometimes('allocation.default', [
'required', 'integer', 'bail',
Rule::exists('allocations', 'id')->where(function ($query) {
$query->whereNull('server_id');
}),
], function ($input) {
return !$input->deploy;
});
$validator->sometimes('allocation.additional.*', [
'integer',
Rule::exists('allocations', 'id')->where(function ($query) {
$query->whereNull('server_id');
}),
], function ($input) {
return !$input->deploy;
});
$validator->sometimes('deploy.locations', 'present', function ($input) {
return $input->deploy;
});
$validator->sometimes('deploy.port_range', 'present', function ($input) {
return $input->deploy;
});Response
Success: 201. Response attributes: Application ServerTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$server = $this->creationService->handle($request->validated(), $request->getDeploymentObject());
return $this->fractal->item($server)
->transformWith($this->getTransformer(ServerTransformer::class))
->respond(201);POST /api/application/servers/{server:id}/suspend
Suspend a server on the Panel.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$this->suspensionService->toggle($server);
return $this->returnNoContent();POST /api/application/servers/{server:id}/unsuspend
Unsuspend a server on the Panel.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$this->suspensionService->toggle($server, SuspensionService::ACTION_UNSUSPEND);
return $this->returnNoContent();POST /api/application/servers/{server:id}/reinstall
Mark a server as needing to be reinstalled.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$this->reinstallServerService->handle($server);
return $this->returnNoContent();DELETE /api/application/servers/{server:id}
Deletes a server.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$this->deletionService->withForce($force === 'force')->handle($server);
return $this->returnNoContent();DELETE /api/application/servers/{server:id}/{force?}
Deletes a server.
Access: Administrator account; servers ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id, force?. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$this->deletionService->withForce($force === 'force')->handle($server);
return $this->returnNoContent();GET /api/application/servers/{server:id}/databases
Return a listing of all databases currently available to a single server.
Access: Administrator account; server_databases ACL READ.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id. See identifiers.
Response
Success: 200. Response attributes: Application ServerDatabaseTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
return $this->fractal->collection($server->databases)
->transformWith($this->getTransformer(ServerDatabaseTransformer::class))
->toArray();Example request
curl --get "${PANEL_URL}/api/application/servers/1/databases" \
--header "Authorization: Bearer ${APPLICATION_API_KEY}" \
--header "Accept: application/json"GET /api/application/servers/{server:id}/databases/{database:id}
Return a single server database.
Access: Administrator account; server_databases ACL READ.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id, database:id. See identifiers.
Response
Success: 200. Response attributes: Application ServerDatabaseTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
abort_unless($database->server_id === $server->id, Response::HTTP_NOT_FOUND);
return $this->fractal->item($database)
->transformWith($this->getTransformer(ServerDatabaseTransformer::class))
->toArray();Example request
curl --get "${PANEL_URL}/api/application/servers/1/databases/RESOURCE_ID" \
--header "Authorization: Bearer ${APPLICATION_API_KEY}" \
--header "Accept: application/json"POST /api/application/servers/{server:id}/databases
Create a new database on the Panel for a given server.
Access: Administrator account; server_databases ACL WRITE.
Source: Route · Controller · Request validation
Path parameters: server:id. See identifiers.
Input fields
Rules use Laravel validation syntax. Dotted keys describe nested objects; * describes each array member. Model-derived rules are shown as their source expressions; model methods can add runtime constraints.
| Field | Validation |
|---|---|
database | [ 'required', 'alpha_dash', 'min:1', 'max:48', Rule::unique('databases')->where(function (Builder $query) use ($server) { $query->where('server_id', $server->id)->where('database', $this->databaseName()); }), ] |
remote | 'required|string|regex:/^[0-9%.]{1,15}$/' |
host | 'required|integer|exists:database_hosts,id' |
Response
Success: 201. Response attributes: Application ServerDatabaseTransformer. Collections use the list envelope described in conventions.
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
$database = $this->databaseManagementService->create($server, array_merge($request->validated(), [
'database' => $request->databaseName(),
]));
return $this->fractal->item($database)
->transformWith($this->getTransformer(ServerDatabaseTransformer::class))
->addMeta([
'resource' => route('api.application.servers.databases.view', [
'server' => $server->id,
'database' => $database->id,
]),
])
->respond(Response::HTTP_CREATED);POST /api/application/servers/{server:id}/databases/{database:id}/reset-password
Reset the password for a specific server database.
Access: Administrator account; server_databases ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id, database:id. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
abort_unless($database->server_id === $server->id, Response::HTTP_NOT_FOUND);
$this->databasePasswordService->handle($database);
return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);DELETE /api/application/servers/{server:id}/databases/{database:id}
Handle a request to delete a specific server database from the Panel.
Access: Administrator account; server_databases ACL WRITE.
Source: Route · Controller · Request validation
Validation is inherited from ApplicationApiRequest.php.
Path parameters: server:id, database:id. See identifiers.
Response
Success: 204 (empty body).
Response construction and endpoint behavior
This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.
abort_unless($database->server_id === $server->id, Response::HTTP_NOT_FOUND);
$this->databaseManagementService->delete($database);
return response('', 204);