dashserv.io

1.0.0 • Public • Published

Built with Love Made with Javascript

Discord server NPM version NPM downloads Get Started Now

npm installnfo

dashserv.io

This is an API Wrapper for the API of dashserv.io It uses promises, so you can await the functions or .then().catch() them!

Installation

npm install dashserv.io@latest
const DashServApi = require("dashserv.io");
const DashServ = new DashServApi("API-TOKEN");

// get all your Servers:
DashServ.vServer.getAll() 
  .catch(console.error) // don't forget to catch errors!
  .then(console.log);
// start Server:
DashServ.vServer.start() 
  .catch(console.error) // don't forget to catch errors!
  .then(console.log);
// stop Server:
DashServ.vServer.shutdownServer() 
  .catch(console.error) // don't forget to catch errors!
  .then(console.log);

📫 Join Discord Server for Support


🗂 For more help view Documentation

Get an API-Token here

// way of awaiting something...

const DashServApi = require("dashserv.io");
const DashServ = new DashServApi("API-TOKEN");
(async() => {
  try {
    // get all your Servers:
    const data = await DashServ.vServer.getAll() 
    console.log(data);
  } catch (error) {
    console.error(error);
  }
})();

Methods:

Order / Product

// Currently - none

Dedicated Servers

// Currently - none

V-Servers

// PROPERTY: Shows all validActions
DashServ.vServer.validActions
/**
 * METHODS:
*/
// Lists all vservers in your account
await DashServ.vServer.getAll(); 
// Lists a the single vserver
await DashServ.vServer.getServerData(ServerId);
// List all available images
await DashServ.vServer.getAvailableImages();
// Show Status of a Vserver
await DashServ.vServer.getStatus(ServerId);
// Changes the Resources of cpu, ram and disk amount, if configurated server (+- € + autorestarts)
await DashServ.vServer.changeResource(ServerId, newCpuAmount, newRamAmount, newDiskAmount);
// Starts the Server
await DashServ.vServer.startServer(ServerId);
// shutdowns the Server
await DashServ.vServer.shutdownServer(ServerId);
// stops the Server
await DashServ.vServer.stopServer(ServerId);
// restart the Server
await DashServ.vServer.restartServer(ServerId);
// Resets a Server to default image
await DashServ.vServer.forceResetServer(ServerId);
// reinstalls the server and restarts it with the new image
await DashServ.vServer.reinstallServer(ServerId, image);
// resets the root password
await DashServ.vServer.resetPassword(ServerId);
// Shows all backups
await DashServ.vServer.listBackups(ServerId);
// Creates a backup with a custom name
await DashServ.vServer.createBackup(ServerId, name);
// deletes a created backup with a backup id
await DashServ.vServer.deleteBackup(ServerId, backupUuid);
// restores a backup of a backup id and restarts the server
await DashServ.vServer.restoreBackup(ServerId, backupUuid);
// get all tasks
await DashServ.vServer.getTasks(ServerId);
// get all scheduled tasks
await DashServ.vServer.getScheduledTasks(ServerId);
// create a scheduled task, with a interval and a command (and a optimal nextexecution : timestamp)
await DashServ.vServer.createScheduledTask(ServerId, interval, command, nextexecution[optionial]);
// delete a scheduled task
await DashServ.vServer.deleteScheduledTask(ServerId, taskuuid);
// get all Graphs of a specific timeframe!
await DashServ.vServer.getGraphs(ServerId, timeframe);

Readme

Keywords

Package Sidebar

Install

npm i dashserv.io

Homepage

dashserv.io

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

42.1 kB

Total Files

11

Last publish

Collaborators

  • tomato6966