Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

cache: Dict<number, Node>
client: PteroApp

Accessors

  • get FILTERS(): readonly string[]
  • get INCLUDES(): readonly string[]
  • Allowed include arguments for nodes:

    • allocations
    • location
    • servers

    Note: not all of these include options have been implemented yet.

    Returns readonly string[]

  • get SORTS(): readonly string[]

Methods

  • _patch(data: any): any
  • Transforms the raw node object(s) into class objects.

    Parameters

    • data: any

      The resolvable node object(s).

    Returns any

    The resolved node object(s).

  • adminURLFor(id: number): string
  • Creates a node.

    see

    CreateNodeOptions.

    example
    app.nodes.create({
    name: 'node04',
    locationId: 2,
    public: false,
    fqdn: 'n4.nodes.pterodactyl.test',
    scheme: 'https',
    behindProxy: false,
    memory: 1024,
    disk: 4000,
    daemonSftp: 2022,
    daemonListen: 8080,
    maintenanceMode: false
    })
    .then(console.log)
    .catch(console.error);

    Parameters

    Returns Promise<Node>

    The new node.

  • delete(id: number): Promise<void>
  • Deletes a node. Note: there must be no servers on the node for this operation to work. Please ensure this before attempting to delete the node.

    example
    app.nodes.delete(3).catch(console.error);
    

    Parameters

    • id: number

      The ID of the node.

    Returns Promise<void>

  • Fetches the deployable nodes from the API following the specified deployable node options. Note that memory and disk are required for deployment options.

    see

    NodeDeploymentOptions.

    example
    app.nodes.fetchDeployable({ memory: 1024, disk: 4000 })
    .then(console.log)
    .catch(console.error);

    Parameters

    Returns Promise<Dict<number, Node>>

    The deployable nodes.

  • getFetchAll<T, K>(...options: unknown[]): Promise<Dict<T, K>>
  • getQueryOptions(): { filters: readonly string[]; includes: readonly string[]; sorts: readonly string[] }
  • Gets the allowed query options from the inherited manager.

    internal

    Returns { filters: readonly string[]; includes: readonly string[]; sorts: readonly string[] }

    The query options.

    • filters: readonly string[]
    • includes: readonly string[]
    • sorts: readonly string[]
  • query(entity: string, options: Filter<{ sort?: string }>): Promise<Dict<number, Node>>
  • Queries the API for nodes that match the specified query filters. This fetches from the API directly and does not check the cache. Use cache methods for filtering and sorting.

    Available query filters:

    • uuid
    • name
    • fqdn
    • daemonTokenId

    Available sort options:

    • id
    • uuid
    • memory
    • disk
    example
    app.nodes.query('nodes.pterodactyl.test', { filter: 'daemonTokenId' })
    .then(console.log)
    .catch(console.error);

    Parameters

    • entity: string

      The entity to query.

    • options: Filter<{ sort?: string }>

      The query options to filter by.

    Returns Promise<Dict<number, Node>>

    The queried nodes.

Generated using TypeDoc