1.0.12 • Published 4 years ago

@plainhost/api.js v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

PlainHost Api

Simple API wrapper for PlainHost.xyz

npm npm npm


Installation

NPM

npm install @plainhost/api.js

You need API Key from PlainHost panel to be able to use this.

How to get Api key

  1. Visit our hosting panel and login
  2. Click on the user icon in menu and go to API Credentials
  3. Set any name and leave the "ALLOWED IPS" field empty, then click on create button
  4. Copy your key and you can use it

Example of usage

const PlainHost = require('@plainhost/api.js');
const phclient = new PlainHost('USER_API_KEY');

let data = await phclient.getUsage('YOUR_SERVER_ID');
console.log(data);

Methods

  • getDetails(serverID) Get all server informations. Ex: Name
  • getUsage(serverID) Get the server usage. Ex: RAM
  • setPowerState(serverID, state) Start/Stop/Kill/Restart the server remotely
  • createBackup(serverID) Creates a new backup of your server
  • getBackupDetails(serverID, backupID) Gives you details about a backup

Used variables:

serverID = Your Server ID

backupID = Your Backup ID

state = Power State (can be: start, stop, restart, kill)

Links

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago