Fix up node autodeployment

This commit is contained in:
Dane Everitt 2020-04-12 17:20:09 -07:00
parent fc31d6347e
commit fda88940f7
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
6 changed files with 119 additions and 20 deletions

View file

@ -0,0 +1,25 @@
<?php
namespace Pterodactyl\Http\Controllers\Api\Application\Nodes;
use Pterodactyl\Models\Node;
use Illuminate\Http\JsonResponse;
use Pterodactyl\Http\Requests\Api\Application\Nodes\GetNodeRequest;
use Pterodactyl\Http\Controllers\Api\Application\ApplicationApiController;
class NodeConfigurationController extends ApplicationApiController
{
/**
* 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.
*
* @param \Pterodactyl\Http\Requests\Api\Application\Nodes\GetNodeRequest $request
* @param \Pterodactyl\Models\Node $node
* @return \Illuminate\Http\JsonResponse
*/
public function __invoke(GetNodeRequest $request, Node $node)
{
return JsonResponse::create($node->getConfiguration());
}
}