[#3c9g25] Add support for new endpoint to collect node information

This commit is contained in:
Dane Everitt 2019-12-09 21:05:39 -08:00
parent 979bdc1f9f
commit 564d947f7e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 74 additions and 5 deletions

View file

@ -2,6 +2,25 @@
namespace Pterodactyl\Repositories\Wings;
use GuzzleHttp\Exception\TransferException;
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
class DaemonConfigurationRepository extends DaemonRepository
{
/**
* Returns system information from the wings instance.
*
* @return array
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
*/
public function getSystemInformation(): array
{
try {
$response = $this->getHttpClient()->get('/api/system');
} catch (TransferException $exception) {
throw new DaemonConnectionException($exception);
}
return json_decode($response->getBody()->__toString(), true);
}
}