Class Application

Hierarchy

  • Application

Constructors

Properties

createAllocation: ((nodeId: number, ports: string[], alias?: string, ip?: string) => Promise<string>)

Type declaration

    • (nodeId: number, ports: string[], alias?: string, ip?: string): Promise<string>
    • Returns

      If successful returns Successfully created!

      Example

      const res = await app.createAllocation(1, ['25565']) // res = Successfully created!
      

      Example

      app.createAllocation(1, ['25565'], 'minecraft').then((res) => console.log(res)) // res = Successfully created!
      

      Parameters

      • nodeId: number

        The node id of which you want to create allocations

      • ports: string[]

        Ports array to add

      • alias: string = ''

        The alias for this allocation

      • ip: string = '0.0.0.0'

        IP for the allocation

      Returns Promise<string>

createDatabase: ((name: string, dbHostId: number, serverId: number, allowedIp?: string, options?: DatabaseIncludeInput) => Promise<DatabaseAttributes>)

Type declaration

    • (name: string, dbHostId: number, serverId: number, allowedIp?: string, options?: DatabaseIncludeInput): Promise<DatabaseAttributes>
    • Returns

      Information about the new database

      Example

      const res = await app.createDatabase('DATABASE_1', 1, 1) // res = DatabaseAttributes
      

      Example

      app.createDatabase('DATABASE_1', 1, 1).then((res) => console.log(res)) // res = DatabaseAttributes
      

      Parameters

      • name: string

        Name of the Database

      • dbHostId: number

        ID of the Database Host

      • serverId: number

        The server ID to create the database in

      • allowedIp: string = '%'

        IP allowed to connect, leave "%" if you dont want to restrict

      • Optional options: DatabaseIncludeInput

        Include information about server relationships

      Returns Promise<DatabaseAttributes>

createLocation: ((shortName: string, description?: string, options?: LocationIncludeInput) => Promise<LocationAttributes>)

Type declaration

    • (shortName: string, description?: string, options?: LocationIncludeInput): Promise<LocationAttributes>
    • Returns

      Location information

      Example

      const res = await app.createLocation('Home') // res = LocationAttributes
      

      Example

      app.createLocation('Home').then((res) => console.log(res)) // res = LocationAttributes
      

      Parameters

      • shortName: string

        The short name of the new location

      • Optional description: string

        The description of location

      • Optional options: LocationIncludeInput

        Include information about locations relationships

      Returns Promise<LocationAttributes>

createNode: ((name: string, description: string, locationID: number, fqdn: string, scheme: "http" | "https", ram: number, disk: number, isPublic?: boolean, daemonPort?: number, daemonSFTPPort?: number, ramOverAllocate?: number, diskOverallocate?: number, daemonDir?: string, maintenceMode?: boolean, maxUploadSize?: number, behindProxy?: boolean, options?: NodeIncludeInput) => Promise<NodeAttributes>)

