README
dynoxhost.js
Installation
You can either install it via npm and yarn:
npm install --save dynoxhost.js
yarn add dynoxhost.js
or if you need to install it in Dynox Hosting:
Add "dynoxhost.js": "latest"
at the end of your dependencies in package.json file
Requirements
API Key
- User API Key of Dynox Host
How to get API-KEY
- Visit the panel
- Login with your credentials
- Click on the User-Icon in the upper right side of the panel
- Choose the Tab API Credentials
- Choose a Description
- Leave the IP field blank if you dont know what this means
- Click
Create
- Copy the API-Key. Dont share the API-Key with anyone. Dynox Host will never ask you about the Key
- Use the key for controlling your server and to get data
Example
Synchronous:
const DynoxHost = require('dynoxhost.js');
const dh = new DynoxHost('USER_API_KEY');
dh.getUsage('SERVER_ID').then(console.log);
Asynchronous:
const DynoxHost = require('dynoxhost.js');
const dh = new DynoxHost('USER_API_KEY');
let data = await dh.getUsage('SERVER_ID');
console.log(data);
You can find other examples here.
Reference
serverID
= Your Bot/Server ID
backupID
= Your Backup ID
state
= Power State (can be: start, stop, restart, kill)
getDetails(serverID)
Get all server informations. Ex: NamegetUsage(serverID)
Get the server usage. Ex: RAMsetPowerState(serverID, state)
Start/Stop/Kill/Restart the server remotelycreateBackup(serverID)
Creates a new backup of your servergetBackupDetails(serverID, backupID)
Gives you details about a backup
Links
License
© Copyright 2021, Dynox Hosting