# Server Builder
# class ServerBuilder(object)
Object = server JSON data, leave blank if you dont have and object and just want to use ServerBuilder
Parameters
object
(ServerOptions)
# function
setJson(json)
Sets the entire Server JSON object
Parameters
json
(JSON)
# function
createServer(applicationInstance)
Creates the server directly from this class using your NodeactylApplication instance Make sure to login to the Application before passing it through this function!
Parameters
applicationInstance
(Object) - Your NodeactylApplication instanceReturns
- (Promise)
# function
setServerName(serverName)
Sets the servers name
Parameters
serverName
(String)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerOwner(ownerId)
Sets the owners ID
Parameters
ownerId
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerEgg(eggId)
Sets the servers egg to use By default this is 1
Parameters
eggId
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerDockerImage(dockerImage)
Sets the servers docker image to use By default this is set to Java
Parameters
dockerImage
(String)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerStartup(startupCmd)
Sets the servers startup comand to use By default this is set to "java -Xms128M -Xmx128M -jar server.jar"
Parameters
startupCmd
(String)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerLimitsJson(json)
If you want to set all server limits at one time, you can make a JSON object and insert it here
Parameters
json
(JSON)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerRAM(ram)
Max amount of RAM this server can have in MB
Parameters
ram
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerSwap(swap)
Max amount of swam this server can have in MB
Parameters
swap
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerIO(io)
Sets the IO for this server to use in MB (Prolly shouldnt change this)
Parameters
io
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerCPU(cpu)
Sets the max amount of CPU usage for this server, 100 = 1 core 200 = 2 cores etc etc
Parameters
cpu
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerFeatureLimitsJson(json)
If you want to set all feature limits at one time, insert a JSON object here
Parameters
json
(JSON)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerDatabaseLimit(databaseLimit)
Sets the amount of databases this server is allowed to have
Parameters
databaseLimit
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerAllocationLimit(allocationLimit)
Sets the allocation limit of this server
Parameters
allocationLimit
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerBackupLimit(backupLimit)
Sets the max amount of backups this server is allowed to have
Parameters
backupLimit
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerEnvironmentJson(json)
If want all env variables set at once, insert a JSON object here
Parameters
json
(JSON)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerEnvironmentVersion(version)
Sets the environment version number, do note this doesnt work with all eggs, if you want and egg added it must be public and on github (or any git provider)! By default these are all set to "LATEST"
Parameters
version
(String)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerNodeJSStartupCommand(command)
If your using a NodeJS egg, set the startup command here otherwise dont use this
Parameters
command
(String)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerAllocationJson(json)
If you want allocations set at once, insert your json data here
Parameters
json
(JSON)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerDefaultAllocation(allocationId)
Sets the default servers allocation By default this is 1
Parameters
allocationId
(Integer)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerAdditionalAllocations(allocations)
Allows you to add multiple allocations to this serer By default this is an empty array []
Parameters
allocations
(Array)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerDeployJson(json)
If you want to set server deploy data at once, insert json object here
Parameters
json
(JSON)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerDeployLocations(locations)
Sets the locations of where to deploy this to MUST BE AN ARRAY By default this is set to [1]
Parameters
locations
(Array)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerUsesDedicatedIp(yesOrNo)
Sets wether or not this server should get its own dedicated IP By default this is false
Parameters
yesOrNo
(Boolean)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerPortRange(portRange)
Sets a range of ports that this server can use By default this value is empty []
Parameters
portRange
(Array)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerStartsWhenCompleted(yesOrNo)
Sets wether or not you want this server to start when it has finished creating By default this is set at true
Parameters
yesOrNo
(Boolean)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerSkipScripts(yesOrNo)
Sets wether or not this server should skip scripts By default this value is set as false
Parameters
yesOrNo
(Boolean)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
setServerOOMDisabled(isDisabled)
Sets wether or not you want OOM disabled By default this value is set as true
Parameters
isDisabled
(Boolean)Returns
- (ServerBuilder) - The ServerBuilder instance
# function
getServerObject()
Returns the servers JSON object
Returns
- (ServerOptions)