1.0.0 • Published 2 years ago

dashserv.io v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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);
1.0.0

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago