A PHP wrapper class for the SolusVM API which interacts with virtual servers.
version 1.2
- PHP >= 7.4
First edit lines 11,12,13 in class.php
for your hosting providers solusVM URL along with your account API key and API hash
Call the class file on any page that uses it
<?php
require_once('class.php');
Create a new instance on page of use:
$call = new solusClientApi();
$call->allInfo();
array
returns (edited certain values):
{
"status": "online",
"hostname": "myservershostname.com",
"location": "Los Angeles, CA, USA",
"type": "kvm",
"node": "KVM-1.LA.HOST.COM",
"ip_count": 2,
"ip_list": [
"111.222.333.444",
"111.222.333.555",
"111.222.333.666"
],
"mem_total": "512.0",
"mem_used": "220.0",
"mem_used_percent": 42,
"mem_data_type": "MB",
"bw_total": "512.0",
"bw_used": "0.0",
"bw_used_percent": 0,
"bw_data_type": "GB",
"hdd_total": "10.0",
"hdd_used": "5.0",
"hdd_used_percent": 50,
"hdd_data_type": "GB",
"datetime": "2020-04-04 15:56:29"
}
$call->getStatus();
bool
$call->ipCount();
int
$call->ipMain();
string
$call->ip($number);
string
$call->type();
string
$call->hostname();
string
$call->node();
string
$call->location();
string
$call->reboot();
string
$call->boot();
string
$call->shutdown();
string
$call->totalMem($convert_to, $decimals);
string
$call->memAval($convert_to, $decimals);
string
$call->memUsedPercent($decimals);
string
$call->memFreePercent($decimals);
string
$call->totalHdd($convert_to, $decimals);
string
$call->hddAval($convert_to, $decimals);
string
$call->hddUsedPercent($decimals);
string
$call->hddFreePercent($decimals);
string
$call->totalBw($convert_to, $decimals);
string
$call->bwAval($convert_to, $decimals);
string
$call->bwUsedPercent($decimals);
string
$call->bwFreePercent($decimals);
string
$call->rdns($ip, $rdns);
string