Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ApplicationServerManager

Hierarchy

Index

Constructors

Properties

cache: Dict<number, ApplicationServer>
client: PteroApp

Accessors

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

    • allocations
    • user
    • subusers
    • nest
    • egg
    • variables
    • location
    • node
    • databases

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

    Returns readonly string[]

  • get SORTS(): readonly string[]

Methods

  • _patch(data: any): any
  • adminURLFor(id: number): string
  • Creates a server with the specified options.

    see

    CreateServerOptions.

    example
    app.servers.create({
    name: 'ptero bot',
    user: 5,
    egg: 16,
    dockerImage: 'ghcr.io/parkervcp/yolks:nodejs_17',
    startup: 'if [ -f /home/container/package.json ];' +
    'then /usr/local/bin/npm install; fi;' +
    '/usr/local/bin/node /home/container/{{BOT_JS_FILE}}',
    environment:{
    USER_UPLOAD: false,
    AUTO_UPDATE: false,
    BOT_JS_FILE: 'index.js'
    },
    allocation:{
    default: 24
    }
    })
    .then(console.log)
    .catch(console.error);

    Parameters

    Returns Promise<ApplicationServer>

    The new server.

  • delete(id: number, force?: boolean): Promise<void>
  • 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[]
  • panelURLFor(id: string): string
  • Queries the API for servers 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:

    • name
    • uuid
    • uuidShort
    • identifier (alias for uuidShort)
    • externalId
    • image

    Available sort options:

    • id
    • -id
    • uuid
    • -uuid
    example
    app.servers.query('ARK', { filter: 'name', sort: 'id' })
    .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, ApplicationServer>>

    The queried servers.

  • reinstall(id: number): Promise<void>
  • suspend(id: number): Promise<void>
  • unsuspend(id: number): Promise<void>

Generated using TypeDoc