mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-05 05:45:46 -05:00
31 lines
1.2 KiB
PHP
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;
|
|
}
|