Implement server creation though the API.
Also implements auto-deployment to specific locations and ports.
This commit is contained in:
parent
97ee95b4da
commit
5ed164e13e
24 changed files with 927 additions and 223 deletions
|
@ -57,4 +57,26 @@ interface AllocationRepositoryInterface extends RepositoryInterface
|
|||
* @return array
|
||||
*/
|
||||
public function getAssignedAllocationIds(int $server): array;
|
||||
|
||||
/**
|
||||
* Return a concated result set of node ips that already have at least one
|
||||
* server assigned to that IP. This allows for filtering out sets for
|
||||
* dedicated allocation IPs.
|
||||
*
|
||||
* If an array of nodes is passed the results will be limited to allocations
|
||||
* in those nodes.
|
||||
*
|
||||
* @param array $nodes
|
||||
* @return array
|
||||
*/
|
||||
public function getDiscardableDedicatedAllocations(array $nodes = []): array;
|
||||
|
||||
/**
|
||||
* Return a single allocation from those meeting the requirements.
|
||||
*
|
||||
* @param array $nodes
|
||||
* @param array $ports
|
||||
* @param bool $dedicated
|
||||
* @return \Pterodactyl\Models\Allocation|null
|
||||
public function getRandomAllocation(array $nodes, array $ports, bool $dedicated = false);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Pterodactyl\Contracts\Repository;
|
||||
|
||||
use Generator;
|
||||
use Pterodactyl\Models\Node;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
|
@ -62,4 +63,15 @@ interface NodeRepositoryInterface extends RepositoryInterface, SearchableInterfa
|
|||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function getNodesForServerCreation(): Collection;
|
||||
|
||||
/**
|
||||
* Return the IDs of all nodes that exist in the provided locations and have the space
|
||||
* available to support the additional disk and memory provided.
|
||||
*
|
||||
* @param array $locations
|
||||
* @param int $disk
|
||||
* @param int $memory
|
||||
* @return \Generator
|
||||
*/
|
||||
public function getNodesWithResourceUse(array $locations, int $disk, int $memory): Generator;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue