Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

cache: Dict<string, Backup>
client: PteroClient
meta: PaginationMeta = ...
serverId: string

Accessors

  • get FILTERS(): readonly never[]
  • get INCLUDES(): readonly never[]
  • get SORTS(): readonly never[]

Methods

  • _patch(data: any): any
  • Transforms the raw backup object(s) into typed objects.

    Parameters

    • data: any

      The resolvable backup object(s).

    Returns any

    The resolved backup object(s).

  • delete(id: string): Promise<void>
  • Deletes a specified backup.

    example
    const server = await client.servers.fetch('34740510');
    await server.backups.delete('c4b9c4c7').catch(console.error);

    Parameters

    • id: string

      The UUID of the backup.

    Returns Promise<void>

  • download(id: string, dest: string): Promise<void>
  • Fetches and saves a backup to a specified path on the system.

    example
    const server = await client.servers.fetch('34740510');
    await server.backups.download('904df120', './bungee-archive.tar.gz')
    .catch(console.error);

    Parameters

    • id: string

      The UUID of the backup.

    • dest: string

      The file path to save the backup to.

    Returns Promise<void>

  • Fetches a backup from the API by its identifier. This will check the cache first unless the force option is specified.

    example
    const server = await client.servers.fetch('34740510');
    await server.backups.fetch({ perPage: 10 })
    .then(console.log)
    .catch(console.error);

    Parameters

    Returns Promise<Backup>

    The fetched backup.

  • Fetches a list of backups from the API with the given options (default is undefined).

    example
    const server = await client.servers.fetch('34740510');
    await server.backups.fetch({ perPage: 10 })
    .then(console.log)
    .catch(console.error);

    Parameters

    Returns Promise<Dict<number, Backup>>

    The fetched backups.

  • getDownloadURL(id: string): Promise<string>
  • Fetches the download URL for a specified backup.

    example
    const server = await client.servers.fetch('34740510');
    await server.backups.getDownloadURL('904df120')
    .then(console.log)
    .catch(console.error);

    Parameters

    • id: string

      The UUID of the backup.

    Returns Promise<string>

    The download URL.

  • 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[]
  • restore(id: string): Promise<void>
  • Restores a specified backup to the server.

    example
    const server = await client.servers.fetch('34740510');
    await server.backups.restore('904df120').catch(console.error);

    Parameters

    • id: string

      The UUID of the backup.

    Returns Promise<void>

  • toggleLock(id: string): Promise<Backup>
  • Toggles the locked status of a backup.

    example
    const server = await client.servers.fetch('34740510');
    await server.backups.toggleLock('904df120')
    .then(console.log)
    .catch(console.error);

    Parameters

    • id: string

      The UUID of the backup.

    Returns Promise<Backup>

    The updated backup.

Generated using TypeDoc