Files
panel/app/Http/Controllers/Api/Application/Nodes/NodeConfigurationController.php

26 lines
812 B
PHP
Raw Normal View History

2020-04-12 17:20:09 -07:00
<?php
2024-03-12 22:39:16 -04:00
namespace App\Http\Controllers\Api\Application\Nodes;
2020-04-12 17:20:09 -07:00
2024-03-12 22:39:16 -04:00
use App\Http\Controllers\Api\Application\ApplicationApiController;
2025-09-24 13:34:19 +02:00
use App\Http\Requests\Api\Application\Nodes\GetNodeRequest;
use App\Models\Node;
use Dedoc\Scramble\Attributes\Group;
2025-09-24 13:34:19 +02:00
use Illuminate\Http\JsonResponse;
2020-04-12 17:20:09 -07:00
#[Group('Node', weight: 1)]
2020-04-12 17:20:09 -07:00
class NodeConfigurationController extends ApplicationApiController
{
/**
* Get node configuration
*
2020-04-12 17:20:09 -07:00
* 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.
*/
public function __invoke(GetNodeRequest $request, Node $node): JsonResponse
2020-04-12 17:20:09 -07:00
{
return new JsonResponse($node->getConfiguration());
2020-04-12 17:20:09 -07:00
}
}