2017-07-20 01:49:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Contracts\Repository;
|
|
|
|
|
2018-01-05 04:49:50 +00:00
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
2017-07-20 01:49:41 +00:00
|
|
|
interface AllocationRepositoryInterface extends RepositoryInterface
|
|
|
|
{
|
2018-01-21 22:02:03 +00:00
|
|
|
/**
|
|
|
|
* Return all of the allocations that exist for a node that are not currently
|
|
|
|
* allocated.
|
|
|
|
*
|
|
|
|
* @param int $node
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getUnassignedAllocationIds(int $node): array;
|
|
|
|
|
2018-01-28 23:14:14 +00:00
|
|
|
/**
|
|
|
|
* Return a single allocation from those meeting the requirements.
|
|
|
|
*
|
|
|
|
* @param array $nodes
|
|
|
|
* @param array $ports
|
2019-09-06 04:32:57 +00:00
|
|
|
* @param bool $dedicated
|
2018-01-28 23:14:14 +00:00
|
|
|
* @return \Pterodactyl\Models\Allocation|null
|
2018-01-28 23:14:34 +00:00
|
|
|
*/
|
2018-01-28 23:14:14 +00:00
|
|
|
public function getRandomAllocation(array $nodes, array $ports, bool $dedicated = false);
|
2017-07-20 01:49:41 +00:00
|
|
|
}
|