Use the Serverloads API to get the information about the loads on VPS of your server. The API response contains list of serveloads, which are listed according to VPS IDs.
HTTP Request
https://hostname:4085/index.php?act=serverloads
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | serverloads | The action specified to list the server loads | Yes |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$output = $admin->serverloads();
print_r(json_encode($output));
?>
Output
{
"title":"VPS Loads",
"vpsusage":{
"10":{
"1":" 0.00",
"5":" 0.00",
"15":" 0.00"
}
},
"timenow":1563257184,
"time_taken":"0.110"
}