# 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 Id

Returns

  • (Promise)

# function getServerStatus(serverId)

Gets a server's status, so whether it is running, starting or powered off

Parameters

  • serverId (String) - Server Id

Returns

  • (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 number

Returns

  • (Promise)

# function startServer(serverId)

Starts a server

Parameters

  • serverId (String) - Server Id

Returns

  • (Promise)

# function stopServer(serverId)

Stops a server

Parameters

  • serverId (String) - Server Id

Returns

  • (Promise)

# function restartServer(serverId)

Restarts a server

Parameters

  • serverId (String) - Server Id

Returns

  • (Promise)

# function killServer(serverId)

Kills a server

Parameters

  • serverId (String) - Server Id

Returns

  • (Promise)

# function sendServerCommand(serverId, command)

Sends a command to a server

Parameters

  • serverId (String) - Server Id
  • command (String) - Server Command

Returns

  • (Promise)

# function getServerUsages(serverId)

Gets a servers current memory/cpu/disk usages as bytes

Parameters

  • serverId (String) - Server Id

Returns

  • (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 Id

Returns

  • (Promise)

# function renameServer(serverId, newName)

Renames the target server

Parameters

  • serverId (String) - Server Id
  • newName (String) - New Name of Server

Returns

  • (Promise)

# function reInstallServer(serverId)

ReInstalls a target server

Parameters

  • serverId (String) - Server Id

Returns

  • (Promise)

# function listServerBackups(serverId)

Lists what backups a server has

Parameters

  • serverId (String) - Server Id

Returns

  • (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 Id

Returns

  • (Promise)

# function getBackupDetails(serverId, backupId)

Gets details about a specified server backups

Parameters

  • serverId (String) - Server Id
  • backupId (Integer) - Backup Id

Returns

  • (Promise)

# function getBackupDownload(serverId, backupId)

Gets a clickable URL to download your server backup

Parameters

  • serverId (String) - Server Id
  • backupId (Integer) - Backup Id

Returns

  • (Promise)

# function deleteBackup(serverId, backupId)

Deletes a specified backup

Parameters

  • serverId (String) - Server Id
  • backupId (Integer) - Backup Id

Returns

  • (Promise)

# function getSubUsers(serverId)

Get subusers of a server

Parameters

  • serverId (String) - Server Id

Returns

  • (Promise)

# function createSubUser(serverId, email, permissions)

Create subuser on a server

Parameters

  • serverId (String) - Server Id
  • email (String) - Email
  • permissions (Array) - Array of Permissions

Returns

  • (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 Id

Returns

  • (Promise)

# function updateEmail(newEmail, currentPassword)

Updates the email for the specified host and API key

Parameters

  • newEmail (String) - New Email
  • currentPassword (String) - Current Password

Returns

  • (Promise)

# function updatePassword(newPassword, currentPassword)

Updates the password for the specified host and api key

Parameters

  • newPassword (String) - New Password
  • currentPassword (String) - Current Password

Returns

  • (Promise)

# function getServerStartup(serverId)

Gets the startup variables for a server

Parameters

  • serverId (String) - id of the server to get startup

Returns

  • (Promise)

# function setServerStartup(serverId, key, value)

Sets the startup variables for a server

Parameters

  • serverId (String) - id of the server to set startup
  • key (String) - the name of the startup variable
  • value (String) - what to set the startup variable to

Returns

  • (Promise)
Last Updated: 9/5/2021, 2:10:36 PM