Documentation Index
Fetch the complete documentation index at: https://mintlify.com/iFamishedX/HungerLib/llms.txt
Use this file to discover all available pages before exploring further.
Panel is the central connection object in HungerLib. It wraps the Pterodactyl Client API with an authenticated HTTP client and exposes every sub-module — schedules, files, backups, databases, startup variables, and commands — as attributes you can hand off to a server object. Every GenericServer and MinecraftServer instance holds a Panel reference and uses it to make all panel requests on your behalf.
Constructor
A human-readable label for this panel connection. Used in log output and
__str__ representations — it has no effect on the API calls themselves.The base URL of your Pterodactyl panel (e.g.
https://panel.example.com). Any trailing slash is stripped automatically so you never need to worry about double-slashes in constructed paths.A Pterodactyl Client API key (prefix
ptlc_). Generate one from your account settings page inside the panel. Application keys are not accepted.Your API key must be a Client API key (prefix
ptlc_), not an Application API key. You can create one under Account → API Credentials in the Pterodactyl panel UI.Health Methods
Before handing aPanel to a server object it is good practice to confirm that the panel is reachable and that your key is valid.
ping() -> bool
Sends a GET /api/client request and returns True when the panel responds with HTTP 200. Returns False on any network error or non-200 status, making it safe to call even when connectivity is uncertain.
validateAPI() -> bool
Sends a GET /api/client/account request and returns True when the panel accepts the key (HTTP 200). A False result means the key is invalid, revoked, or the account has been suspended.
HTTP Primitives
All requests automatically attach theAuthorization: Bearer <api_key>, Accept: application/json, and Content-Type: application/json headers. You rarely need to call these directly — server methods handle routing — but they are available for custom requests.
| Method | Signature | Description |
|---|---|---|
get | get(path, timeout=5) | Performs a GET request against url + path. |
post | post(path, json=None, timeout=5) | Performs a POST request with an optional JSON body. |
delete | delete(path, timeout=5) | Performs a DELETE request. |
patch | patch(path, json=None, timeout=5) | Performs a PATCH request with an optional JSON body. |
_raw_upload(url, file_data)
A special-case method for multipart file uploads. Unlike the standard methods it does not send a Content-Type: application/json header; instead it lets requests set the correct multipart/form-data boundary. Used internally by FileManagerAPI when you call uploadFile() on a server.
API Sub-Modules
Panel instantiates six API sub-modules during __init__ and exposes them as attributes. You do not normally call these directly — GenericServer and MinecraftServer proxy every operation through them.
.schedules
ScheduleAPI — list, create, update, delete, and trigger scheduled tasks..files
FileManagerAPI — list, upload, download, delete, rename, copy, move, compress, and decompress files..backups
BackupsAPI — list, create, delete, and download server backups..databases
DatabasesAPI — list, create, rotate passwords, and delete databases..startup
StartupAPI — read and update startup environment variables..commands
CommandAPI — send console commands to a server.