Files
pterodactyl-panel/app/Contracts/Allocations/CreatesAllocations.php
T
2026-10-12 05:18:56 -04:00

31 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Contracts\Allocations;
use Pterodactyl\Exceptions\DisplayException;
use Pterodactyl\Exceptions\Service\Allocation\CidrOutOfRangeException;
use Pterodactyl\Exceptions\Service\Allocation\InvalidPortMappingException;
use Pterodactyl\Exceptions\Service\Allocation\PortOutOfRangeException;
use Pterodactyl\Exceptions\Service\Allocation\TooManyPortsInRangeException;
use Pterodactyl\Models\Node;
interface CreatesAllocations
{
/**
* Create the allocations of one address on a node. The input is validated here, so it can
* come straight from any caller. A port that cannot be read, falls outside 1025-65535 or
* opens a range of more than 1000 ports is refused with the exceptions below.
*
* @param ActionInput $input allocation_ip (an IP address, CIDR range or hostname), allocation_ports (port numbers, or ranges such as "25565-25570") and optionally allocation_alias
*
* @throws DisplayException
* @throws CidrOutOfRangeException
* @throws InvalidPortMappingException
* @throws PortOutOfRangeException
* @throws TooManyPortsInRangeException
*/
public function create(Node $node, array $input): void;
}