Type declaration

    • (name: string, description: string, locationID: number, fqdn: string, scheme: "http" | "https", ram: number, disk: number, isPublic?: boolean, daemonPort?: number, daemonSFTPPort?: number, ramOverAllocate?: number, diskOverallocate?: number, daemonDir?: string, maintenceMode?: boolean, maxUploadSize?: number, behindProxy?: boolean, options?: NodeIncludeInput): Promise<NodeAttributes>
    • Returns

      Information about the new node

      Example

      const res = await app.createNode('NEW node', 'Good node', 1, 'node.gfd.com', 'https', 8192, 500000) // res = NodeAttributes
      

      Example

      app.createNode('NEW node', 'Good node', 1, 'node.gfd.com', 'https', 8192, 500000).then((res) => console.log(res)) // res = NodeAttributes
      

      Parameters

      • name: string

        The name of the node

      • description: string

        A description for the node

      • locationID: number
      • fqdn: string

        Fully Qualified Domain Name (If you're using an IP scheme needs to be http)

      • scheme: "http" | "https"

        Scheme to use: http or https

      • ram: number

        How much RAM should be allocated for the node?

      • disk: number

        How much disk space be allocated for the node?

      • isPublic: boolean = true

        Is this node public?

      • daemonPort: number = 8080

        The daemon port (default 8080)

      • daemonSFTPPort: number = 2022

        The daemon sftp port (default 2022)

      • ramOverAllocate: number = -1

        Ram overallocation (default -1)

      • diskOverallocate: number = -1

        Disk overallocation (default -1)

      • daemonDir: string = '/var/lib/pterodactyl/volumes'

        Directory of the daemon, normally /var/lib/pterodactyl/volumes

      • maintenceMode: boolean = false

        Is the node in maintence mode?

      • maxUploadSize: number = 100

        Upload size (1-1024)

      • behindProxy: boolean = false

        Is the node behind a proxy?

      • Optional options: NodeIncludeInput

        Include information about relationships

      Returns Promise<NodeAttributes>

createServer: ((name: string, ownerId: number, description: string, nestId: number, eggId: number, defaultAllocationId: number, addAllocationIds?: number[], environment?: ServerEnvironment, cpu?: number, ram?: number, disk?: number, amountOfDatabases?: number, amountOfAllocations?: number, amountOfBackups?: number, startupCmd?: string, dockerImage?: string, swap?: number, io?: number, startOnCompletion?: boolean, options?: ServerIncludesInput) => Promise<ServerAttributes>)

Type declaration

    • (name: string, ownerId: number, description: string, nestId: number, eggId: number, defaultAllocationId: number, addAllocationIds?: number[], environment?: ServerEnvironment, cpu?: number, ram?: number, disk?: number, amountOfDatabases?: number, amountOfAllocations?: number, amountOfBackups?: number, startupCmd?: string, dockerImage?: string, swap?: number, io?: number, startOnCompletion?: boolean, options?: ServerIncludesInput): Promise<ServerAttributes>
    • Returns

      Returns the created server object

      Example

      const res = await app.createServer('BUNGEE', 1, 'BUNGEE SERVER', 1, 1) // res = ServerAttributes
      

      Example

      app.createServer('BUNGEE', 1, 'BUNGEE SERVER', 1, 1).then((res) => console.log(res)) // res = ServerAttributes
      

      Parameters

      • name: string

        Name of server to create

      • ownerId: number

        User ID of who should own this server

      • description: string

        Description of server

      • nestId: number

        ID of the nest to use when making a server

      • eggId: number

        Egg ID to use when installing the server

      • defaultAllocationId: number
      • addAllocationIds: number[] = []
      • Optional environment: ServerEnvironment

        Servers environment variables. Some are REQUIRED! If there is a default value and none is provided default is used!

      • cpu: number = 0

        Amount of cpu resources to give (1 core = 100) (0 unlimited)

      • ram: number = 0

        Amount of memory resources to give (1024 = 1GB) (0 unlimited)

      • disk: number = 0

        Amount of disk space to give (1024 = 1GB) (0 unlimited)

      • amountOfDatabases: number = 0

        The max amount of databases a server can use

      • amountOfAllocations: number = 0

        The max amount of allocation(s) a server can use

      • amountOfBackups: number = 0

        The max amount of backups a server can use

      • Optional startupCmd: string

        The command to use when starting this server

      • Optional dockerImage: string

        The image to use from Docker

      • swap: number = 0

        The amount of Swap the server has

      • io: number = 500

        Set this to 500.

      • startOnCompletion: boolean = false
      • Optional options: ServerIncludesInput

        Include information about server relationships

      Returns Promise<ServerAttributes>

createUser: ((username: string, firstName: string, lastName: string, email: string, password?: string, isAdmin?: boolean, language?: string, externalId?: string) => Promise<UserAttributes>)

Type declaration

    • (username: string, firstName: string, lastName: string, email: string, password?: string, isAdmin?: boolean, language?: string, externalId?: string): Promise<UserAttributes>
    • Returns

      User information

      Example

      const res = await app.createUser('linux123123', 'Linus', 'ADMIN', '[email protected]') // res = UserAttributes
      

      Example

      app.createUser('linux123123', 'Linus', 'ADMIN', '[email protected]').then((res) => console.log(res)) // res = UserAttributes
      

      Parameters

      • username: string

        The username of the user

      • firstName: string

        The first name of the user

      • lastName: string

        The last name of the user

      • email: string

        The email address of the user

      • password: string = ''

        The password of the user

      • isAdmin: boolean = false

        Is the user admin (default false)

      • language: string = 'en'

        The language of the user (default en)

      • Optional externalId: string

        The external id of user

      Returns Promise<UserAttributes>

deleteAllocation: ((nodeId: number, allocationId: number) => Promise<string>)

Type declaration

    • (nodeId: number, allocationId: number): Promise<string>
    • Returns

      If successful returns Successfully deleted!

      Example

      const res = await app.deleteAllocation(1, 5) // res = Successfully deleted!
      

      Example

      app.deleteAllocation(1, 8).then((res) => console.log(res)) // res = Successfully deleted!
      

      Parameters

      • nodeId: number

        The node id of which you want to delete allocation

      • allocationId: number

        The id of allocation to delete

      Returns Promise<string>

deleteDatabase: ((serverId: number, databaseId: number) => Promise<string>)

Type declaration

    • (serverId: number, databaseId: number): Promise<string>
    • Returns

      If successful returns Successfully deleted the database!

      Example

      const res = await app.resetDatabasePassword(1, 1) // res = Successfully deleted the database!
      

      Example

      app.resetDatabasePassword(1, 2).then((res) => console.log(res)) // res = Successfully deleted the database!
      

      Parameters

      • serverId: number

        The server ID to delete the database in

      • databaseId: number

        The ID of the database

      Returns Promise<string>

deleteLocation: ((locationId: number) => Promise<string>)

Type declaration

    • (locationId: number): Promise<string>
    • Returns

      Successfully deleted the location!

      Example

      const res = await app.deleteLocation(1) // res = Successfully deleted the location!
      

      Example

      app.deleteLocation(1).then((res) => console.log(res)) // res = Successfully deleted the location!
      

      Parameters

      • locationId: number

        The location id to delete

      Returns Promise<string>

deleteNode: ((nodeId: number) => Promise<string>)

Type declaration

    • (nodeId: number): Promise<string>
    • Returns

      If successful returns Successfully deleted!

      Example

      const res = await app.deleteNode(1) // res = Successfully deleted!
      

      Example

      app.deleteNode(1).then((res) => console.log(res)) // res = Successfully deleted!
      

      Parameters

      • nodeId: number

        The node id of which you want to get information

      Returns Promise<string>

deleteServer: ((internalId: number, forceDelete?: boolean) => Promise<string>)

Type declaration

    • (internalId: number, forceDelete?: boolean): Promise<string>
    • Returns

      If successful returns Successfully deleted!

      Example

      const res = await app.deleteServer(1) // res = Successfully deleted!
      

      Example

      app.deleteServer(1, true).then((res) => console.log(res)) // res = Successfully deleted!
      

      Parameters

      • internalId: number

        Internal ID of the server to delete

      • forceDelete: boolean = false

        Boolean if forcefully delete a server

      Returns Promise<string>

deleteUser: ((userId: number) => Promise<string>)

Type declaration

    • (userId: number): Promise<string>
    • Returns

      If successful returns Successfully deleted!

      Example

      const res = await app.deleteUser(1) // res = Successfully deleted!
      

      Example

      app.deleteUser(1).then((res) => console.log(res)) // res = Successfully deleted!
      

      Parameters

      • userId: number

        The user id of the user to delete

      Returns Promise<string>

editLocation: ((locationId: number, options: EditLocationOptions) => Promise<LocationAttributes>)

Type declaration

    • (locationId: number, options: EditLocationOptions): Promise<LocationAttributes>
    • Returns

      Location information

      Example

      const res = await app.editLocation(1, 'Homie') // res = LocationAttributes
      

      Example

      app.editLocation(1, undefined, 'Very good locaiton').then((res) => console.log(res)) // res = LocationAttributes
      

      Parameters

      • locationId: number

        The location id to edit

      • options: EditLocationOptions

        Location edit options

      Returns Promise<LocationAttributes>

editNode: ((nodeId: number, options: NodeEditOptions) => Promise<NodeAttributes>)

Type declaration

    • (nodeId: number, options: NodeEditOptions): Promise<NodeAttributes>
    • Returns

      Information about the new node

      Example

      const res = await app.editNode('NEW node', 'Good node', 1, 'node.gfd.com', 'https', 8192, 500000) // res = NodeAttributes
      

      Example

      app.editNode('NEW node', undefined, 1, 'node.gfd.com', undefined, 8192, 500000).then((res) => console.log(res)) // res = NodeAttributes
      

      Parameters

      • nodeId: number

        The node id of which you want to get information

      • options: NodeEditOptions

        Include information about relationships

      Returns Promise<NodeAttributes>

editServerBuild: ((serverId: number, options: EditServerBuild) => Promise<ServerAttributes>)

Type declaration

    • (serverId: number, options: EditServerBuild): Promise<ServerAttributes>
    • Returns

      Server information

      Example

      const res = await app.editServerBuild(1, undefined, undefined, [5, 6]) // res = ServerAttributes
      

      Example

      app.editServerBuild(1, undefined, [1, 3]).then((res) => console.log(res)) // res = ServerAttributes
      

      Parameters

      • serverId: number

        The server ID to get the details of.

      • options: EditServerBuild

        The options to edit

      Returns Promise<ServerAttributes>

editServerDetails: ((serverId: number, options: EditServerDetails) => Promise<ServerAttributes>)

Type declaration

    • (serverId: number, options: EditServerDetails): Promise<ServerAttributes>
    • Returns

      Server information

      Example

      const res = await app.editServerDetails(1, 'Mc server') // res = ServerAttributes
      

      Example

      app.editServerDetails(1, undefined, undefined, 'MC_SERVER').then((res) => console.log(res)) // res = ServerAttributes
      

      Parameters

      • serverId: number

        The server ID to get the details of.

      • options: EditServerDetails

        The options to edit

      Returns Promise<ServerAttributes>

editServerStartup: ((serverId: number, options: EditServerStartup) => Promise<ServerAttributes>)

Type declaration

    • (serverId: number, options: EditServerStartup): Promise<ServerAttributes>
    • Returns

      Server information

      Example

      const res = await app.editServerStartup(1, 'node index.js') // res = ServerAttributes
      

      Example

      app.editServerStartup(1, 'node index.js').then((res) => console.log(res)) // res = ServerAttributes
      

      Parameters

      • serverId: number

        The external server ID to get the details of.

      • options: EditServerStartup

        Include information about server relationships

      Returns Promise<ServerAttributes>

editUser: ((userId: number, options: EditUserOptions) => Promise<UserAttributes>)

Type declaration

    • (userId: number, options: EditUserOptions): Promise<UserAttributes>
    • Returns

      User information

      Example

      const res = await app.editUser(1, 'linux123123', undefined, 'ADMIN_LAST) // res = UserAttributes
      

      Example

      app.editUser(1, undefined, 'Linux').then((res) => console.log(res)) // res = UserAttributes
      

      Parameters

      • userId: number

        The user id of the user to edit

      • options: EditUserOptions

        Options to edit user

      Returns Promise<UserAttributes>

errorHandler: ((error: JSPteroAPIError) => void) = ...

Type declaration

getAllAllocations: ((nodeId: number, options?: AllocationIncludeInput, filter?: AllocationFilterInput) => Promise<Allocation[]>)

Type declaration

    • (nodeId: number, options?: AllocationIncludeInput, filter?: AllocationFilterInput): Promise<Allocation[]>
    • Returns

      Returns information about node

      Example

      const res = await app.getAllAllocations(1) // res = NodeAttributes
      

      Example

      app.getAllAllocations(1).then((res) => console.log(res)) // res = NodeAttributes
      

      Parameters

      Returns Promise<Allocation[]>

getAllLocations: ((options?: LocationIncludeInput, filter?: LocationFilterInput) => Promise<Location[]>)

Type declaration

getAllNestEggs: ((nestId: number, options?: EggIncludeInput) => Promise<Egg[]>)

Type declaration

    • (nestId: number, options?: EggIncludeInput): Promise<Egg[]>
    • Returns

      Example

      const res = await app.getAllNestEggs(1) // res = Egg[]
      

      Example

      app.getAllNestEggs(1).then((res) => console.log(res)) // res = Egg[]
      

      Parameters

      • nestId: number

        The nest ID to get the details of.

      • Optional options: EggIncludeInput

        Include information about: nest or servers or variables

      Returns Promise<Egg[]>

getAllNests: ((options?: NestIncludeInput) => Promise<Nest[]>)

Type declaration

    • (options?: NestIncludeInput): Promise<Nest[]>
    • Returns

      Array of nests

      Example

      const res = await app.getAllNests() // res = Nest[]
      

      Example

      app.getAllNests().then((res) => console.log(res)) // res = Nest[]
      

      Parameters

      Returns Promise<Nest[]>

getAllNodes: ((options?: NodeIncludeInput, filter?: NodeFilterInput) => Promise<Node[]>)

Type declaration

    • (options?: NodeIncludeInput, filter?: NodeFilterInput): Promise<Node[]>
    • Returns

      Array of nodes

      Example

      const res = await app.getAllNodes() // res = Node[]
      

      Example

      app.getAllNodes().then((res) => console.log(res)) // res = Node[]
      

      Parameters

      Returns Promise<Node[]>

getAllServers: ((options?: ServerIncludesInput, filter?: ServerFilterInput) => Promise<Server[]>)

Type declaration

    • (options?: ServerIncludesInput, filter?: ServerFilterInput): Promise<Server[]>
    • Returns

      Array of server

      Example

      const res = await app.getAllServers() // res = Server[]
      

      Example

      app.getAllServers().then((res) => console.log(res)) // res = Server[]
      

      Parameters

      Returns Promise<Server[]>

getAllUsers: ((options?: UserIncludeInput, filter?: UserFilterInput) => Promise<User[]>)

Type declaration

    • (options?: UserIncludeInput, filter?: UserFilterInput): Promise<User[]>
    • Returns

      Array of users

      Example

      const res = await app.getAllUsers() // res = User[]
      

      Example

      app.getAllUsers().then((res) => console.log(res)) // res = User[]
      

      Parameters

      Returns Promise<User[]>

getEggInfo: ((nestID: number, eggId: number, options?: EggIncludeInput) => Promise<EggAttributes>)

Type declaration

    • (nestID: number, eggId: number, options?: EggIncludeInput): Promise<EggAttributes>
    • Returns

      Example

      const res = await app.getEggInfo(1, 1) // res = EggAttributes
      

      Example

      app.getEggInfo(1, 1).then((res) => console.log(res)) // res = EggAttributes
      

      Parameters

      • nestID: number
      • eggId: number

        Egg ID to use when installing the server

      • Optional options: EggIncludeInput

        Include information about: nest or servers or variables

      Returns Promise<EggAttributes>

getLocationInfo: ((locationId: number, options?: LocationIncludeInput) => Promise<LocationAttributes>)

Type declaration

    • (locationId: number, options?: LocationIncludeInput): Promise<LocationAttributes>
    • Returns

      Location information

      Example

      const res = await app.getLocationInfo(1) // res = LocationAttributes
      

      Example

      app.getLocationInfo(1).then((res) => console.log(res)) // res = LocationAttributes
      

      Parameters

      • locationId: number

        The location id to get information about

      • Optional options: LocationIncludeInput

        Include information about locations relationships

      Returns Promise<LocationAttributes>

getNestInfo: ((nestId: number, options?: NestIncludeInput) => Promise<NestAttributes>)

Type declaration

    • (nestId: number, options?: NestIncludeInput): Promise<NestAttributes>
    • Returns

      Nest details

      Example

      const res = await app.getNestInfo(1) // res = NestAttributes
      

      Example

      app.getNestInfo(1).then((res) => console.log(res)) // res = NestAttributes
      

      Parameters

      • nestId: number

        The nest ID to get the details of.

      • Optional options: NestIncludeInput

        Include information about: eggs or servers

      Returns Promise<NestAttributes>

getNodeConfig: ((nodeId: number) => Promise<NodeConfig>)

Type declaration

    • (nodeId: number): Promise<NodeConfig>
    • Returns

      Returns information about node config

      Example

      const res = await app.getNodeConfig(1) // res = NodeConfig
      

      Example

      app.getNodeConfig(1).then((res) => console.log(res)) // res = NodeConfig
      

      Parameters

      • nodeId: number

        The node id of which you want to get information

      Returns Promise<NodeConfig>

getNodeInfo: ((nodeId: number, options?: NodeIncludeInput) => Promise<NodeAttributes>)

Type declaration

    • (nodeId: number, options?: NodeIncludeInput): Promise<NodeAttributes>
    • Returns

      Returns information about node

      Example

      const res = await app.getNodeInfo(1) // res = NodeAttributes
      

      Example

      app.getNodeInfo(1).then((res) => console.log(res)) // res = NodeAttributes
      

      Parameters

      • nodeId: number

        The node id of which you want to get information

      • Optional options: NodeIncludeInput

        Include information about relationships

      Returns Promise<NodeAttributes>

getServerInfo: ((serverId: number, options?: ServerIncludesInput) => Promise<ServerAttributes>)

Type declaration

    • (serverId: number, options?: ServerIncludesInput): Promise<ServerAttributes>
    • Returns

      Server information

      Example

      const res = await app.getServerInfo(1) // res = ServerAttributes
      

      Example

      app.getServerInfo(1).then((res) => console.log(res)) // res = ServerAttributes
      

      Parameters

      • serverId: number

        The server ID to get the details of.

      • Optional options: ServerIncludesInput

        Include information about server relationships

      Returns Promise<ServerAttributes>

getServerInfoByExtId: ((serverId: string, options?: ServerIncludesInput) => Promise<ServerAttributes>)

Type declaration

    • (serverId: string, options?: ServerIncludesInput): Promise<ServerAttributes>
    • Returns

      Server information

      Example

      const res = await app.getServerInfoByExtId('MC_SERVER') // res = ServerAttributes
      

      Example

      app.getServerInfoByExtId('GAMER_SERVER').then((res) => console.log(res)) // res = ServerAttributes
      

      Parameters

      • serverId: string

        The external server ID to get the details of.

      • Optional options: ServerIncludesInput

        Include information about server relationships

      Returns Promise<ServerAttributes>

getServersDatabaseInfo: ((serverId: number, databaseId: number, options?: DatabaseIncludeInput) => Promise<DatabaseAttributes>)

Type declaration

    • (serverId: number, databaseId: number, options?: DatabaseIncludeInput): Promise<DatabaseAttributes>
    • Returns

      Database information

      Example

      const res = await app.getServersDatabaseInfo(1, 1) // res = DatabaseAttributes
      

      Example

      app.getServersDatabaseInfo(1, 2).then((res) => console.log(res)) // res = DatabaseAttributes
      

      Parameters

      • serverId: number

        The server ID to get the database from

      • databaseId: number

        The ID of the database

      • Optional options: DatabaseIncludeInput

        Include information about server relationships

      Returns Promise<DatabaseAttributes>

getServersDatabases: ((serverId: number, options?: DatabaseIncludeInput) => Promise<Database[]>)

Type declaration

    • (serverId: number, options?: DatabaseIncludeInput): Promise<Database[]>
    • Returns

      Array of databases

      Example

      const res = await app.getServersDatabase(1) // res = Database[]
      

      Example

      app.getServersDatabase(1).then((res) => console.log(res)) // res = Database[]
      

      Parameters

      • serverId: number

        The server ID to get the databases from

      • Optional options: DatabaseIncludeInput

        Include information about server relationships

      Returns Promise<Database[]>

getUserInfo: ((userId: number, options?: UserIncludeInput) => Promise<UserAttributes>)

Type declaration

    • (userId: number, options?: UserIncludeInput): Promise<UserAttributes>
    • Returns

      User information

      Example

      const res = await app.getUserInfo(1) // res = UserAttributes
      

      Example

      app.getUserInfo(1).then((res) => console.log(res)) // res = UserAttributes
      

      Parameters

      • userId: number

        The user id to get information about

      • Optional options: UserIncludeInput

        Include information about relationships

      Returns Promise<UserAttributes>

host: string

Panels address

key: string

Api key to use

reinstallServer: ((internalID: number) => Promise<string>)

Type declaration

    • (internalID: number): Promise<string>
    • Returns

      If successful returns Successfully reinstalled!

      Example

      const res = await app.reinstallServer(1) // res = Successfully reinstalled!
      

      Example

      app.reinstallServer(1).then((res) => console.log(res)) // res = Successfully reinstalled!
      

      Parameters

      • internalID: number

      Returns Promise<string>

resetDatabasePassword: ((serverId: number, databaseId: number) => Promise<string>)

Type declaration

    • (serverId: number, databaseId: number): Promise<string>
    • Returns

      If successful returns Successfully reset the password!

      Example

      const res = await app.resetDatabasePassword(1, 1) // res = Successfully reset the password!
      

      Example

      app.resetDatabasePassword(1, 2).then((res) => console.log(res)) // res = Successfully reset the password!
      

      Parameters

      • serverId: number

        The server ID to get the database from

      • databaseId: number

        The ID of the database

      Returns Promise<string>

suspendServer: ((internalID: number) => Promise<string>)

Type declaration

    • (internalID: number): Promise<string>
    • Returns

      If successful returns Successfully suspended!

      Example

      const res = await app.suspendServer(1) // res = Successfully suspended!
      

      Example

      app.suspendServer(1).then((res) => console.log(res)) // res = Successfully suspended!
      

      Parameters

      • internalID: number

      Returns Promise<string>

unSuspendServer: ((internalID: number) => Promise<string>)

Type declaration

    • (internalID: number): Promise<string>
    • Returns

      If successful returns Successfully unsuspended!

      Example

      const res = await app.unSuspendServer(1) // res = Successfully unsuspended!
      

      Example

      app.unSuspendServer(1).then((res) => console.log(res)) // res = Successfully unsuspended!
      

      Parameters

      • internalID: number

      Returns Promise<string>

Methods

  • Remarks

    Will not work if using custom error handler.

    Parameters

    • throwError: boolean = true

      Whether to throw an error or return bool

    Returns Promise<boolean>

Generated using TypeDoc