|
@@ -86,6 +86,33 @@ class Pterodactyl
|
|
|
if ($response->failed()) throw self::getException("Failed to get nodes from pterodactyl - ", $response->status());
|
|
|
return $response->json()['data'];
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return mixed
|
|
|
+ * @throws Exception
|
|
|
+ * @description Returns the infos of a single node
|
|
|
+ */
|
|
|
+ public static function getNode($id) {
|
|
|
+ try {
|
|
|
+ $response = self::client()->get('/application/nodes/' . $id);
|
|
|
+ } catch(Exception $e) {
|
|
|
+ throw self::getException($e->getMessage());
|
|
|
+ }
|
|
|
+ if($response->failed()) throw self::getException("Failed to get node id " . $id . " - " . $response->status());
|
|
|
+ return $response->json()['attributes'];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public static function getServers() {
|
|
|
+ try {
|
|
|
+ $response = self::client()->get('/application/servers');
|
|
|
+ } catch (Exception $e) {
|
|
|
+ throw self::getException($e->getMessage());
|
|
|
+ }
|
|
|
+ if($response->failed()) throw self::getException("Failed to get list of servers - ", $response->status());
|
|
|
+ return $response->json()['data'];
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @return null
|