# Application
# class NodeactylApplication(host, key)
Main class constructor
Parameters
host
- Where your panel is hosted (EG: http(s)://panel.host.net/)key
# function
getAllUsers(Page)
Gets a list of users from your panel
Parameters
Page
(Integer) - numberReturns
- (Promise)
# function
getUserDetails(userId)
Gets details of a user
Parameters
userId
(Integer)Returns
- (Promise)
# function
getUserByUsername(username)
Gets details of a user by username
Parameters
username
(String)Returns
- (Promise)
# function
getUserByEmail(email)
Gets details of a user
Parameters
Returns
- (Promise)
# function
getUserPage(pageNum)
Gets users by a specified page number This will return an empty array if the specified page was invalid.
Parameters
pageNum
Returns
- (Promise)
# function
createUser(Email, Username, FirstName, LastName, Password)
Creates a user
Parameters
Username
(String) - Users usernameFirstName
(String) - Users first nameLastName
(String) - Users last namePassword
(String) - Users password (optional)Returns
- (Promise)
# function
updateUserDetails(userId, Email, Username, FirstName, LastName, Language, Password)
Updates a users details
Parameters
userId
(Integer)Username
(String)FirstName
(String)LastName
(String)Language
(String)Password
(String)Returns
- (Promise)
# function
createServer(Version, NameOfServer, OwnerID, EggID, DockerImage, StartupCmd, RAM, Swap, Disk, IO, CPU, AmountOfDatabases, AmountOfBackups, AmountOfAllocations)
Creates a server !! DEPRECATED !!
Parameters
Version
(String) - Version of the server to useNameOfServer
(String) - Name of server to createOwnerID
(Integer) - User ID of who should own this serverEggID
(Integer) - Egg ID to use when installing the serverDockerImage
(String) - The image to use from DockerStartupCmd
(String) - The command to use when starting this server (AKA JVM Arguments)RAM
(Integer) - The amount of RAM the server hasSwap
(Integer) - The amount of Swap the server hasDisk
(Integer) - The amount of Storage the server hasIO
(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 useAmountOfBackups
(Integer) - The max backups you can holdAmountOfAllocations
(Integer) - The max amount of allocation(s) a server can usReturns
- (Promise)
# function
createRawServer(object)
Creates a server using a raw JSON object
Parameters
object
Returns
- (Promise)
# function
createSimpleServer(OwnerID, EggID, RAM, Disk, CPU, AmountOfDatabases, AmountOfBackups, AmountOfAllocations)
Creates a server
Parameters
OwnerID
(Integer) - User ID of who should own this serverEggID
(Integer) - Egg ID to use when installing the serverRAM
(Integer) - The amount of RAM the server hasDisk
(Integer) - The amount of Storage the server hasCPU
(Integer) - The amount of CPU Power the server can use (100 = 1 core);AmountOfDatabases
(Integer) - The max amount of databases a server can useAmountOfBackups
(Integer) - The max backups you can holdAmountOfAllocations
(Integer) - The max amount of allocation(s) a server can usReturns
- (Promise)
# function
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)
# function
getServerPage(pageNum)
Gets servers by a specified page number This will return an empty array if the specified page was invalid.
Parameters
pageNum
(Integer)Returns
- (Promise)
# function
getServerDetails(serverId)
Gets a info of a server from your panel
Parameters
serverId
(Integer)Returns
- (Promise)
# function
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!
Parameters
userId
Returns
- (Promise)
# function
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"
Parameters
serverId
(Integer)Returns
- (Promise)
# function
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"
Parameters
serverId
(Integer)Returns
- (Promise)
# function
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"
Parameters
serverId
(Integer)Returns
- (Promise)
# function
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"
Parameters
serverId
(Integer)Name
(String)userId
(Integer)externalId
(Integer)Description
(String)Returns
- (Promise)
# function
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"
Parameters
serverId
(Integer)AllocationID
(Integer)RAM
(Integer)Swap
(Integer)IO
(Integer)CPU
(Integer)Disk
(Integer)Threads
(Integer)AmountOfDatabases
(Integer)AmountOfBackups
(Integer)AmountOfAllocations
(Integer)Returns
- (Promise)
# function
updateServerStartup(serverId, StartupCmd, Environment, Egg, DockerImage, SkipScripts)
UpdateServerStartup This update the startup details for a specified server
Parameters
serverId
- ID of sererStartupCmd
- new startup command to use for this serverEnvironment
- The environment object for this server to useEgg
- Egg ID for this serer to useDockerImage
- Docker Image for this sererSkipScripts
- Do you want to skip scripts? (have no idea what this is)Returns
- (Promise)
# function
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!
Parameters
serverId
Returns
- (Promise)
# function
getNestDetails(nestId)
Gets details of a nest
Parameters
nestId
(Integer)Returns
- (Promise)
# function
getAllLocations()
Get all locations from your panel
Returns
- (Promise)
# function
getLocationPage(pageNum)
Gets locations by a specified page number This will return an empty array if the specified page was invalid.
Parameters
pageNum
(Integer)Returns
- (Promise)
# function
getLocationDetails(locationId)
Gets a info of a location from your panel
Parameters
locationId
(Integer)Returns
- (Promise)
# function
createLocation(short, long)
Creates a new location
Parameters
short
(String) - Identifier for the location Ex: GBlong
(String) - Descrption for the location Ex: London DatacenterReturns
- (Promise)
# function
updateLocationDetails(locationId, short, long)
Updates the short or long location details
Parameters
locationId
(Integer)short
(String) - Identifier for the location Ex: GBlong
(String) - Descrption for the location Ex: London DatacenterReturns
- (Promise)
# function
deleteLocation(locationId)
Deletes a specified location 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.
Parameters
locationId
Returns
- (Promise)
# function
getAllNodes()
Get all nodes from your panel
Returns
- (Promise)
# function
getNodePage(pageNum)
Gets nodes by a specified page number This will return an empty array if the specified page was invalid.
Parameters
pageNum
(Integer)Returns
- (Promise)
# function
getNodeDetails(nodeId)
Gets info of a node from your panel
Parameters
nodeId
(Integer) - the id oftthe node to get the details ofReturns
- (Promise)
# function
getNodeConfig(nodeId)
Gets the configuration of given node
Parameters
nodeId
(Integer) - the id of the node to get the config forReturns
- (Promise)
# function
createNode(name, locationId, fqdn, memory, disk)
Creates a new node
Parameters
name
(String) - name of the new nodelocationId
(Integer) - the id of the location to assign to this nodefqdn
(String) - the Fully Qualified Domain Name (or IP) for this nodememory
(Integer) - the amount of memory/ram this node hasdisk
(Integer) - The amount of storage this node hasReturns
- (Promise)
# function
updateNodeDetails(nodeId, name, description, locationId, fqdn, scheme, behindProxy, maintenanceMode, memory, memoryOver, disk, diskOver, uploadSize, daemonSftp, daemonListen)
Updates the details of the given node
Parameters
nodeId
(Integer) - id of the node to updatename
(String) - name of the nodedescription
(String) - description of the nodelocationId
(String) - id of the location this node belongs tofqdn
(String) - Fully Qualified Domain Name for nodescheme
(String) - scheme for nodebehindProxy
(Boolean) - whether or not node is behind proxy like cloudflaremaintenanceMode
(Boolean) - whether or not the node is under maintenancememory
(Integer) - memory of nodememoryOver
(Integer) - % of memory allowed to go over limitdisk
(Integer) - disk space of the nodediskOver
(Integer) - % of disk allowed to go over limituploadSize
(Integer) - max uploadSize, usually 100daemonSftp
(Integer) - port for sftpdaemonListen
(Integer) - port for daemon to listen onReturns
- (Promise)
# function
deleteNode(nodeId)
Deletes a specified node 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.
Parameters
nodeId
(Integer) - the id of the node to deleteReturns
- (Promise)
# function
getNodeAllocations(nodeId)
Gets the allocations of given node
Parameters
nodeId
(Integer) - the id of the node to get the allocations ofReturns
- (Promise)
# function
createNodeAllocations(nodeId, ip, ports)
Create allocations on given node 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.
Parameters
nodeId
(Integer) - the id of the node to add allocations toip
(String) - the ip of the allocation as a string Ex: "127.0.0.1"ports
(Array) - an array of ports as strings Ex: ["25565", "25575"]Returns
- (Promise)
# function
deleteNodeAllocation(nodeId, allocationId)
Deletes a specified node allocation 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.
Parameters
nodeId
(Integer) - the id of the node to delete the allocation onallocationId
(Integer) - the id of the allocation to deleteReturns
- (Promise)
← Client Server Builder →