Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • NetworkManager

Index

Constructors

Properties

cache: Dict<number, NetworkAllocation>
client: PteroClient
serverId: string

Methods

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

    Parameters

    • data: any

      The resolvable allocation object(s).

    Returns any

    The resolved allocation object(s).

  • Fetches the network allocations on the server.

    example
    const server = await client.servers.fetch('1c639a86');
    await server.network.fetch()
    .then(console.log)
    .catch(console.error);

    Returns Promise<Dict<number, NetworkAllocation>>

    The fetched network allocations.

  • Sets the notes of a specified network allocation.

    example
    const server = await client.servers.fetch('1c639a86');
    await server.network.setNote(14, 'bungee')
    .then(console.log)
    .catch(console.error);

    Parameters

    • id: number

      The ID of the network allocation.

    • notes: string

      The notes to set.

    Returns Promise<NetworkAllocation>

    The updated network allocation.

  • Sets the primary allocation of the server.

    example
    const server = await client.servers.fetch('1c639a86');
    await server.network.setPrimary(14)
    .then(console.log)
    .catch(console.error);

    Parameters

    • id: number

      The ID of the network allocation.

    Returns Promise<NetworkAllocation>

    The updated network allocation.

  • unassign(id: number): Promise<void>
  • Unassigns the specified network allocation form the server.

    example
    const server = await client.servers.fetch('1c639a86');
    await server.network.unassign(12).catch(console.error);

    Parameters

    • id: number

      The ID of the network allocation.

    Returns Promise<void>

Generated using TypeDoc