Application¶
- class Application(host, key)¶
Main class constructor
- Arguments
host – Where your panel is hosted (EG: http(s)://panel.host.net/)
Create¶
createUser()¶
- Application.createUser(Username, Email, FirstName, LastName)¶
Creates a user
- Arguments
Username (String) – Users username
Email (String) – Users email
FirstName (String) – Users first name
LastName (String) – Users last name
- Returns
Promise.<unknown> –
createServer()¶
- Application.createServer(Version, NameOfServer, OwnerID, EggID, DockerImage, StartupCmd, RAM, Swap, Disk, IO, CPU, AmountOfDatabases, AmountOfBackups, AmountOfAllocations)¶
Creates a server
- Arguments
Version (String) – Version of the server to use
NameOfServer (String) – Name of server to create
OwnerID (Integer) – User ID of who should own this server
EggID (Integer) – Egg ID to use when installing the server
DockerImage (String) – The image to use from Docker
StartupCmd (String) – The command to use when starting this server (AKA JVM Arguments)
RAM (Integer) – The amount of RAM the server has
Swap (Integer) – The amount of Swap the server has
Disk (Integer) – The amount of Storage the server has
IO (Integer) – Set this to 500 please. (Even if you know what it is leave it alone)
CPU (Integer) – The amount of CPU Power the server can use (100 = 1 core);
AmountOfDatabases (Integer) – The max amount of databases a server can use
AmountOfBackups (Integer) – The max backups you can hold
AmountOfAllocations (Integer) – The max amount of allocation(s) a server can us
- Returns
Promise.<unknown> –
createSimpleServer()¶
- Application.createSimpleServer(OwnerID, EggID, RAM, Disk, CPU, AmountOfDatabases, AmountOfBackups, AmountOfAllocations)¶
Creates a server
- Arguments
OwnerID (Integer) – User ID of who should own this server
EggID (Integer) – Egg ID to use when installing the server
RAM (Integer) – The amount of RAM the server has
Disk (Integer) – The amount of Storage the server has
CPU (Integer) – The amount of CPU Power the server can use (100 = 1 core);
AmountOfDatabases (Integer) – The max amount of databases a server can use
AmountOfBackups (Integer) – The max backups you can hold
AmountOfAllocations (Integer) – The max amount of allocation(s) a server can us
- Returns
Promise.<unknown> –
Update¶
updateUserDetails()¶
- Application.updateUserDetails(userId, Email, Username, FirstName, LastName, Language, Password)¶
UpdateUserDetails By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true”
- Arguments
userId (Integer) –
Email (String) –
Username (String) –
FirstName (String) –
LastName (String) –
Language (String) –
Password (String) –
- Returns
Promise.<Boolean> –
updateServerDetails()¶
- Application.updateServerDetails(serverId, Name, userId, externalId, Description)¶
UpdateServerDetails By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true”
- Arguments
serverId (Integer) –
Name (String) –
userId (Integer) –
externalId (Integer) –
Description (String) –
- Returns
Promise.<Boolean> –
updateServerBuild()¶
- Application.updateServerBuild(serverId, AllocationID, RAM, Swap, IO, CPU, Disk, Threads, AmountOfDatabases, AmountOfBackups, AmountOfAllocations)¶
UpdateServerBuild By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true”
- Arguments
serverId (Integer) –
AllocationID (Integer) –
RAM (Integer) –
Swap (Integer) –
IO (Integer) –
CPU (Integer) –
Disk (Integer) –
Threads (Integer) –
AmountOfDatabases (Integer) –
AmountOfBackups (Integer) –
AmountOfAllocations (Integer) –
- Returns
Promise.<Boolean> –
updateServerStartup()¶
- Application.updateServerStartup(serverId, StartupCmd, Environment, Egg, DockerImage, SkipScripts)¶
UpdateServerStartup
This update the startup details for a specified server
- Arguments
serverId – ID of serer
StartupCmd – new startup command to use for this server
Environment – The environment object for this server to use
Egg – Egg ID for this serer to use
DockerImage – Docker Image for this serer
SkipScripts – Do you want to skip scripts? (have no idea what this is)
- Returns
Promise.<unknown> –
suspendServer()¶
- Application.suspendServer(serverId)¶
Suspend a server if the host and api key have permission By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true”
- Arguments
serverId (Integer) –
- Returns
Promise.<Boolean> –
unsuspendServer()¶
- Application.unsuspendServer(serverId)¶
Unsuspend a server if the host and api key have permission By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true”
- Arguments
serverId (Integer) –
- Returns
Promise.<Boolean> –
reinstallServer()¶
- Application.reinstallServer(serverId)¶
Reinstall a server if the host and api key have permission By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true”
- Arguments
serverId (Integer) –
- Returns
Promise.<Boolean> –
Delete¶
deleteServer()¶
- Application.deleteServer(serverId)¶
Deletes a specified server
By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true” However do not this value will NEVER be false. To catch an error for this request you check if the caught error === 404, this will mean the provided API key was non existing.
MUST USE ClientAPI Key!!! Application API Keys NO LONGER WORK with ANY Pterodactyl version 1 and above!
- Returns
Promise.<Boolean> –
deleteUser()¶
- Application.deleteUser(userId)¶
Deletes a specified user
By default Pterodactyl API returns a empty string on success (“”), i altered the response to make it a boolean value of “true” However do not this value will NEVER be false. To catch an error for this request you check if the caught error === 404, this will mean the provided API key was non existing.
MUST USE ClientAPI Key!!! Application API Keys NO LONGER WORK with ANY Pterodactyl version 1 and above!
- Returns
Promise.<Boolean> –
Fetch¶
getAllUsers()¶
- Application.getAllUsers(Page)¶
Gets a list of users from your panel
- Arguments
Page (Integer) – number
- Returns
Promise.<unknown> –
getAllServers()¶
- Application.getAllServers()¶
Gets a list of servers from your panel, currently this only get the first page but i will add support for grabbing ALL pages with this methods
- Returns
Promise.<unknown> –
getUserDetails()¶
- Application.getUserDetails(userId)¶
Gets details of a user
- Arguments
userId (Integer) –
- Returns
Promise.<unknown> –
getServerDetails()¶
- Application.getServerDetails(serverId)¶
Gets a info of a server from your panel
- Arguments
serverId (Integer) –
- Returns
Promise.<unknown> –
getUserByUsername()¶
- Application.getUserByUsername(username)¶
Gets details of a user by username
- Arguments
username (String) –
- Returns
Promise.<unknown> –
getUserByEmail()¶
- Application.getUserByEmail(email)¶
Gets details of a user
- Arguments
email (String) –
- Returns
Promise.<unknown> –
getUserPage()¶
- Application.getUserPage(pageNum)¶
Gets users by a specified page number
This will return an empty array if the specified page was invalid.
- Returns
Promise.<unknown> –