Skip to content
AquadactylAquadactyl
API referenceApplication API

Nodes and allocations

10 source-verified application API operations in Aquadactyl.

Generated from Aquadactyl 2bfd6ae2a30c. Read authentication and conventions first.

GET /api/application/nodes

Return all the nodes currently available on the Panel.

Access: Administrator account; nodes ACL READ.

Source: Route · Controller · Request validation

Validation is inherited from ApplicationApiRequest.php.

Other controller inputs: per_page.

List query options: filters declared in 'uuid', 'name', 'fqdn', 'daemon_token_id'; sorts 'id', 'uuid', 'memory', 'disk'. Use filter[name]=value and sort=-id only with supported fields.

Response

Success: 200. Response attributes: Application NodeTransformer. 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.

$nodes = QueryBuilder::for(Node::query())
    ->allowedFilters('uuid', 'name', 'fqdn', 'daemon_token_id')
    ->allowedSorts('id', 'uuid', 'memory', 'disk')
    ->paginate($request->query('per_page') ?? 50);

return $this->fractal->collection($nodes)
    ->transformWith($this->getTransformer(NodeTransformer::class))
    ->toArray();

Example request

curl --get "${PANEL_URL}/api/application/nodes" \
  --header "Authorization: Bearer ${APPLICATION_API_KEY}" \
  --header "Accept: application/json"

GET /api/application/nodes/deployable

Finds any nodes that are available using the given deployment criteria. This works similarly to the server creation process, but allows you to pass the deployment object to this endpoint and get back a list of all Nodes satisfying the requirements.

Access: Administrator account; nodes 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.

FieldValidation
page'integer'
memory'required|integer|min:0'
disk'required|integer|min:0'
location_ids'array'
location_ids.*'integer'

Other controller inputs: per_page.

Response

Success: 200. Response attributes: Application NodeTransformer. 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.

$data = $request->validated();
$nodes = $this->viableNodesService->setLocations($data['location_ids'] ?? [])
    ->setMemory($data['memory'])
    ->setDisk($data['disk'])
    ->handle($request->query('per_page'), $request->query('page'));

return $this->fractal->collection($nodes)
    ->transformWith($this->getTransformer(NodeTransformer::class))
    ->toArray();

Example request

curl --get "${PANEL_URL}/api/application/nodes/deployable" \
  --header "Authorization: Bearer ${APPLICATION_API_KEY}" \
  --header "Accept: application/json" \
  --data-urlencode "memory=2048" \
  --data-urlencode "disk=10240"

GET /api/application/nodes/{node:id}

Return data for a single instance of a node.

Access: Administrator account; nodes ACL READ.

Source: Route · Controller · Request validation

Validation is inherited from ApplicationApiRequest.php.

Path parameters: node:id. See identifiers.

Response

Success: 200. Response attributes: Application NodeTransformer. 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($node)
    ->transformWith($this->getTransformer(NodeTransformer::class))
    ->toArray();

Example request

curl --get "${PANEL_URL}/api/application/nodes/RESOURCE_ID" \
  --header "Authorization: Bearer ${APPLICATION_API_KEY}" \
  --header "Accept: application/json"

GET /api/application/nodes/{node:id}/configuration

Returns the configuration information for a node. This allows for automated deployments to remote machines so long as an API key is provided to the machine to make the request with, and the node is known.

Access: Administrator account; nodes ACL WRITE.

Source: Route · Controller · Request validation

Validation is inherited from ApplicationApiRequest.php.

Path parameters: node:id. See identifiers.

Response

Success: 200.

Response construction and endpoint behavior

This source excerpt includes conditional responses, metadata, pagination, and service calls for this operation.

return new JsonResponse($node->getConfiguration());

Example request

curl --get "${PANEL_URL}/api/application/nodes/RESOURCE_ID/configuration" \
  --header "Authorization: Bearer ${APPLICATION_API_KEY}" \
  --header "Accept: application/json"

POST /api/application/nodes

Create a new node on the Panel. Returns the created node and an HTTP/201 status response on success.

Access: Administrator account; nodes ACL WRITE.

Source: Route · Controller · Request validation

Model constraints: Node.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.

FieldValidation
public'boolean'
name'required|regex:/^([\w .-]{1,100})$/'
description'string|nullable'
country_code'sometimes|nullable|string|size:2'
query_address['sometimes', 'nullable', 'string', 'max:253', 'regex:/^(?:[a-zA-Z0-9][a-zA-Z0-9.-]*|[a-fA-F0-9:]+)$/']
sftp_domain['sometimes', 'nullable', 'string', 'max:253', 'regex:/^(?:[a-zA-Z0-9][a-zA-Z0-9.-]*|[a-fA-F0-9:]+)$/']
location_id'required|exists:locations,id'
fqdn'required|string'
scheme'required'
behind_proxy'boolean'
maintenance_mode'boolean'
memory'required|numeric|min:1'
memory_overallocate'required|numeric|min:-1'
disk'required|numeric|min:1'
disk_overallocate'required|numeric|min:-1'
upload_size'int|min:1'
daemonListen'required|numeric|between:1,65535'
daemonSFTP'required|numeric|between:1,65535'
daemonBase'sometimes|required|regex:/^([\/][\d\w.\-\/]+)$/'

