The request object containing the node ID and allocation details to create.
Creates a new node with the specified attributes. This method allows you to create a new node in the Pterodactyl panel
The attributes of the node to create. This should include all required fields as per the Pterodactyl API documentation.
const newNode = await ptero.nodes.createNode({
name: "New Node",
location_id: 1,
fqdn: "node2.example.com",
scheme: "https",
memory: 10240,
memory_overallocate: 0,
disk: 50000,
disk_overallocate: 0,
upload_size: 100,
daemon_sftp: 2022,
daemon_listen: 8080,
});
console.log("New Node Created:", newNode);
Deletes an allocation from a node.
The request object containing the node ID and allocation ID to delete.
Deletes a node by its ID.
The request object containing the node ID to delete.
Fetches all nodes with optional include parameters and pagination.
Optionalinclude: IncludeParameters[]Include parameters to specify related resources to include in the response. Allowed values are IncludeParameters.SERVERS, IncludeParameters.ALLOCATIONS, and IncludeParameters.LOCATION. If not provided, no related resources are included.
Optionalpagination: PaginationOptionsPagination options to control the number of results returned.
The request object containing the node ID to fetch allocations for.
Optionalpagination: PaginationOptionsPagination options to control the number of results returned.
A promise that resolves to an array of allocation attributes.
Fetches the configuration of a node by its ID.
The request object containing the node ID.
Fetches a single node by its ID with optional include parameters.
The request object containing the node ID.
Optionalinclude: IncludeParameters[]Include parameters to specify related resources to include in the response. Allowed values are IncludeParameters.SERVERS, IncludeParameters.ALLOCATIONS, and IncludeParameters.LOCATION. If not provided, no related resources are included.
Updates an existing node with the specified attributes.
The request object containing the node ID and attributes to update.
Module for accessing Pterodactyl nodes endpoints. This module provides methods to access node details, create nodes, update nodes, etc.