# Client
# class NodeactylClient(host, key)
Main class constructor
Parameters
host- Where your panel is hosted (EG: http(s)://panel.host.net/)key
# function
getAccountDetails()Gets the account details associated with this.hostUrl and this.hostKey MUST USE ClientAPI Key!!! Application API Keys NO LONGER WORK with ANY Pterodactyl version 1 and above!
Returns
- (Promise)
# function
getAccountPermissions()Gets the permissions that this associated host and key have MUST USE ClientAPI Key!!! Application API Keys NO LONGER WORK with ANY Pterodactyl version 1 and above!
Returns
- (Promise)
# function
getServerDetails(serverId)Gets a Server's information NOTE: This does not return any live resource usages such as CPU, memory or RAM, but it will show the max limits of these values
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
getServerStatus(serverId)Gets a server's status, so whether it is running, starting or powered off
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
getAllServers()Gets a list of servers from your panel, currently this only get the first page
Returns
- (Promise)
# function
getServerPage(pageNum)Gets a server by a specified page number
Parameters
pageNum(Integer) - Page numberReturns
- (Promise)
# function
startServer(serverId)Starts a server
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
stopServer(serverId)Stops a server
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
restartServer(serverId)Restarts a server
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
killServer(serverId)Kills a server
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
sendServerCommand(serverId, command)Sends a command to a server
Parameters
serverId(String) - Server Idcommand(String) - Server CommandReturns
- (Promise)
# function
getServerUsages(serverId)Gets a servers current memory/cpu/disk usages as bytes
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
getConsoleWebSocket(serverId)Gets the Console WebSocket instance for a server you will need to establish your own socket connection for now (try socket.io)
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
renameServer(serverId, newName)Renames the target server
Parameters
serverId(String) - Server IdnewName(String) - New Name of ServerReturns
- (Promise)
# function
reInstallServer(serverId)ReInstalls a target server
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
listServerBackups(serverId)Lists what backups a server has
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
createServerBackup(serverId)Creates a backup for a specified server This will send a error code 924 when trying to create 2 backups within a 10 minute time frame
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
getBackupDetails(serverId, backupId)Gets details about a specified server backups
Parameters
serverId(String) - Server IdbackupId(Integer) - Backup IdReturns
- (Promise)
# function
getBackupDownload(serverId, backupId)Gets a clickable URL to download your server backup
Parameters
serverId(String) - Server IdbackupId(Integer) - Backup IdReturns
- (Promise)
# function
deleteBackup(serverId, backupId)Deletes a specified backup
Parameters
serverId(String) - Server IdbackupId(Integer) - Backup IdReturns
- (Promise)
# function
getSubUsers(serverId)Get subusers of a server
Parameters
serverId(String) - Server IdReturns
- (Promise)
# function
createSubUser(serverId, email, permissions)Create subuser on a server
Parameters
serverId(String) - Server Idpermissions(Array) - Array of PermissionsReturns
- (Promise)
# function
getApiKeys()Gets a list of API keys that this assigned host and key have available to them MUST USE ClientAPI Key!!! Application API Keys NO LONGER WORK with ANY Pterodactyl version 1 and above!
Returns
- (Promise)
# function
createApiKey(description, allowedIps)Creates an API key with specified host and api key. WILL NOT PROVIDE SUPPORT FOR THIS COMMAND!!!!!! Make sure to read that previous line ^
Parameters
description(String)allowedIps(Array)Returns
- (Promise)
# function
deleteApiKey(keyId)Deletes a specified API key. Only use the API key identifier provided to you on the panel
Parameters
keyId(Integer) - Key IdReturns
- (Promise)
# function
updateEmail(newEmail, currentPassword)Updates the email for the specified host and API key
Parameters
newEmail(String) - New EmailcurrentPassword(String) - Current PasswordReturns
- (Promise)
# function
updatePassword(newPassword, currentPassword)Updates the password for the specified host and api key
Parameters
newPassword(String) - New PasswordcurrentPassword(String) - Current PasswordReturns
- (Promise)
# function
getServerStartup(serverId)Gets the startup variables for a server
Parameters
serverId(String) - id of the server to get startupReturns
- (Promise)
# function
setServerStartup(serverId, key, value)Sets the startup variables for a server
Parameters
serverId(String) - id of the server to set startupkey(String) - the name of the startup variablevalue(String) - what to set the startup variable toReturns
- (Promise)