Get Virtualizor

Disk

The Disk API allows you to fetch the disk information of the server, by passing the server ID. The information consists of the disk utilization of both the / root partition and /boot boot partition of the server.

HTTP Request

https://hostname:4085/index.php?act=manageserver&changeserid=SERVERID

Parameters

NameMethodValueDescriptionRequired
actGETmanageserverReturns the disk usage of the serverYes
changeseridGETIntThe ID of the server whose RAM info is needed, default value is zeroNo

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

    $serverid = 1;

    $output = $admin->disk($serid);

    print_r(json_encode($output));

?>

Output

{
    "/": {
        "limit": 9714.86,
        "used": 3473.91,
        "available": 5740.94,
        "free": 6240.94,
        "limit_gb": 9.49,
        "used_gb": 3.39,
        "actual_gb": 3.88,
        "free_gb": 6.09,
        "percent": 35.76,
        "percent_free": 64.24
    },
    "/boot": {
        "limit": 239.92,
        "used": 48.34,
        "available": 178.78,
        "free": 191.58,
        "limit_gb": 0.23,
        "used_gb": 0.05,
        "actual_gb": 0.06,
        "free_gb": 0.19,
        "percent": 20.15,
        "percent_free": 79.85
    }
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list