2017-07-20 01:49:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Contracts\Repository;
|
|
|
|
|
2018-01-05 04:49:50 +00:00
|
|
|
use Pterodactyl\Models\Node;
|
|
|
|
use Illuminate\Support\Collection;
|
2017-07-20 01:49:41 +00:00
|
|
|
|
2020-09-13 18:29:47 +00:00
|
|
|
interface NodeRepositoryInterface extends RepositoryInterface
|
2017-07-20 01:49:41 +00:00
|
|
|
{
|
2021-01-23 20:33:34 +00:00
|
|
|
public const THRESHOLD_PERCENTAGE_LOW = 75;
|
|
|
|
public const THRESHOLD_PERCENTAGE_MEDIUM = 90;
|
2018-01-05 04:49:50 +00:00
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
/**
|
|
|
|
* Return the usage stats for a single node.
|
|
|
|
*/
|
2018-01-05 04:49:50 +00:00
|
|
|
public function getUsageStats(Node $node): array;
|
2017-08-05 22:20:07 +00:00
|
|
|
|
2018-05-26 22:16:13 +00:00
|
|
|
/**
|
|
|
|
* Return the usage stats for a single node.
|
|
|
|
*/
|
|
|
|
public function getUsageStatsRaw(Node $node): array;
|
|
|
|
|
2017-08-05 22:20:07 +00:00
|
|
|
/**
|
|
|
|
* Return a single node with location and server information.
|
|
|
|
*/
|
2018-01-05 04:49:50 +00:00
|
|
|
public function loadLocationAndServerCount(Node $node, bool $refresh = false): Node;
|
2017-08-05 22:20:07 +00:00
|
|
|
|
|
|
|
/**
|
2018-01-05 04:49:50 +00:00
|
|
|
* Attach a paginated set of allocations to a node mode including
|
|
|
|
* any servers that are also attached to those allocations.
|
2017-08-05 22:20:07 +00:00
|
|
|
*/
|
2018-01-05 04:49:50 +00:00
|
|
|
public function loadNodeAllocations(Node $node, bool $refresh = false): Node;
|
2017-08-05 22:20:07 +00:00
|
|
|
|
2017-07-22 02:17:42 +00:00
|
|
|
/**
|
2017-11-05 20:12:53 +00:00
|
|
|
* Return a collection of nodes for all locations to use in server creation UI.
|
2017-07-22 02:17:42 +00:00
|
|
|
*/
|
2018-01-05 04:49:50 +00:00
|
|
|
public function getNodesForServerCreation(): Collection;
|
2017-07-20 01:49:41 +00:00
|
|
|
}
|