1.0.1 • Published 2 years ago

24fire-full-api v1.0.1

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

The Full 24Fire API for NodeJS.

First you need your Server API Key:

image

Then you can use it like this:

Example

const { config, status, start, stop, restart} = require('24fire-full-api');

(async() => {

const Data = await config('YOUR_SERVER_API_KEY');

console.log(Data);

})();

it should return:

{
  "status": "success",
  "requestID": "9a220700-00c4-42f7-bc8c-9487f09ec72c",
  "message": "VM config retrieved successfully",
  "data": {
    "hostsystem": {
      "datacenter": {
        "name": "SkyLink Data Center BV",
        "country": "Niederlande",
        "city": "Eygelshoven"
      },
      "name": "nl_xeon",
      "node": "XEON 04",
      "processor": "Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz",
      "memory": "DDR3 Synchronous Registered (Buffered) 1600 MHz",
      "nvme_hard_drives": "Samsung SSD PM9A1"
    },
    "config": {
      "cores": 5,
      "mem": 41984,
      "disk": 70,
      "os": {
        "name": "debian_11",
        "displayname": "Debian 11"
      },
      "username": "root",
      "password": "xxxxxxxxxx",
      "hostname": "KVM",
      "network_speed": 2000,
      "backup_slots": 2,
      "ipv4": [
        {
          "ip_address": "88.151.xxx.xxx",
          "ip_gateway": "88.151.xxx.xxx",
          "ddos_protection": "arbor",
          "rdns": "24fire.de"
        }
      ],
      "ipv6": [
        {
          "ip_address": "2a12:8641:xxxx:xxxx::",
          "ip_gateway": "2a12:8641:xxxx::xxxx",
          "requires_restart": false
        }
      ]
    }
  }
}

If you need 1 Value you can do it like this:

const { config, status, start, stop, restart} = require('24fire-full-api');

(async() => {

const Data = await config('YOUR_SERVER_API_KEY');

console.log(Data.data.config.cores);

})();

This will return the Cores Your Server has!

10

To start, stop or restart your server you just need to use the wrapper like this:

const { config, status, start, stop, restart} = require('24fire-full-api');

(async() => {

const Data = await start('YOUR_SERVER_API_KEY');

console.log(Data);

})();

The Console Log is Optional it will return:

{
  "status": "success",
  "requestID": "6220a191-fe11-4d56-a67d-2686b5020505",
  "message": "VM power command sent",
  "data": []
}

If you have any Errors or Questions. Just ask me via dc: m_kenley or open an Issue report on github!

1.0.1

2 years ago

1.0.0

2 years ago