API Get RAM Usage

From Virtualizor Wiki
Jump to: navigation, search
NOTE
This is OLD API Documentation. Click on the following link for New API Documentation
Admin API

List Ram usage of Host node


Parameters Description
serverid If not specified, then RAM Usage of Master Server is returned

Example Code:

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $output = $admin->ram();
    
    print_r($output);

?>

Returns:

Array
(
    [used] => 6292
    [limit] => 15861
    [swap] => 12287
    [swap_used] => 4084
    [free] => 9569
    [swap_free] => 8203
    [percent] => 39.67
    [percent_free] => 60.33
)