Server
Type: class
Servers are virtual machines that can be provisioned.
Functions
#changeName([name])
Parameter | Type | Description |
---|---|---|
name | string |
The new name for the server |
Returns: Promise<Server>
Change the name of the server.
#delete()
Returns: Promise<Action>
Deletes the server.
#getActions([params])
Parameter | Type | Description |
---|---|---|
params | Object |
Can be used for sorting |
Returns: Promise<ServerActionList>
Get an action list for this specific server.
#getAction(id)
Parameter | Type | Description |
---|---|---|
id | number |
The action id |
Returns: Promise<Action>
Get a specific action for this server.
#powerOn()
Returns: Promise<Action>
Power on a server.
#powerOff()
Returns: Promise<Action>
Cuts power to the server. You may loose data by doing this.
#reboot()
Returns: Promise<Action>
Reboots a server gracefully by sending an ACPI request.
#reset()
Returns: Promise<Action>
Same as #powerOff() but starts the server after powering off.
#shutdown()
Returns: Promise<Action>
Shuts down a server gracefully by sending an ACPI shutdown request.
#resetPassword()
Returns: Promise<Object>
Tells the server to reset the root password.
Returned object
{
"rootPassword": "ABC123",
"action": // ... An Action instance
}
#enableRescue([type[, sshKeys]])
Parameter | Type | Description |
---|---|---|
type | string |
Can be linux64 , linux32 or freebsd64 (default: linux64 ) |
sshKeys | Array |
An array of numbers , strings or SSHKeys |
Returns: Promise<Object>
Enables rescue mode.
Returned object
{
"rootPassword": "ABC123",
"action": // ... An Action instance
}
#disableRescue()
Returns: Promise<Action>
Disable rescue mode.
#createImage([type[, description]])
Parameter | Type | Description |
---|---|---|
type | string |
Can be snapshot or backup |
description | string |
The description for the new image |
Returns: Promise<Object>
Creates a new image.
Returned object
{
"image": // ... An Image instance
"action": // ... An Action instance
}
#rebuild(image)
Parameter | Type | Description |
---|---|---|
image | number , string or Image |
The image the server will be rebuilt from |
Returns: Promise<Action>
Rebuild the server from an image.
#changeType(type[, upgradeDisk])
Parameter | Type | Description |
---|---|---|
type | number , string or ServerType |
ID, name or ServerType the server should migrate to |
upgradeDisk | boolean |
Does not upgrade the disk if false |
Returns: Promise<Action>
Changes the server type.
#enableBackup([backupWindow])
Parameter | Type | Description |
---|---|---|
backupWindow | string |
UTC time window: 22-02 , 02-06 , 06-10 , 10-14 , 14-18 or 18-22 |
Returns: Promise<Action>
Enables backups for this server.
#disableBackup()
Returns: Promise<Action>
Disables backups for this server.
#attachISO(iso)
Parameter | Type | Description |
---|---|---|
iso | number , string or ISO |
ISO to be attached to the server |
Returns: Promise<Action>
Attaches an ISO.
#detachISO()
Returns: Promise<Action>
Detach any attached ISO.
#changeProtection(data)
Parameter | Type | Description |
---|---|---|
data | Object |
See below. |
Returns: Promise<Action>
Data object
{
"delete": // If true, prevents the server from being deleted
"rebuild": // If true, prevents the server from being rebuilt
}
#requestConsole()
Returns: Promise<Object>
Requests access to the console via VNC.
Returned object
{
wssUrl: "wss://...", // Secure websocket URL
password: "...", // VNC password
action: // An instance of Action
}
Properties
.id
Type: number
.name
Type: string
.status
Type: string
Will be either running
, initializing
, starting
, stopping
, off
, deleting
, migrating
, rebuilding
or unknown
.
.created
Type: Date
.publicNet
Type: PublicNetwork
.serverType
Type: ServerType
.datacenter
Type: Datacenter
.image
Type: Image
or null
.iso
Type: ISO
or null
.rescueEnabled
Type: boolean
.locked
Type: boolean
.backupWindow
Type: string
or null
.traffic
Type: Traffic
.rootPassword
Type: string
or null
This variable is only set when creating a server.
.protection
Type: Object
Protection configuration for the server.