Response

Success: 201. Response attributes: Application NodeTransformer. 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.

$node = $this->creationService->handle($request->validated());

return $this->fractal->item($node)
    ->transformWith($this->getTransformer(NodeTransformer::class))
    ->addMeta([
        'resource' => route('api.application.nodes.view', [
            'node' => $node->id,
        ]),
    ])
    ->respond(201);

PATCH /api/application/nodes/{node:id}

Update an existing node on the Panel.

Access: Administrator account; nodes ACL WRITE.

Source: Route · Controller · Request validation

Model constraints: Node.php (including runtime rules and uniqueness checks for updates).

Path parameters: node: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.

FieldValidation
public'boolean'
name'required|regex:/^([\w .-]{1,100})$/'
description'string|nullable'
country_code'sometimes|nullable|string|size:2'
query_address['sometimes', 'nullable', 'string', 'max:253', 'regex:/^(?:[a-zA-Z0-9][a-zA-Z0-9.-]*|[a-fA-F0-9:]+)$/']
sftp_domain['sometimes', 'nullable', 'string', 'max:253', 'regex:/^(?:[a-zA-Z0-9][a-zA-Z0-9.-]*|[a-fA-F0-9:]+)$/']
location_id'required|exists:locations,id'
fqdn'required|string'
scheme'required'
behind_proxy'boolean'
maintenance_mode'boolean'
memory'required|numeric|min:1'
memory_overallocate'required|numeric|min:-1'
disk'required|numeric|min:1'
disk_overallocate'required|numeric|min:-1'
upload_size'int|min:1'
daemonListen'required|numeric|between:1,65535'
daemonSFTP'required|numeric|between:1,65535'
daemonBase'sometimes|required|regex:/^([\/][\d\w.\-\/]+)$/'

Other controller inputs: reset_secret.

Response

Success: 200. Response attributes: Application NodeTransformer. 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.

$node = $this->updateService->handle(
    $node,
    $request->validated(),
    $request->input('reset_secret') === true
);

return $this->fractal->item($node)
    ->transformWith($this->getTransformer(NodeTransformer::class))
    ->toArray();

DELETE /api/application/nodes/{node:id}

Deletes a given node from the Panel as long as there are no servers currently attached to it.

Access: Administrator account; nodes ACL WRITE.

Source: Route · Controller · Request validation

Validation is inherited from ApplicationApiRequest.php.

Path parameters: node: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->handle($node);

return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);

GET /api/application/nodes/{node:id}/allocations

Return all the allocations that exist for a given node.

Access: Administrator account; allocations ACL READ.

Source: Route · Controller · Request validation

Validation is inherited from ApplicationApiRequest.php.

Path parameters: node:id. See identifiers.

Other controller inputs: per_page.

List query options: filters declared in AllowedFilter::exact('ip'), AllowedFilter::exact('port'), 'ip_alias', AllowedFilter::callback('server_id', function (Builder $builder, $value) { if (empty($value) \|\| is_bool($value) \|\| !ctype_digit((string) $value)) { return $builder->whereNull('server_id'. Use filter[name]=value and sort=-id only with supported fields.

Response

Success: 200. Response attributes: Application AllocationTransformer. 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.

$allocations = QueryBuilder::for($node->allocations())
    ->allowedFilters(
        AllowedFilter::exact('ip'),
        AllowedFilter::exact('port'),
        'ip_alias',
        AllowedFilter::callback('server_id', function (Builder $builder, $value) {
            if (empty($value) || is_bool($value) || !ctype_digit((string) $value)) {
                return $builder->whereNull('server_id');
            }

            return $builder->where('server_id', $value);
        }),
    )
    ->paginate($request->query('per_page') ?? 50);

return $this->fractal->collection($allocations)
    ->transformWith($this->getTransformer(AllocationTransformer::class))
    ->toArray();

Example request

curl --get "${PANEL_URL}/api/application/nodes/RESOURCE_ID/allocations" \
  --header "Authorization: Bearer ${APPLICATION_API_KEY}" \
  --header "Accept: application/json"

POST /api/application/nodes/{node:id}/allocations

Store new allocations for a given node.

Access: Administrator account; allocations ACL WRITE.

Source: Route · Controller · Request validation

Path parameters: node: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.

FieldValidation
ip'required|string'
alias'sometimes|nullable|string|max:191'
ports'required|array'
ports.*'string'

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->assignmentService->handle($node, $request->validated());

return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);

DELETE /api/application/nodes/{node:id}/allocations/{allocation:id}

Delete a specific allocation from the Panel.

Access: Administrator account; allocations ACL WRITE.

Source: Route · Controller · Request validation

Validation is inherited from ApplicationApiRequest.php.

Path parameters: node:id, allocation: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->handle($allocation);

return new JsonResponse([], JsonResponse::HTTP_NO_CONTENT);